示例#1
0
        /// <summary>
        /// Gets the value whether the shuffle 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 of.</exception>
        /// <since_tizen> 5 </since_tizen>
        public MediaControlCapabilitySupport GetShuffleModeCapability()
        {
            ThrowIfStopped();

            IntPtr playbackCapaHandle = IntPtr.Zero;

            try
            {
                Native.GetPlaybackCapabilityHandle(Manager.Handle, ServerAppId, out playbackCapaHandle).
                ThrowIfError("Failed to get playback capability handle.");

                Native.GetShuffleCapability(Manager.Handle, ServerAppId, out MediaControlCapabilitySupport support);

                return(support);
            }
            finally
            {
                if (playbackCapaHandle != IntPtr.Zero)
                {
                    Native.DestroyCapability(playbackCapaHandle);
                }
            }
        }