Exemple #1
0
        /// <summary>
        /// Returns the metadata set by the server.
        /// </summary>
        /// <returns>The metadata.</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>
        /// <seealso cref="MediaControlServer.SetMetadata(MediaControlMetadata)"/>
        /// <since_tizen> 4 </since_tizen>
        public MediaControlMetadata GetMetadata()
        {
            ThrowIfStopped();

            IntPtr metadataHandle = IntPtr.Zero;

            try
            {
                Native.GetServerMetadata(Manager.Handle, ServerAppId, out metadataHandle).
                ThrowIfError("Failed to get metadata.");

                return(new MediaControlMetadata(metadataHandle));
            }
            finally
            {
                if (metadataHandle != IntPtr.Zero)
                {
                    Native.DestroyMetadata(metadataHandle);
                }
            }
        }