[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 4b788b80c57a7dc547dffddef1cf9a04abd84e39..1c1dca6c862a7d9becafe03e7e7781e53f86ff28 100644 (file)
@@ -620,6 +620,44 @@ namespace Tizen.Multimedia.Remoting
                 ThrowIfError("Failed to set repeat mode capability.");
         }
 
+        /// <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>
index 2f3e6d8267df240130bffe1e3e44da28d02d84c2..c60bdad7eab80451e9938496eee1eb52b9d1a42c 100644 (file)
@@ -637,6 +637,48 @@ namespace Tizen.Multimedia.Remoting
             return support;
         }
 
+        /// <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>