[Player] Splitted Interop file into several files.
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 19 May 2017 02:32:32 +0000 (11:32 +0900)
committercoderhyme <jhyo.kim@samsung.com>
Tue, 30 May 2017 06:29:52 +0000 (15:29 +0900)
Change-Id: Ibf3e23f10ff49ea6d9c5304a698c92a37d10d183
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs [new file with mode: 0644]
src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs [new file with mode: 0644]
src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Player.cs
src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs
src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs
src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs

diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs
new file mode 100644 (file)
index 0000000..10a935e
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Multimedia;
+
+internal static partial class Interop
+{
+    internal static partial class AudioEffect
+    {
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_bands_count")]
+        internal static extern PlayerErrorCode GetEqualizerBandsCount(IntPtr player, out int count);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_band_level")]
+        internal static extern PlayerErrorCode SetEqualizerBandLevel(IntPtr player, int index, int level);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_level")]
+        internal static extern PlayerErrorCode GetEqualizerBandLevel(IntPtr player, int index, out int level);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_all_bands")]
+        internal static extern PlayerErrorCode SetEqualizerAllBands(IntPtr player, out int band_levels, int length);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_level_range")]
+        internal static extern PlayerErrorCode GetEqualizerLevelRange(IntPtr player, out int min, out int max);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency")]
+        internal static extern PlayerErrorCode GetEqualizerBandFrequency(IntPtr player, int index, out int frequency);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency_range")]
+        internal static extern PlayerErrorCode GetEqualizerBandFrequencyRange(IntPtr player, int index, out int range);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_clear")]
+        internal static extern PlayerErrorCode EqualizerClear(IntPtr player);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_is_available")]
+        internal static extern PlayerErrorCode EqualizerIsAvailable(IntPtr player, out bool available);
+    }
+    
+}
diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs
new file mode 100644 (file)
index 0000000..c8eea4b
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Multimedia;
+
+internal static partial class Interop
+{
+    internal static partial class Display
+    {
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_display_mode")]
+        internal static extern PlayerErrorCode SetMode(IntPtr player, PlayerDisplayMode mode);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_get_display_mode")]
+        internal static extern PlayerErrorCode GetMode(IntPtr player, out int mode);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_display_visible")]
+        internal static extern PlayerErrorCode SetVisible(IntPtr player, bool visible);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_is_display_visible")]
+        internal static extern PlayerErrorCode IsVisible(IntPtr player, out bool visible);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_display_rotation")]
+        internal static extern PlayerErrorCode SetRotation(IntPtr player, PlayerDisplayRotation rotation);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_get_display_rotation")]
+        internal static extern PlayerErrorCode GetRotation(IntPtr player, out int rotation);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_display_roi_area")]
+        internal static extern PlayerErrorCode SetRoi(IntPtr player, int x, int y, int width, int height);
+    }
+}
index d49ec44..b748044 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 using System;
 using System.Runtime.InteropServices;
 using Tizen;
@@ -44,7 +60,6 @@ internal static partial class Interop
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void SeekCompletedCallback(IntPtr userData);
 
-
         [DllImport(Libraries.Player, EntryPoint = "player_create")]
         internal static extern PlayerErrorCode Create(out PlayerHandle player);
 
@@ -195,54 +210,6 @@ internal static partial class Interop
         [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_min_threshold")]
         internal static extern PlayerErrorCode GetMediaStreamBufferMinThreshold(IntPtr player, int type, out uint percent);
 
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_bands_count")]
-        internal static extern PlayerErrorCode AudioEffectGetEqualizerBandsCount(IntPtr player, out int count);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_band_level")]
-        internal static extern PlayerErrorCode AudioEffectSetEqualizerBandLevel(IntPtr player, int index, int level);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_level")]
-        internal static extern PlayerErrorCode AudioEffectGetEqualizerBandLevel(IntPtr player, int index, out int level);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_all_bands")]
-        internal static extern PlayerErrorCode AudioEffectSetEqualizerAllBands(IntPtr player, out int band_levels, int length);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_level_range")]
-        internal static extern PlayerErrorCode AudioEffectGetEqualizerLevelRange(IntPtr player, out int min, out int max);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency")]
-        internal static extern PlayerErrorCode AudioEffectGetEqualizerBandFrequency(IntPtr player, int index, out int frequency);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency_range")]
-        internal static extern PlayerErrorCode AudioEffectGetEqualizerBandFrequencyRange(IntPtr player, int index, out int range);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_clear")]
-        internal static extern PlayerErrorCode AudioEffectEqualizerClear(IntPtr player);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_is_available")]
-        internal static extern PlayerErrorCode AudioEffectEqualizerIsAvailable(IntPtr player, out bool available);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_set_display_mode")]
-        internal static extern PlayerErrorCode SetDisplayMode(IntPtr player, PlayerDisplayMode mode);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_get_display_mode")]
-        internal static extern PlayerErrorCode GetDisplayMode(IntPtr player, out int mode);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_set_display_visible")]
-        internal static extern PlayerErrorCode SetDisplayVisible(IntPtr player, bool visible);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_is_display_visible")]
-        internal static extern PlayerErrorCode IsDisplayVisible(IntPtr player, out bool visible);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_set_display_rotation")]
-        internal static extern PlayerErrorCode SetDisplayRotation(IntPtr player, PlayerDisplayRotation rotation);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_get_display_rotation")]
-        internal static extern PlayerErrorCode GetDisplayRotation(IntPtr player, out int rotation);
-
-        [DllImport(Libraries.Player, EntryPoint = "player_set_display_roi_area")]
-        internal static extern PlayerErrorCode SetDisplayRoi(IntPtr player, int x, int y, int width, int height);
-
         [DllImport(Libraries.Player, EntryPoint = "player_get_content_info")]
         internal static extern PlayerErrorCode GetContentInfo(IntPtr player, StreamMetadataKey key, out IntPtr value);
 
index 9886551..1c30ded 100644 (file)
@@ -13,8 +13,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 using System;
-using static Interop;
+using Native = Interop.AudioEffect;
 
 namespace Tizen.Multimedia
 {
@@ -31,7 +32,7 @@ namespace Tizen.Multimedia
 
             bool available = false;
 
-            NativePlayer.AudioEffectEqualizerIsAvailable(Player.Handle, out available).
+            Native.EqualizerIsAvailable(Player.Handle, out available).
                 ThrowIfFailed("Failed to initialize the AudioEffect");
 
             IsAvailable = available;
@@ -42,12 +43,12 @@ namespace Tizen.Multimedia
             }
 
             int count = 0;
-            NativePlayer.AudioEffectGetEqualizerBandsCount(Player.Handle, out count).
+            Native.GetEqualizerBandsCount(Player.Handle, out count).
                 ThrowIfFailed("Failed to initialize the AudioEffect");
 
             int min = 0;
             int max = 0;
-            NativePlayer.AudioEffectGetEqualizerLevelRange(Player.Handle, out min, out max).
+            Native.GetEqualizerLevelRange(Player.Handle, out min, out max).
                 ThrowIfFailed("Failed to initialize the AudioEffect");
 
             Count = count;
@@ -98,7 +99,7 @@ namespace Tizen.Multimedia
             Log.Debug(PlayerLog.Tag, PlayerLog.Enter);
             Player.ValidateNotDisposed();
 
-            NativePlayer.AudioEffectEqualizerClear(Player.Handle).
+            Native.EqualizerClear(Player.Handle).
                 ThrowIfFailed("Failed to clear equalizer effect");
             Log.Debug(PlayerLog.Tag, PlayerLog.Leave);
         }
