Merge "[NUI] remove deprecated APIs" preview1-00341
authordongsug.song <dongsug.song@samsung.com>
Wed, 25 Oct 2017 02:52:16 +0000 (02:52 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 25 Oct 2017 02:52:17 +0000 (02:52 +0000)
28 files changed:
src/ElmSharp/ElmSharp/ItemObject.cs [changed mode: 0755->0644]
src/ElmSharp/ElmSharp/NaviItem.cs [changed mode: 0755->0644]
src/Tizen.Multimedia.Radio/Interop/Interop.Libraries.cs
src/Tizen.Multimedia.Radio/Interop/Interop.Radio.cs
src/Tizen.Multimedia.Radio/Radio/Radio.cs
src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs
src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs
src/Tizen.Multimedia/Common.Internal/CompatibilitySupport.cs [new file with mode: 0644]
src/Tizen.Multimedia/Interop/Interop.SoundManager.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest5.cs [new file with mode: 0755]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleSliderTest3.cs [new file with mode: 0755]
test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs [changed mode: 0644->0755]
test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest3.cs [new file with mode: 0755]

old mode 100755 (executable)
new mode 100644 (file)
index 0980c5b..f3182aa
@@ -85,7 +85,7 @@ namespace ElmSharp
         /// <summary>
         /// Sets or gets the style of the Item.
         /// </summary>
-        public string Style
+        public virtual string Style
         {
             get
             {
old mode 100755 (executable)
new mode 100644 (file)
index f7da156..44a0d5c
@@ -96,7 +96,7 @@ namespace ElmSharp
         /// <summary>
         /// Sets or gets an item style.
         /// </summary>
-        public string Style
+        public override string Style
         {
             get
             {
index f237099..060623e 100644 (file)
  * limitations under the License.
  */
 
-namespace Tizen.Multimedia
+internal static partial class Interop
 {
-    internal static partial class Interop
+    internal static partial class Libraries
     {
-        internal static partial class Libraries
-        {
-            public const string Radio = "libcapi-media-radio.so.0";
-        }
+        public const string Radio = "libcapi-media-radio.so.0";
     }
 }
index 929324b..7dfc05d 100644 (file)
 
 using System;
 using System.Runtime.InteropServices;
+using Tizen.Multimedia;
 
-namespace Tizen.Multimedia
+internal static partial class Interop
 {
-    internal static partial class Interop
+    internal static class Radio
     {
-        internal static class Radio
-        {
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void SeekCompletedCallback(int frequency, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void SeekCompletedCallback(int frequency, IntPtr userData);
 
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void ScanUpdatedCallback(int frequency, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ScanUpdatedCallback(int frequency, IntPtr userData);
 
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void ScanStoppedCallback(IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ScanStoppedCallback(IntPtr userData);
 
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void ScanCompletedCallback(IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ScanCompletedCallback(IntPtr userData);
 
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void InterruptedCallback(RadioInterruptedReason reason, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void InterruptedCallback(RadioInterruptedReason reason, IntPtr userData);
 
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_create")]
-            internal static extern RadioError Create(out RadioHandle radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_create")]
+        internal static extern RadioError Create(out RadioHandle radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_destroy")]
-            internal static extern RadioError Destroy(IntPtr radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_destroy")]
+        internal static extern RadioError Destroy(IntPtr radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_state")]
-            internal static extern RadioError GetState(RadioHandle radio, out RadioState state);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_state")]
+        internal static extern RadioError GetState(RadioHandle radio, out RadioState state);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_start")]
-            internal static extern RadioError Start(RadioHandle radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_start")]
+        internal static extern RadioError Start(RadioHandle radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_stop")]
-            internal static extern RadioError Stop(RadioHandle radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_stop")]
+        internal static extern RadioError Stop(RadioHandle radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_seek_up")]
-            internal static extern RadioError SeekUp(RadioHandle radio, SeekCompletedCallback callback,
-                IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_seek_up")]
+        internal static extern RadioError SeekUp(RadioHandle radio, SeekCompletedCallback callback,
+            IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_seek_down")]
-            internal static extern RadioError SeekDown(RadioHandle radio, SeekCompletedCallback callback,
-                IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_seek_down")]
+        internal static extern RadioError SeekDown(RadioHandle radio, SeekCompletedCallback callback,
+            IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_set_frequency")]
-            internal static extern RadioError SetFrequency(RadioHandle radio, int frequency);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_set_frequency")]
+        internal static extern RadioError SetFrequency(RadioHandle radio, int frequency);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency")]
-            internal static extern RadioError GetFrequency(RadioHandle radio, out int frequency);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency")]
+        internal static extern RadioError GetFrequency(RadioHandle radio, out int frequency);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_signal_strength")]
-            internal static extern RadioError GetSignalStrength(RadioHandle radio, out int strength);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_signal_strength")]
+        internal static extern RadioError GetSignalStrength(RadioHandle radio, out int strength);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_scan_start")]
-            internal static extern RadioError ScanStart(RadioHandle radio, ScanUpdatedCallback callback,
-                IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_scan_start")]
+        internal static extern RadioError ScanStart(RadioHandle radio, ScanUpdatedCallback callback,
+            IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_scan_stop")]
-            internal static extern RadioError ScanStop(RadioHandle radio, ScanStoppedCallback callback,
-                IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_scan_stop")]
+        internal static extern RadioError ScanStop(RadioHandle radio, ScanStoppedCallback callback,
+            IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_set_mute")]
-            internal static extern RadioError SetMute(RadioHandle radio, bool muted);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_set_mute")]
+        internal static extern RadioError SetMute(RadioHandle radio, bool muted);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_is_muted")]
-            internal static extern RadioError GetMuted(RadioHandle radio, out bool muted);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_is_muted")]
+        internal static extern RadioError GetMuted(RadioHandle radio, out bool muted);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_set_scan_completed_cb")]
-            internal static extern RadioError SetScanCompletedCb(RadioHandle radio,
-                ScanCompletedCallback callback, IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_set_scan_completed_cb")]
+        internal static extern RadioError SetScanCompletedCb(RadioHandle radio,
+            ScanCompletedCallback callback, IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_unset_scan_completed_cb")]
-            internal static extern RadioError UnsetScanCompletedCb(RadioHandle radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_unset_scan_completed_cb")]
+        internal static extern RadioError UnsetScanCompletedCb(RadioHandle radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_set_interrupted_cb")]
-            internal static extern RadioError SetInterruptedCb(RadioHandle radio,
-                InterruptedCallback callback, IntPtr userData = default(IntPtr));
+        [DllImport(Libraries.Radio, EntryPoint = "radio_set_interrupted_cb")]
+        internal static extern RadioError SetInterruptedCb(RadioHandle radio,
+            InterruptedCallback callback, IntPtr userData = default(IntPtr));
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_unset_interrupted_cb")]
-            internal static extern RadioError UnsetInterruptedCb(RadioHandle radio);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_unset_interrupted_cb")]
+        internal static extern RadioError UnsetInterruptedCb(RadioHandle radio);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency_range")]
-            internal static extern RadioError GetFrequencyRange(RadioHandle radio, out int minFreq, out int maxFreq);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency_range")]
+        internal static extern RadioError GetFrequencyRange(RadioHandle radio, out int minFreq, out int maxFreq);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_channel_spacing")]
-            internal static extern RadioError GetChannelSpacing(RadioHandle radio, out int channelSpacing);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_channel_spacing")]
+        internal static extern RadioError GetChannelSpacing(RadioHandle radio, out int channelSpacing);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_set_volume")]
-            internal static extern RadioError SetVolume(RadioHandle radio, float volume);
+        [DllImport(Libraries.Radio, EntryPoint = "radio_set_volume")]
+        internal static extern RadioError SetVolume(RadioHandle radio, float volume);
 
-            [DllImport(Libraries.Radio, EntryPoint = "radio_get_volume")]
-            internal static extern RadioError GetVolume(RadioHandle radio, out float volume);
-        }
+        [DllImport(Libraries.Radio, EntryPoint = "radio_get_volume")]
+        internal static extern RadioError GetVolume(RadioHandle radio, out float volume);
+    }
 
-        internal class RadioHandle : SafeHandle
+    internal class RadioHandle : SafeHandle
+    {
+        protected RadioHandle() : base(IntPtr.Zero, true)
         {
-            protected RadioHandle() : base(IntPtr.Zero, true)
-            {
-            }
+        }
 
-            public override bool IsInvalid => handle == IntPtr.Zero;
+        public override bool IsInvalid => handle == IntPtr.Zero;
 
-            protected override bool ReleaseHandle()
+        protected override bool ReleaseHandle()
+        {
+            var ret = Radio.Destroy(handle);
+            if (ret != RadioError.None)
             {
-                var ret = Radio.Destroy(handle);
-                if (ret != RadioError.None)
-                {
-                    Log.Debug(GetType().FullName, $"Failed to release native handle.");
-                    return false;
-                }
-
-                return true;
+                Tizen.Log.Debug(GetType().FullName, $"Failed to release native handle.");
+                return false;
             }
+
+            return true;
         }
     }
 }
index 8bf3f59..5b4f4cc 100755 (executable)
 
 using System;
 using System.Linq;
-using System.Runtime.InteropServices;
 using System.Threading.Tasks;
 using Tizen.System;
-using static Tizen.Multimedia.Interop.Radio;
+using Native = Interop.Radio;
+using static Interop;
 
 namespace Tizen.Multimedia
 {
@@ -28,7 +28,7 @@ namespace Tizen.Multimedia
     /// </summary>
     public class Radio : IDisposable
     {
-        private Interop.RadioHandle _handle;
+        private RadioHandle _handle;
 
         private const string FeatureFmRadio = "http://tizen.org/feature/fmradio";
 
@@ -38,19 +38,20 @@ namespace Tizen.Multimedia
         /// <exception cref="NotSupportedException">The radio feature is not supported.</exception>
         public Radio()
         {
+            CompatibilitySupport.DisableSessionBackwardCompatibility();
+
             ValidateFeatureSupported(FeatureFmRadio);
 
-            Create(out _handle);
+            Native.Create(out _handle);
 
             try
             {
-                _scanCompletedCallback = _ => ScanCompleted?.Invoke(this, EventArgs.Empty);
-                _interruptedCallback = (reason, _) => Interrupted?.Invoke(this, new RadioInterruptedEventArgs(reason));
-                _scanUpdatedCallback = (frequency, _) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency));
-                _scanStoppedCallback = _ => ScanStopped?.Invoke(this, EventArgs.Empty);
+                InitCallbacks();
 
-                SetScanCompletedCb(_handle, _scanCompletedCallback).ThrowIfFailed("Failed to initialize radio");
-                SetInterruptedCb(_handle, _interruptedCallback).ThrowIfFailed("Failed to initialize radio");
+                Native.SetScanCompletedCb(_handle, _scanCompletedCallback).
+                    ThrowIfFailed("Failed to initialize radio");
+                Native.SetInterruptedCb(_handle, _interruptedCallback).
+                    ThrowIfFailed("Failed to initialize radio");
             }
             catch (Exception)
             {
@@ -59,7 +60,20 @@ namespace Tizen.Multimedia
             }
         }
 
-        private Interop.RadioHandle Handle
+        private void InitCallbacks()
+        {
+            _scanCompletedCallback = _ => ScanCompleted?.Invoke(this, EventArgs.Empty);
+
+            _interruptedCallback =
+                (reason, _) => Interrupted?.Invoke(this, new RadioInterruptedEventArgs(reason));
+
+            _scanUpdatedCallback =
+                (frequency, _) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency));
+
+            _scanStoppedCallback = _ => ScanStopped?.Invoke(this, EventArgs.Empty);
+        }
+
+        private RadioHandle Handle
         {
             get
             {
@@ -71,13 +85,13 @@ namespace Tizen.Multimedia
             }
         }
 
-        private ScanUpdatedCallback _scanUpdatedCallback;
+        private Native.ScanUpdatedCallback _scanUpdatedCallback;
 
-        private ScanStoppedCallback _scanStoppedCallback;
+        private Native.ScanStoppedCallback _scanStoppedCallback;
 
-        private ScanCompletedCallback _scanCompletedCallback;
+        private Native.ScanCompletedCallback _scanCompletedCallback;
 
-        private InterruptedCallback _interruptedCallback;
+        private Native.InterruptedCallback _interruptedCallback;
 
         /// <summary>
         /// Occurs when the radio scanning information is updated.
@@ -106,8 +120,7 @@ namespace Tizen.Multimedia
         {
             get
             {
-                RadioState state;
-                GetState(Handle, out state);
+                Native.GetState(Handle, out var state).ThrowIfFailed("Failed to get state");
                 return state;
             }
         }
@@ -124,18 +137,18 @@ namespace Tizen.Multimedia
         {
             get
             {
-                int value = 0;
-                GetFrequency(Handle, out value).ThrowIfFailed("Failed to get frequency");
+                Native.GetFrequency(Handle, out var value).ThrowIfFailed("Failed to get frequency");
                 return value;
             }
             set
             {
                 if (value < FrequencyRange.Min || value > FrequencyRange.Max)
                 {
-                    throw new ArgumentOutOfRangeException(nameof(Frequency), value, "Frequency must be within FrequencyRange.");
+                    throw new ArgumentOutOfRangeException(nameof(Frequency), value,
+                        "Frequency must be within FrequencyRange.");
                 }
 
-                SetFrequency(Handle, value).ThrowIfFailed("Failed to set frequency");
+                Native.SetFrequency(Handle, value).ThrowIfFailed("Failed to set frequency");
             }
         }
 
@@ -147,7 +160,7 @@ namespace Tizen.Multimedia
             get
             {
                 int value = 0;
-                GetSignalStrength(Handle, out value).ThrowIfFailed("Failed to get signal strength");
+                Native.GetSignalStrength(Handle, out value).ThrowIfFailed("Failed to get signal strength");
                 return value;
             }
         }
@@ -163,13 +176,12 @@ namespace Tizen.Multimedia
         {
             get
             {
-                bool value;
-                GetMuted(Handle, out value).ThrowIfFailed("Failed to get the mute state");
+                Native.GetMuted(Handle, out var value).ThrowIfFailed("Failed to get the mute state");
                 return value;
             }
             set
             {
-                SetMute(Handle, value).ThrowIfFailed("Failed to set the mute state");
+                Native.SetMute(Handle, value).ThrowIfFailed("Failed to set the mute state");
             }
         }
 
@@ -180,8 +192,8 @@ namespace Tizen.Multimedia
         {
             get
             {
-                int value;
-                GetChannelSpacing(Handle, out value).ThrowIfFailed("Failed to get channel spacing");
+                Native.GetChannelSpacing(Handle, out var value).
+                    ThrowIfFailed("Failed to get channel spacing");
                 return value;
             }
         }
@@ -200,8 +212,7 @@ namespace Tizen.Multimedia
         {
             get
             {
-                float value;
-                GetVolume(Handle, out value).ThrowIfFailed("Failed to get volume level.");
+                Native.GetVolume(Handle, out var value).ThrowIfFailed("Failed to get volume level.");
                 return value;
             }
             set
@@ -212,7 +223,7 @@ namespace Tizen.Multimedia
                         $"Valid volume range is 0 <= value <= 1.0, but got { value }.");
                 }
 
-                SetVolume(Handle, value).ThrowIfFailed("Failed to set volume level");
+                Native.SetVolume(Handle, value).ThrowIfFailed("Failed to set volume level");
             }
         }
 
@@ -223,9 +234,8 @@ namespace Tizen.Multimedia
         {
             get
             {
-                int min, max;
-
-                GetFrequencyRange(Handle, out min, out max).ThrowIfFailed("Failed to get frequency range");
+                Native.GetFrequencyRange(Handle, out var min, out var max).
+                    ThrowIfFailed("Failed to get frequency range");
 
                 return new Range(min, max);
             }
@@ -240,7 +250,7 @@ namespace Tizen.Multimedia
         {
             ValidateRadioState(RadioState.Ready);
 
-            Interop.Radio.Start(Handle).ThrowIfFailed("Failed to start radio");
+            Native.Start(Handle).ThrowIfFailed("Failed to start radio");
         }
 
         /// <summary>
@@ -252,7 +262,7 @@ namespace Tizen.Multimedia
         {
             ValidateRadioState(RadioState.Playing);
 
-            Interop.Radio.Stop(Handle).ThrowIfFailed("Failed to stop radio");
+            Native.Stop(Handle).ThrowIfFailed("Failed to stop radio");
         }
 
         /// <summary>
@@ -266,7 +276,7 @@ namespace Tizen.Multimedia
         {
             ValidateRadioState(RadioState.Ready, RadioState.Playing);
 
-            ScanStart(Handle, _scanUpdatedCallback).ThrowIfFailed("Failed to start scanning");
+            Native.ScanStart(Handle, _scanUpdatedCallback).ThrowIfFailed("Failed to start scanning");
         }
 
         /// <summary>
@@ -279,7 +289,7 @@ namespace Tizen.Multimedia
         {
             ValidateRadioState(RadioState.Scanning);
 
-            ScanStop(Handle, _scanStoppedCallback).ThrowIfFailed("Failed to stop scanning");
+            Native.ScanStop(Handle, _scanStoppedCallback).ThrowIfFailed("Failed to stop scanning");
         }
 
         /// <summary>
@@ -298,7 +308,7 @@ namespace Tizen.Multimedia
         /// </exception>
         public Task<int> SeekUpAsync()
         {
-            return SeekAsync(SeekUp);
+            return SeekAsync(Native.SeekUp);
         }
 
         /// <summary>
@@ -317,28 +327,23 @@ namespace Tizen.Multimedia
         /// </exception>
         public Task<int> SeekDownAsync()
         {
-            return SeekAsync(SeekDown);
+            return SeekAsync(Native.SeekDown);
         }
 
-        private async Task<int> SeekAsync(Func<Interop.RadioHandle, SeekCompletedCallback, IntPtr, RadioError> func)
+        private async Task<int> SeekAsync(
+            Func<RadioHandle, Native.SeekCompletedCallback, IntPtr, RadioError> func)
         {
             ValidateRadioState(RadioState.Playing);
 
             var tcs = new TaskCompletionSource<int>();
-            SeekCompletedCallback callback = (currentFrequency, _) => tcs.TrySetResult(currentFrequency);
+            Native.SeekCompletedCallback callback =
+                (currentFrequency, _) => tcs.TrySetResult(currentFrequency);
 
-            GCHandle gcHandle;
-            try
+            using (ObjectKeeper.Get(callback))
             {
-                gcHandle = GCHandle.Alloc(callback);
-
                 func(Handle, callback, IntPtr.Zero).ThrowIfFailed("Failed to seek");
                 return await tcs.Task;
             }
-            finally
-            {
-                gcHandle.Free();
-            }
         }
 
         private void ValidateFeatureSupported(string featurePath)
@@ -347,7 +352,6 @@ namespace Tizen.Multimedia
             {
                 throw new NotSupportedException($"The feature({featurePath}) is not supported.");
             }
-
         }
 
         private void ValidateRadioState(params RadioState[] required)
index 2263f2a..55364c9 100644 (file)
@@ -114,13 +114,14 @@ namespace Tizen.Multimedia.Util
         {
             var tcs = new TaskCompletionSource<bool>();
 
-            IntPtr outBuffer = IntPtr.Zero;
-            Unmanaged.SetOutputBuffer(Handle, out outBuffer).ThrowIfFailed("Failed to initialize encoder");
-
             Task.Run(() =>
             {
+                IntPtr outBuffer = IntPtr.Zero;
+
                 try
                 {
+                    Unmanaged.SetOutputBuffer(Handle, out outBuffer).ThrowIfFailed("Failed to initialize encoder");
+
                     ulong size = 0;
                     Unmanaged.Run(Handle, out size).ThrowIfFailed("Failed to encode given image");
 
index 3c08449..889dfc9 100644 (file)
@@ -74,13 +74,13 @@ namespace Tizen.Multimedia.Util
 
         internal abstract void Configure(TransformHandle handle);
 
-        internal virtual Task<MediaPacket> ApplyAsync(MediaPacket source)
+        internal virtual async Task<MediaPacket> ApplyAsync(MediaPacket source)
         {
             using (TransformHandle handle = CreateHandle())
             {
                 Configure(handle);
 
-                return RunAsync(handle, source);
+                return await RunAsync(handle, source);
             }
         }
     }
diff --git a/src/Tizen.Multimedia/Common.Internal/CompatibilitySupport.cs b/src/Tizen.Multimedia/Common.Internal/CompatibilitySupport.cs
new file mode 100644 (file)
index 0000000..a9a97d6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+namespace Tizen.Multimedia
+{
+    internal static class CompatibilitySupport
+    {
+        internal static void DisableSessionBackwardCompatibility()
+        {
+            var result = Interop.SoundManager.DisableSessionBackwardCompatibility();
+            if (result != AudioManagerError.None)
+            {
+                Log.Warn(nameof(Multimedia),
+                    $"Failed to disable session backward compatibility({result}).");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Multimedia/Interop/Interop.SoundManager.cs b/src/Tizen.Multimedia/Interop/Interop.SoundManager.cs
new file mode 100644 (file)
index 0000000..9a7d55a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+namespace Tizen.Multimedia
+{
+    internal static partial class Interop
+    {
+        internal static class SoundManager
+        {
+            [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_disable_session_backward_compatibility")]
+            internal static extern AudioManagerError DisableSessionBackwardCompatibility();
+        }
+    }
+}
old mode 100644 (file)
new mode 100755 (executable)
index 4ddaba3..316de85
@@ -37,12 +37,13 @@ namespace ElmSharp.Test.TC
 
             var surface = new CircleSurface(conformant);
 
-            DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
+            var datetime = new CircleDateTimeSelector(conformant, surface)
             {
                 MinimumDateTime = new DateTime(2015, 1, 1),
                 MaximumDateTime = DateTime.Now,
                 DateTime = DateTime.Now
             };
+            ((IRotaryActionWidget)datetime).Activate();
 
             layout.SetContent(datetime);
 
old mode 100644 (file)
new mode 100755 (executable)
index d27b4fc..90c58b3
@@ -37,12 +37,12 @@ namespace ElmSharp.Test.TC
 
             var surface = new CircleSurface(conformant);
 
-            DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
+            var datetime = new CircleDateTimeSelector(conformant, surface)
             {
                 DateTime = DateTime.Now,
                 Style = "timepicker/circle"
             };
-
+            ((IRotaryActionWidget)datetime).Activate();
             layout.SetContent(datetime);
 
             Button btn = new Button(layout)
old mode 100644 (file)
new mode 100755 (executable)
index 64ee69b..6ea1d1e
@@ -37,13 +37,13 @@ namespace ElmSharp.Test.TC
 
             var surface = new CircleSurface(conformant);
 
-            DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
+            var datetime = new CircleDateTimeSelector(conformant, surface)
             {
                 DateTime = DateTime.Now,
                 Style = "timepicker/circle",
                 IsEnabled = false
             };
-
+            ((IRotaryActionWidget)datetime).Activate();
             layout.SetContent(datetime);
 
             Button btn = new Button(layout)
old mode 100644 (file)
new mode 100755 (executable)
index 5a81497..c2ffa60
@@ -29,15 +29,15 @@ namespace ElmSharp.Test.TC
             Conformant conformant = new Conformant(window);
             conformant.Show();
 
-            Layout layout = new Layout(window);
+            var naviframe = new Naviframe(window);
 
+            conformant.SetContent(naviframe);
+            Layout layout = new Layout(naviframe);
             layout.SetTheme("layout", "circle", "datetime");
 
-            conformant.SetContent(layout);
-
             var surface = new CircleSurface(conformant);
 
-            DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
+            DateTimeSelector datetime = new CircleDateTimeSelector(naviframe, surface)
             {
                 DateTime = DateTime.Now,
                 Style = "timepicker/circle",
@@ -45,7 +45,7 @@ namespace ElmSharp.Test.TC
                 MarkerColor = Color.Pink,
                 MarkerRadius = 100,
             };
-
+            ((IRotaryActionWidget)datetime).Activate();
             layout.SetContent(datetime);
 
             Button btn = new Button(layout)
@@ -58,6 +58,8 @@ namespace ElmSharp.Test.TC
 
             layout.SetPartText("elm.text", "Set time");
 
+            naviframe.Push(layout, null, "empty");
+
             datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
             {
                 Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
old mode 100644 (file)
new mode 100755 (executable)
index 2443827..eb821d3
@@ -37,7 +37,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBackgroundColor = Color.Pink,
                 VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Visible,
             };
-
+            ((IRotaryActionWidget)list).Activate();
             conformant.SetContent(list);
 
             GenItemClass defaultClass = new GenItemClass("default")
old mode 100644 (file)
new mode 100755 (executable)
index af50687..54447fa
@@ -43,7 +43,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarLineWidth = 30,
             };
             list.Show();
-
+            ((IRotaryActionWidget)list).Activate();
             list.Move(0, 0);
             list.Resize(360, 360);
             list.Lower();
old mode 100644 (file)
new mode 100755 (executable)
index ab8c62b..8116136
@@ -32,7 +32,7 @@ namespace ElmSharp.Test.TC
 
             conformant.SetContent(naviframe);
 
-            var surface = new CircleSurface(naviframe);
+            var surface = new CircleSurface(conformant);
 
             var list = new CircleGenList(naviframe, surface)
             {
@@ -40,7 +40,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
                 IsEnabled = false,
             };
-
+            ((IRotaryActionWidget)list).Activate();
             var item = naviframe.Push(list);
             item.Style = "empty";
 
old mode 100644 (file)
new mode 100755 (executable)
index 184cb05..ac968fa
@@ -33,7 +33,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
             };
             list.Show();
-
+            ((IRotaryActionWidget)list).Activate();
             list.Move(0, 0);
             list.Resize(360, 360);
 
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest5.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest5.cs
new file mode 100755 (executable)
index 0000000..1dda1ab
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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 ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleProgressBarTest5 : TestCaseBase
+    {
+        public override string TestName => "CircleProgressBarTest5";
+        public override string TestDescription => "To test Disabled property of CircleProgressBar";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleProgressBar run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe naviframe = new Naviframe(window);
+            naviframe.Show();
+            conformant.SetContent(naviframe);
+
+            var surface = new CircleSurface(conformant);
+            CircleProgressBar pb1 = new CircleProgressBar(naviframe, surface)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Value = 0,
+                Maximum = 100,
+                Minimum = 0,
+            };
+            pb1.Show();
+            naviframe.Push(pb1, null, "empty");
+
+            Label lb1 = new Label(window)
+            {
+                Text = string.Format("S {0} %", pb1.Value),
+            };
+
+            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
+            lb1.Show();
+
+            EcoreMainloop.AddTimer(0.05, () =>
+            {
+                if (pb1.Value == pb1.Maximum/2)
+                {
+                    // Test purpose : set disable
+                    pb1.IsEnabled = false;
+                }
+
+                if (pb1.Value == pb1.Maximum)
+                {
+                    EcoreMainloop.RemoveTimer(pb1);
+                }
+
+                pb1.Value += 1;
+                lb1.Text = string.Format("S {0} %", pb1.Value);
+
+                return true;
+            });
+        }
+    }
+}
old mode 100644 (file)
new mode 100755 (executable)
index 9872c73..e5ee27f
@@ -39,6 +39,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
                 HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
             };
+            ((IRotaryActionWidget)circleScroller).Activate();
             circleScroller.Show();
             conformant.SetContent(circleScroller);
             Box box = new Box(window)
old mode 100644 (file)
new mode 100755 (executable)
index 5742f24..96e27a3
@@ -41,6 +41,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
                 HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
             };
+            ((IRotaryActionWidget)circleScroller).Activate();
             circleScroller.Show();
             circleScroller.Move(0, 0);
             circleScroller.Resize(360, 360);
old mode 100644 (file)
new mode 100755 (executable)
index b9688a7..1a8cb0c
@@ -29,9 +29,11 @@ namespace ElmSharp.Test.TC
             Conformant conformant = new Conformant(window);
             conformant.Show();
 
-            Naviframe naviframe = new Naviframe(conformant);
+            Naviframe naviframe = new Naviframe(window);
+            naviframe.Show();
+            conformant.SetContent(naviframe);
 
-            var surface = new CircleSurface(naviframe);
+            var surface = new CircleSurface(conformant);
             CircleScroller circleScroller = new CircleScroller(naviframe, surface)
             {
                 AlignmentX = -1,
@@ -45,10 +47,10 @@ namespace ElmSharp.Test.TC
                 HorizontalScrollBarLineWidth = 15,
                 HorizontalScrollBackgroundLineWidth = 15,
             };
+            ((IRotaryActionWidget)circleScroller).Activate();
             circleScroller.Show();
-            naviframe.Push(circleScroller);
-            naviframe.Show();
-            conformant.SetContent(naviframe);
+            naviframe.Push(circleScroller, null , "empty");
+
 
             Box box = new Box(window)
             {
old mode 100644 (file)
new mode 100755 (executable)
index c81e01f..bad9f09
@@ -41,6 +41,7 @@ namespace ElmSharp.Test.TC
                 VerticalScrollBarRadius = 170,
                 VerticalScrollBackgroundRadius = 170,
             };
+            ((IRotaryActionWidget)circleScroller).Activate();
             circleScroller.Show();
             circleScroller.Move(0, 0);
             circleScroller.Resize(360, 360);
old mode 100644 (file)
new mode 100755 (executable)
index 12681c2..1fd548d
@@ -40,6 +40,7 @@ namespace ElmSharp.Test.TC
                 Value = 25,
                 Step = 5,
             };
+            ((IRotaryActionWidget)circleSlider).Activate();
             circleSlider.Show();
             conformant.SetContent(circleSlider);
 
old mode 100644 (file)
new mode 100755 (executable)
index 179638e..ece5633
@@ -51,6 +51,7 @@ namespace ElmSharp.Test.TC
                 Value = 3,
                 Step = 0.5,
             };
+            ((IRotaryActionWidget)circleSlider).Activate();
             circleSlider.Show();
             conformant.SetContent(circleSlider);
             Label label1 = new Label(window)
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleSliderTest3.cs
new file mode 100755 (executable)
index 0000000..2ca3c57
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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 ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleSliderTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleSliderTest3";
+        public override string TestDescription => "To test basic operation of CircleSlider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe naviframe = new Naviframe(window);
+            naviframe.Show();
+            conformant.SetContent(naviframe);
+
+            var surface = new CircleSurface(conformant);
+            CircleSlider circleSlider = new CircleSlider(naviframe, surface)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Minimum = 0,
+                Maximum = 20,
+                Value = 5,
+                Step = 0.5,
+            };
+            ((IRotaryActionWidget)circleSlider).Activate();
+            circleSlider.Show();
+            naviframe.Push(circleSlider, null, "empty");
+
+            Label label1 = new Label(window)
+            {
+                Text = string.Format("{0:F1}", circleSlider.Value),
+                Color = Color.White,
+            };
+
+            label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            label1.Move(170, window.ScreenSize.Height / 2 - 20);
+            label1.Show();
+
+            circleSlider.ValueChanged += (s, e) =>
+            {
+                label1.Text = string.Format("{0:F1}", circleSlider.Value);
+            };
+
+        }
+    }
+}
old mode 100644 (file)
new mode 100755 (executable)
index 5c6eabd..87c6a0a
@@ -50,6 +50,7 @@ namespace ElmSharp.Test.TC
                 WeightX = 1,
                 WeightY = 1
             };
+            ((IRotaryActionWidget)spn1).Activate();
             spn1.AddSpecialValue(50, "50 match !!!!");
             layout.SetContent(spn1);
 
old mode 100644 (file)
new mode 100755 (executable)
index 50db506..80c5372
@@ -36,7 +36,7 @@ namespace ElmSharp.Test.TC
             var surface = new CircleSurface(conformant);
             CircleSpinner spn1 = new CircleSpinner(conformant, surface)
             {
-                Text = "Slider Test",
+                Text = "Spinner Test",
                 LabelFormat = "%d Value",
                 Style = "circle",
                 AngleRatio = 3.0,
@@ -54,6 +54,7 @@ namespace ElmSharp.Test.TC
                 MarkerColor = Color.Pink,
                 MarkerRadius = 100,
             };
+            ((IRotaryActionWidget)spn1).Activate();
             spn1.AddSpecialValue(50, "50 match !!!!");
             layout.SetContent(spn1);
 
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest3.cs
new file mode 100755 (executable)
index 0000000..57843c8
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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 ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleSpinnerTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleSpinnerTest3";
+        public override string TestDescription => "To test basic operation of Circle Spinner";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleSpinnerTest run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe naviframe = new Naviframe(window);
+            naviframe.Show();
+            conformant.SetContent(naviframe);
+
+            Layout layout = new Layout(naviframe);
+            layout.SetTheme("layout", "circle", "spinner");
+
+            var surface = new CircleSurface(conformant);
+            CircleSpinner spn1 = new CircleSpinner(naviframe, surface)
+            {
+                Text = "Spinner Test",
+                LabelFormat = "%d Value",
+                Style = "circle",
+                AngleRatio = 3.0,
+                Minimum = 0,
+                Maximum = 360,
+                Value = 0,
+                Step = 10,
+                Interval = 0.5,
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            ((IRotaryActionWidget)spn1).Activate();
+            spn1.AddSpecialValue(50, "50 match !!!!");
+            layout.SetContent(spn1);
+
+            Button btn = new Button(layout) {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+            layout.SetPartText("elm.text", "Set value");
+
+            naviframe.Push(layout, null, "empty");
+        }
+    }
+}