[MediaController] Add capability method for subtitle, 360 mode (#1048)
authorhsgwon <haesu.gwon@samsung.com>
Wed, 2 Oct 2019 08:06:55 +0000 (17:06 +0900)
committerGitHub <noreply@github.com>
Wed, 2 Oct 2019 08:06:55 +0000 (17:06 +0900)
* [MediaController] Add capability method for subtitle, 360 mode

src/Tizen.Multimedia.Remoting/MediaController/MediaControlServer.cs
src/Tizen.Multimedia.Remoting/MediaController/MediaController.cs

index 4b788b8..1c1dca6 100644 (file)
@@ -621,6 +621,44 @@ namespace Tizen.Multimedia.Remoting
         }
 
         /// <summary>
+        /// Sets the <see cref="MediaControlCapabilitySupport"/> indicating whether 360 mode is supported or not.
+        /// </summary>
+        /// <param name="support">A value indicating whether the 360 mode is supported or not.</param>
+        /// <exception cref="InvalidOperationException">
+        ///     The server is not running .<br/>
+        ///     -or-<br/>
+        ///     An internal error occurs.
+        /// </exception>
+        /// <exception cref="ArgumentException"><paramref name="support"/> is invalid.</exception>
+        /// <since_tizen> 6 </since_tizen>
+        public static void SetMode360Capability(MediaControlCapabilitySupport support)
+        {
+            ValidationUtil.ValidateEnum(typeof(MediaControlCapabilitySupport), support, nameof(support));
+
+            Native.SetSimpleCapability(Handle, MediaControlNativeCapabilityCategory.Mode360, support).
+                ThrowIfError("Failed to set 360 mode capability.");
+        }
+
+        /// <summary>
+        /// Sets the <see cref="MediaControlCapabilitySupport"/> indicating whether subtitle mode is supported or not.
+        /// </summary>
+        /// <param name="support">A value indicating whether the subtitle mode is supported or not.</param>
+        /// <exception cref="InvalidOperationException">
+        ///     The server is not running .<br/>
+        ///     -or-<br/>
+        ///     An internal error occurs.
+        /// </exception>
+        /// <exception cref="ArgumentException"><paramref name="support"/> is invalid.</exception>
+        /// <since_tizen> 6 </since_tizen>
+        public static void SetSubtitleModeCapability(MediaControlCapabilitySupport support)
+        {
+            ValidationUtil.ValidateEnum(typeof(MediaControlCapabilitySupport), support, nameof(support));
+
+            Native.SetSimpleCapability(Handle, MediaControlNativeCapabilityCategory.Subtitle, support).
+                ThrowIfError("Failed to set subtitle mode capability.");
+        }
+
+        /// <summary>
         /// Sets the supported list of <see cref="MediaControlDisplayMode"/>.
         /// </summary>
         /// <remarks>
index 2f3e6d8..c60bdad 100644 (file)
@@ -638,6 +638,48 @@ namespace Tizen.Multimedia.Remoting
         }
 
         /// <summary>
+        /// Gets the value whether the 360 mode is supported or not.
+        /// </summary>
+        /// <returns>A <see cref="MediaControlCapabilitySupport"/>.</returns>
+        /// <exception cref="InvalidOperationException">
+        ///     The server has already been stopped.<br/>
+        ///     -or-<br/>
+        ///     An internal error occurs.
+        /// </exception>
+        /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed.</exception>
+        /// <since_tizen> 6 </since_tizen>
+        public MediaControlCapabilitySupport GetMode360Capability()
+        {
+            ThrowIfStopped();
+
+            Native.GetSimpleCapability(Manager.Handle, ServerAppId, MediaControlNativeCapabilityCategory.Mode360, out MediaControlCapabilitySupport support).
+                ThrowIfError("Failed to get 360 mode capability");
+
+            return support;
+        }
+
+        /// <summary>
+        /// Gets the value whether the subtitle mode is supported or not.
+        /// </summary>
+        /// <returns>A <see cref="MediaControlCapabilitySupport"/>.</returns>
+        /// <exception cref="InvalidOperationException">
+        ///     The server has already been stopped.<br/>
+        ///     -or-<br/>
+        ///     An internal error occurs.
+        /// </exception>
+        /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed.</exception>
+        /// <since_tizen> 6 </since_tizen>
+        public MediaControlCapabilitySupport GetSubtitleModeCapability()
+        {
+            ThrowIfStopped();
+
+            Native.GetSimpleCapability(Manager.Handle, ServerAppId, MediaControlNativeCapabilityCategory.Subtitle, out MediaControlCapabilitySupport support).
+                ThrowIfError("Failed to get subtitle mode capability");
+
+            return support;
+        }
+
+        /// <summary>
         /// Gets the value whether the repeat mode is supported or not.
         /// </summary>
         /// <returns>