index 699f05f..e4ecec7 100644 (file)
@@ -15,7 +15,7 @@
  */
 using System;
 using System.Diagnostics;
-using static Interop;
+using Native = Interop.AudioEffect;
 
 namespace Tizen.Multimedia
 {
@@ -39,10 +39,10 @@ namespace Tizen.Multimedia
             int frequency = 0;
             int range = 0;
 
-            NativePlayer.AudioEffectGetEqualizerBandFrequency(_owner.Player.Handle, _index, out frequency).
+            Native.GetEqualizerBandFrequency(_owner.Player.Handle, _index, out frequency).
                 ThrowIfFailed("Failed to initialize equalizer band");
 
-            NativePlayer.AudioEffectGetEqualizerBandFrequencyRange(_owner.Player.Handle, _index, out range).
+            Native.GetEqualizerBandFrequencyRange(_owner.Player.Handle, _index, out range).
                 ThrowIfFailed("Failed to initialize equalizer band");
 
             Frequency = frequency;
@@ -73,7 +73,7 @@ namespace Tizen.Multimedia
                     $"but got {value}.");
             }
 
-            NativePlayer.AudioEffectSetEqualizerBandLevel(_owner.Player.Handle, _index, value).
+            Native.SetEqualizerBandLevel(_owner.Player.Handle, _index, value).
                 ThrowIfFailed("Failed to set the level of the equalizer band");
         }
 
@@ -87,7 +87,7 @@ namespace Tizen.Multimedia
             _owner.Player.ValidateNotDisposed();
 
             int value = 0;
-            NativePlayer.AudioEffectGetEqualizerBandLevel(_owner.Player.Handle, _index, out value).
+            Native.GetEqualizerBandLevel(_owner.Player.Handle, _index, out value).
                 ThrowIfFailed("Failed to get the level of the equalizer band");
             Log.Info(PlayerLog.Tag, "get level : " + value);
             return value;
index b7ac89a..11e16ee 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 using System;
 using System.Diagnostics;
-using static Interop;
+using Native = Interop.Display;
 
 namespace Tizen.Multimedia
 {
@@ -63,7 +64,7 @@ namespace Tizen.Multimedia
 
                 ValidationUtil.ValidateEnum(typeof(PlayerDisplayMode), value);
 
-                NativePlayer.SetDisplayMode(Player.Handle, value).
+                Native.SetMode(Player.Handle, value).
                     ThrowIfFailed("Failed to set display mode");
 
                 _displayMode = value;
@@ -95,7 +96,7 @@ namespace Tizen.Multimedia
                     return;
                 }
 
-                NativePlayer.SetDisplayVisible(Player.Handle, value).
+                Native.SetVisible(Player.Handle, value).
                     ThrowIfFailed("Failed to set the visible state of the display");
 
                 _isVisible = value;
@@ -130,7 +131,7 @@ namespace Tizen.Multimedia
 
                 ValidationUtil.ValidateEnum(typeof(PlayerDisplayRotation), value);
 
-                NativePlayer.SetDisplayRotation(Player.Handle, value).
+                Native.SetRotation(Player.Handle, value).
                     ThrowIfFailed("Failed to set the rotation state of the display");
 
                 _rotation = value;
@@ -170,7 +171,7 @@ namespace Tizen.Multimedia
                     $"The height of the roi can't be less than or equal to zero.");
             }
 
-            NativePlayer.SetDisplayRoi(Player.Handle, roi.X, roi.Y, roi.Width, roi.Height).
+            Native.SetRoi(Player.Handle, roi.X, roi.Y, roi.Width, roi.Height).
                 ThrowIfFailed("Failed to set the roi");
         }
     }