Prefix:4.0.0\r
-Suffix:preview1-00147\r
-Number:147\r
-VCS:731cfff7a13fb161b75178306bd75b0d1ce33524\r
+Suffix:preview1-00151\r
+Number:151\r
+VCS:143ec693bd635309e34d23ec16373b35ee07eb1f\r
<name>Tizen.Multimedia.Remoting</name>\r
</assembly>\r
<members>\r
- <member name="T:Tizen.Multimedia.MediaController.CustomCommandEventArgs">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaController">\r
<summary>\r
- CustomCommandRecieved event arguments\r
+ Provides a means to to send commands to and handle events from media control server.\r
</summary>\r
- <remarks>\r
- CustomCommandRecieved event arguments\r
- </remarks>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandEventArgs.ClientName">\r
- <summary>\r
- Get the Client Name.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandEventArgs.Command">\r
- <summary>\r
- Get the Custom Command.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandEventArgs.BundleData">\r
- <summary>\r
- Get the Bundle Data.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="T:Tizen.Multimedia.MediaController.CustomCommandReplyEventArgs">\r
- <summary>\r
- CustomCommandRecieved event arguments\r
- </summary>\r
- <remarks>\r
- CustomCommandRecieved event arguments\r
- </remarks>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandReplyEventArgs.ServerName">\r
- <summary>\r
- Get the Sserver Name.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandReplyEventArgs.Result">\r
- <summary>\r
- Get the Result.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="P:Tizen.Multimedia.MediaController.CustomCommandReplyEventArgs.BundleData">\r
- <summary>\r
- Get the Bundle Data.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerClient">\r
- <summary>\r
- The MediaControllerClient class provides APIs required for media-controller-client.\r
- </summary>\r
- <privilege>\r
- http://tizen.org/privilege/mediacontroller.client\r
- </privilege>\r
- <remarks>\r
- The MediaControllerClient APIs provides functions to get media information from server.\r
- </remarks>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.#ctor">\r
- <summary>\r
- The constructor of MediaControllerClient class.\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- <exception cref="T:System.UnauthorizedAccessException">Thrown when the access is denied for media controller client</exception>\r
- </member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.ServerUpdated">\r
- <summary>\r
- ServerUpdated event is raised when server is changed\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.PlaybackUpdated">\r
- <summary>\r
- PlaybackUpdated event is raised when playback is changed\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.MetadataUpdated">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaController.ServerAppId">\r
<summary>\r
- MetadataUpdated event is raised when metadata is changed\r
+ Gets the application id of the server.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>The server application id.</value>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.ShuffleModeUpdated">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaController.IsStopped">\r
<summary>\r
- ShuffleModeUpdated event is raised when shuffle mode is changed\r
+ Gets a value indicating whether the sever has been stopped.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>true if the server has been stopped; otherwise, false.</value>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.RepeatModeUpdated">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaController.ServerStopped">\r
<summary>\r
- RepeatModeUpdated event is raised when server is changed\r
+ Occurs when the server is stopped.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerClient.CustomCommandReply">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaController.PlaybackStateUpdated">\r
<summary>\r
- CommandReply event is raised when reply for command is recieved\r
+ Occurs when the playback state is updated.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetLatestServer">\r
- <summary>\r
- gets latest server information </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <returns>The name and state of the latest media controller server application: ServerInformation object</returns>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetPlayback(System.String)">\r
- <summary>\r
- gets playback information for specific server </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="serverName"> Server Name </param>\r
- <returns>The playback state and playback position of the specific media controller server application:MediaControllerPlayback object</returns>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetMetadata(System.String)">\r
- <summary>\r
- gets metadata information for specific server </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="serverName"> Server Name </param>\r
- <returns>The metadata information of the specific media controller server application:MediaControllerMetadata object</returns>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetShuffleMode(System.String)">\r
- <summary>\r
- gets shuffle mode for specific server </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="serverName"> Server Name </param>\r
- <returns>The shuffle mode of the specific media controller server application:MediaControllerShuffleMode enum</returns>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
</member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetRepeatMode(System.String)">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaController.MetadataUpdated">\r
<summary>\r
- gets repeat mode for specific server </summary>\\r
- <since_tizen> 3 </since_tizen>\r
- <param name="serverName"> Server Name </param>\r
- <returns>The repeat mode of the specific media controller server application:MediaControllerRepeatMode enum</returns>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.SendPlaybackStateCommand(System.String,Tizen.Multimedia.MediaController.MediaControllerPlaybackState)">\r
- <summary>\r
- Send command of playback state to server application </summary>\r
- <param name="serverName"> Server Name </param>\r
- <param name="state"> Playback State </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.SendCustomCommand(System.String,System.String,Tizen.Applications.Bundle)">\r
- <summary>\r
- Send customized command to server application </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="serverName"> Server Name </param>\r
- <param name="command"> Command </param>\r
- <param name="bundle"> Bundle data </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.Subscribe(Tizen.Multimedia.MediaController.MediaControllerSubscriptionType,System.String)">\r
- <summary>\r
- Subscribe subscription type from specific server application </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="type"> Subscription Type </param>\r
- <param name="serverName"> Server Name </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.Unsubscribe(Tizen.Multimedia.MediaController.MediaControllerSubscriptionType,System.String)">\r
- <summary>\r
- Subscribe subscription type from specific server application </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="type"> Subscription Type </param>\r
- <param name="serverName"> Server Name </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetActivatedServerList">\r
- <summary>\r
- gets activated server list </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <returns>The list of activated media controller server applications: IEnumerable of string</returns>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerClient.GetSubscribedServerList(Tizen.Multimedia.MediaController.MediaControllerSubscriptionType)">\r
- <summary>\r
- gets subscribed server list </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="subscriptionType"> Subscription Type </param>\r
- <returns>The list of subscribed media controller server applications: IEnumerable of string</returns>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerServerState">\r
- <summary>\r
- Specifies states that a <see cref="T:Tizen.Multimedia.MediaController.ServerInformation"/> can have.\r
- </summary>\r
- </member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerServerState.None">\r
- <summary>\r
- Server state is unknown\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerServerState.Activated">\r
- <summary>\r
- Server is activated\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerServerState.Deactivated">\r
- <summary>\r
- Server is deactivated\r
+ Occurs when the metadata is updated.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerPlaybackState">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaController.ShuffleModeUpdated">\r
<summary>\r
- Enumeration for playback state\r
+ Occurs when the shuffle mode is updated.\r
</summary>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.None">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaController.RepeatModeUpdated">\r
<summary>\r
- Playback state is unknown\r
+ Occurs when the repeat mode is updated.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.Play">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.GetPlaybackState">\r
<summary>\r
- Playback is playing\r
+ Returns the playback state set by the server.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>The playback state.</returns>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.SetPlaybackState(Tizen.Multimedia.Remoting.MediaControlPlaybackState,System.Int64)"/>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.Pause">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.GetPlaybackPosition">\r
<summary>\r
- Playback is paused\r
+ Returns the playback position set by the server.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>The playback position in milliseconds.</returns>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.SetPlaybackState(Tizen.Multimedia.Remoting.MediaControlPlaybackState,System.Int64)"/>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.Next">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.GetMetadata">\r
<summary>\r
- Playback is next\r
+ Returns the metadata set by the server.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>The metadata.</returns>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.SetMetadata(Tizen.Multimedia.Remoting.MediaControlMetadata)"/>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.Prev">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.IsShuffleModeEnabled">\r
<summary>\r
- Playback is prev\r
+ Returns whether the shuffle mode is enabled.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>A value indicating whether the shuffle mode is enabled.</returns>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.SetShuffleModeEnabled(System.Boolean)"/>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.FastForward">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.GetRepeatMode">\r
<summary>\r
- Playback is fastforward\r
+ Returns the repeat mode.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>A <see cref="T:Tizen.Multimedia.Remoting.MediaControlRepeatMode"/> set by the server.</returns>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.SetRepeatMode(Tizen.Multimedia.Remoting.MediaControlRepeatMode)"/>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerPlaybackState.Rewind">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaController.SendPlaybackCommand(Tizen.Multimedia.Remoting.MediaControlPlaybackCommand)">\r
<summary>\r
- Playback is rewind\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
+ Sends playback command to the server.</summary>\r
+ <param name="command">A playback command.</param>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already been stopped.\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.ArgumentException"><paramref name="command"/> is not valid.</exception>\r
+ <exception cref="T:System.ObjectDisposedException">The <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> has already been disposed of.</exception>\r
+ <seealso cref="E:Tizen.Multimedia.Remoting.MediaControlServer.PlaybackCommandReceived"/>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerShuffleMode">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControllerManager">\r
<summary>\r
- Enumeration for shuffle mode\r
+ Provides a means to retrieve active controllers and observe controllers added and removed.\r
</summary>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerShuffleMode.On">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControllerManager.#ctor">\r
<summary>\r
- Shuffle mode is On\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <privilege>http://tizen.org/privilege/mediacontroller.client</privilege>\r
+ <exception cref="T:System.InvalidOperationException">An internal error occurs.</exception>\r
+ <exception cref="T:System.UnauthorizedAccessException">Caller does not have required privilege.</exception>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerShuffleMode.Off">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControllerManager.Dispose">\r
<summary>\r
- Shuffle mode is Off\r
+ Releases all resources used by the <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/>.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerRepeatMode">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControllerManager.Dispose(System.Boolean)">\r
<summary>\r
- Enumeration for repeat mode\r
+ Releases the unmanaged resources used by the <see cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/>.\r
</summary>\r
+ <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerRepeatMode.On">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControllerManager.GetActiveControllers">\r
<summary>\r
- Repeat mode is On\r
+ Gets the active controllers.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <returns>An array of <see cref="T:Tizen.Multimedia.Remoting.MediaController"/>.</returns>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerRepeatMode.Off">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStarted">\r
<summary>\r
- Repeat mode is Off\r
+ Occurs when a server is started.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType">\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStopped">\r
<summary>\r
- Enumeration for repeat mode\r
+ Occurs when a server is stopped.\r
</summary>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType.ServerState">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlMetadata">\r
<summary>\r
- The type of subscription is the state of server\r
+ Represents metadata for media control.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType.Playback">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlMetadata.#ctor">\r
<summary>\r
- The type of subscription is the playback\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.MediaControlMetadata"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType.Metadata">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Title">\r
<summary>\r
- The type of subscription is the metadata\r
+ Gets or sets the title.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType.ShuffleMode">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Artist">\r
<summary>\r
- The type of subscription is the shuffle mode\r
+ Gets or sets the artist.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerSubscriptionType.RepeatMode">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Album">\r
<summary>\r
- The type of subscription is the repeat mode\r
+ Gets or sets the album.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerAttributes">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Author">\r
<summary>\r
- Enumeration for metadata attributes\r
+ Gets or sets the author.\r
</summary>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Title">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Genre">\r
<summary>\r
- Attribute is title\r
+ Gets or sets the genre.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Artist">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Duration">\r
<summary>\r
- Attribute is artist\r
+ Gets or sets the duration.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Album">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Date">\r
<summary>\r
- Attribute is album\r
+ Gets or sets the date.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Author">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Copyright">\r
<summary>\r
- Attribute is author\r
+ Gets or sets the copyright.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Genre">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.Description">\r
<summary>\r
- Attribute is genre\r
+ Gets or sets the description.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Duration">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.TrackNumber">\r
<summary>\r
- Attribute is duration\r
+ Gets or sets the track number.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Date">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlMetadata.AlbumArtPath">\r
<summary>\r
- Attribute is date\r
+ Gets or sets the path of the album art.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Copyright">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand">\r
<summary>\r
- Attribute is copyright\r
+ Specifies playback commands.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Description">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Play">\r
<summary>\r
- Attribute is description\r
+ Play.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.TrackNumber">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Pause">\r
<summary>\r
- Attribute is track number\r
+ Pause.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="F:Tizen.Multimedia.MediaController.MediaControllerAttributes.Picture">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Stop">\r
<summary>\r
- Attribute is picture\r
+ Stop.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerMetadata">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Next">\r
<summary>\r
- Metadata represents a metadata of media for server application to play\r
+ Skip to next.\r
</summary>\r
</member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerMetadata.#ctor">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Previous">\r
<summary>\r
- The constructor of MediaControllerMetadata class.\r
+ Skip to previous.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Title">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.FastForward">\r
<summary>\r
- Set/Get the Title of media\r
+ Fast forward.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Artist">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand.Rewind">\r
<summary>\r
- Set/Get the Artist of media\r
+ Rewind.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Album">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlPlaybackState">\r
<summary>\r
- Set/Get the Album of media\r
+ Specifies playback states.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Author">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.None">\r
<summary>\r
- Set/Get the Author of media\r
+ Unknown; no state is set.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Genre">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.Playing">\r
<summary>\r
- Set/Get the Genre of media\r
+ Playing.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Duration">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.Paused">\r
<summary>\r
- Set/Get the Duration of media\r
+ Paused.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Date">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.Stopped">\r
<summary>\r
- Set/Get the Date of media\r
+ Stopped.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Copyright">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.FastForwarding">\r
<summary>\r
- Set/Get the Copyright of media\r
+ Fast forwarding.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Description">\r
+ <member name="F:Tizen.Multimedia.Remoting.MediaControlPlaybackState.Rewinding">\r
<summary>\r
- Set/Get the Description of media\r
+ Rewinding.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.TrackNumber">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlServer">\r
<summary>\r
- Set/Get the Track Number of media\r
+ Provides a means to set playback information and metadata and receive commands from clients.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <seealso cref="T:Tizen.Multimedia.Remoting.MediaControllerManager"/>\r
+ <seealso cref="T:Tizen.Multimedia.Remoting.MediaController"/>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerMetadata.Picture">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlServer.IsRunning">\r
<summary>\r
- Set/Get the Picture of media\r
+ Gets a value indicating whether the server is running.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>true if the server has started; otherwise, false.</value>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.Start"/>\r
+ <seealso cref="M:Tizen.Multimedia.Remoting.MediaControlServer.Stop"/>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerPlayback">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServer.Start">\r
<summary>\r
- Playback represents a playback state and playback position.\r
+ Starts the media control server.\r
</summary>\r
+ <remarks>\r
+ When the server starts, <see cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStarted"/> will be raised.\r
+ </remarks>\r
+ <privilege>http://tizen.org/privilege/mediacontroller.server</privilege>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server has already started.\n\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <exception cref="T:System.UnauthorizedAccessException">Caller does not have required privilege.</exception>\r
+ <seealso cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStarted"/>\r
</member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerPlayback.#ctor(Tizen.Multimedia.MediaController.MediaControllerPlaybackState,System.UInt64)">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServer.Stop">\r
<summary>\r
- The constructor of MediaControllerPlayback class.\r
+ Stops the media control server.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="state">\r
- The state of the playback which is playing in MediaConttoller server application\r
- </param>\r
- <param name="position">\r
- The position of the playback which is playing in MediaConttoller server application\r
- </param>\r
+ <remarks>\r
+ When the server stops, <see cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStopped"/> will be raised.\r
+ </remarks>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server is not running .\n\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
+ <seealso cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStopped"/>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerPlayback.State">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServer.SetPlaybackState(Tizen.Multimedia.Remoting.MediaControlPlaybackState,System.Int64)">\r
<summary>\r
- Set/Get the State of playback information\r
- </summary>\r
- <since_tizen> 3 </since_tizen>\r
+ Updates playback state and playback position.</summary>\r
+ <param name="state">The playback state.</param>\r
+ <param name="position">The playback position in milliseconds.</param>\r
+ <exception cref="T:System.ArgumentException"><paramref name="state"/> is not valid.</exception>\r
+ <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="position"/> is less than zero.</exception>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server is not running .\n\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MediaControllerPlayback.Position">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServer.SetMetadata(Tizen.Multimedia.Remoting.MediaControlMetadata)">\r
<summary>\r
- Set/Get the Position of playback information\r
+ Updates metadata information.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <param name="metadata">The metadata to update.</param>\r
+ <exception cref="T:System.ArgumentNullException"><paramref name="metadata"/> is null.</exception>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server is not running .\n\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.MediaControllerServer">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServer.SetShuffleModeEnabled(System.Boolean)">\r
<summary>\r
- The MediaControllerServer class provides APIs required for media-controller-server.\r
+ Updates the shuffle mode.\r
</summary>\r
- <privilege>\r
- http://tizen.org/privilege/mediacontroller.server\r
- </privilege>\r
- <remarks>\r
- The MediaControllerServer APIs provides functions to update media information.\r
- </remarks>\r
+ <param name="enabled">A value indicating whether the shuffle mode is enabled.</param>\r
+ <exception cref="T:System.InvalidOperationException">\r
+ The server is not running .\n\r
+ -or-\n\r
+ An internal error occurs.\r
+ </exception>\r
</member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.#ctor">\r
+ <!-- "M:Tizen.Multimedia.Remoting.MediaControlServer.SetRepeatMode(Tizen.Multimedia.Remoting.MediaControlRepeatMode)" 멤버에 대해 잘못된 형식의 XML 주석은 무시됩니다. -->\r
+ <member name="E:Tizen.Multimedia.Remoting.MediaControlServer.PlaybackCommandReceived">\r
<summary>\r
- The constructor of MediaControllerServer class.\r
+ Occurs when a client sends playback command.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- <exception cref="T:System.UnauthorizedAccessException">Thrown when the access is denied for media controller client</exception>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerServer.PlaybackStateCommand">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlServerStartedEventArgs">\r
<summary>\r
- PlaybackStateCommandRecieved event is raised when client send command for playback\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStarted"/> event.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="E:Tizen.Multimedia.MediaController.MediaControllerServer.CustomCommand">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServerStartedEventArgs.#ctor(Tizen.Multimedia.Remoting.MediaController)">\r
<summary>\r
- CustomCommandRecieved event is raised when client send customized command\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.MediaControlServerStartedEventArgs"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.UpdatePlayback(Tizen.Multimedia.MediaController.MediaControllerPlayback)">\r
- <summary>\r
- Update playback state and playback position</summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="playback"> playback state and playback position </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.UpdateMetadata(Tizen.Multimedia.MediaController.MediaControllerMetadata)">\r
- <summary>\r
- Update metadata information </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="metadata"> metadata information </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
+ <param name="mediaController">A <see cref="T:Tizen.Multimedia.Remoting.MediaController"/> of the server.</param>\r
+ <exception cref="T:System.ArgumentNullException"><paramref name="mediaController"/> is null.</exception>\r
</member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.UpdateShuffleMode(Tizen.Multimedia.MediaController.MediaControllerShuffleMode)">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlServerStartedEventArgs.Controller">\r
<summary>\r
- Update shuffle mode </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="mode"> shuffle mode </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.UpdateRepeatMode(Tizen.Multimedia.MediaController.MediaControllerRepeatMode)">\r
- <summary>\r
- Update repeat mode </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="mode"> repeat mode </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="M:Tizen.Multimedia.MediaController.MediaControllerServer.SendCustomCommandReply(System.String,System.Int32,Tizen.Applications.Bundle)">\r
- <summary>\r
- Send reply for command from server to client </summary>\r
- <since_tizen> 3 </since_tizen>\r
- <param name="clientName"> client name to recieve reply </param>\r
- <param name="result"> result to run command </param>\r
- <param name="bundle"> Bundle to send various data </param>\r
- <exception cref="T:System.ArgumentException">Thrown when an invalid argument is used</exception>\r
- <exception cref="T:System.InvalidOperationException">Thrown when the operation is invalid for the current state</exception>\r
- </member>\r
- <member name="T:Tizen.Multimedia.MediaController.MetadataUpdatedEventArgs">\r
- <summary>\r
- MetadataUpdated event arguments\r
+ Gets the controller of the server added.\r
</summary>\r
- <remarks>\r
- MetadataUpdated event arguments\r
- </remarks>\r
+ <value>A <see cref="T:Tizen.Multimedia.Remoting.MediaController"/>.</value>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MetadataUpdatedEventArgs.ServerName">\r
+ <member name="T:Tizen.Multimedia.Remoting.MediaControlServerStoppedEventArgs">\r
<summary>\r
- Get the Server Name.\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaControllerManager.ServerStopped"/> event.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.MetadataUpdatedEventArgs.Metadata">\r
+ <member name="M:Tizen.Multimedia.Remoting.MediaControlServerStoppedEventArgs.#ctor(System.String)">\r
<summary>\r
- Get the Metadata information.\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.MediaControlServerStoppedEventArgs"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <param name="serverAppId">The application id of the server stopped.</param>\r
+ <exception cref="T:System.ArgumentNullException"><paramref name="serverAppId"/> is null.</exception>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.PlaybackStateCommandEventArgs">\r
+ <member name="P:Tizen.Multimedia.Remoting.MediaControlServerStoppedEventArgs.ServerAppId">\r
<summary>\r
- PlaybackStateCommand event arguments\r
+ Gets the application id of the server.\r
</summary>\r
- <remarks>\r
- PlaybackStateCommand event arguments\r
- </remarks>\r
+ <value>A string represents the application id.</value>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.PlaybackStateCommandEventArgs.ClientName">\r
+ <member name="T:Tizen.Multimedia.Remoting.MetadataUpdatedEventArgs">\r
<summary>\r
- Get the Client Name.\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaController.MetadataUpdated"/> event.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.PlaybackStateCommandEventArgs.State">\r
+ <member name="M:Tizen.Multimedia.Remoting.MetadataUpdatedEventArgs.#ctor(Tizen.Multimedia.Remoting.MediaControlMetadata)">\r
<summary>\r
- Get the State of playback.\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.MetadataUpdatedEventArgs"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <param name="metadata">The updated <see cref="T:Tizen.Multimedia.Remoting.MediaControlMetadata"/>.</param>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.PlaybackUpdatedEventArgs">\r
+ <member name="P:Tizen.Multimedia.Remoting.MetadataUpdatedEventArgs.Metadata">\r
<summary>\r
- PlaybackUpdated event arguments\r
+ Gets the metadata.\r
</summary>\r
- <remarks>\r
- PlaybackUpdated event arguments\r
- </remarks>\r
+ <value>The updated <see cref="T:Tizen.Multimedia.Remoting.MediaControlMetadata"/>.</value>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.PlaybackUpdatedEventArgs.ServerName">\r
+ <member name="T:Tizen.Multimedia.Remoting.PlaybackCommandReceivedEventArgs">\r
<summary>\r
- Get the Server Name.\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaControlServer.PlaybackCommandReceived"/> event.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.PlaybackUpdatedEventArgs.PlaybackInfo">\r
+ <member name="M:Tizen.Multimedia.Remoting.PlaybackCommandReceivedEventArgs.#ctor(System.String,Tizen.Multimedia.Remoting.MediaControlPlaybackCommand)">\r
<summary>\r
- Get the Playback Information.\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.PlaybackCommandReceivedEventArgs"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <param name="clientAppId">The client application id.</param>\r
+ <param name="command">The playback command.</param>\r
+ <exception cref="T:System.ArgumentNullException"><paramref name="clientAppId"/> is null.</exception>\r
+ <exception cref="T:System.ArgumentException"><paramref name="command"/> is invalid.</exception>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.RepeatModeUpdatedEventArgs">\r
+ <member name="P:Tizen.Multimedia.Remoting.PlaybackCommandReceivedEventArgs.ClientAppId">\r
<summary>\r
- RepeatModeUpdated event arguments\r
+ Gets the application id of the client that sent command.\r
</summary>\r
- <remarks>\r
- RepeatModeUpdated event arguments\r
- </remarks>\r
+ <value>The client application id.</value>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.RepeatModeUpdatedEventArgs.ServerName">\r
+ <member name="P:Tizen.Multimedia.Remoting.PlaybackCommandReceivedEventArgs.Command">\r
<summary>\r
- Get the Server Name.\r
+ Gets the command.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>The <see cref="T:Tizen.Multimedia.Remoting.MediaControlPlaybackCommand"/>.</value>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.RepeatModeUpdatedEventArgs.RepeatMode">\r
+ <member name="T:Tizen.Multimedia.Remoting.PlaybackStateUpdatedEventArgs">\r
<summary>\r
- Get the Repeat Mode.\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaController.PlaybackStateUpdated"/> event.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.ServerInformation">\r
+ <member name="M:Tizen.Multimedia.Remoting.PlaybackStateUpdatedEventArgs.#ctor(Tizen.Multimedia.Remoting.MediaControlPlaybackState,System.Int64)">\r
<summary>\r
- ServerInformation represents a name and state of server application.\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.PlaybackStateUpdatedEventArgs"/> class.\r
</summary>\r
+ <param name="state">The playback state.</param>\r
+ <param name="position">The playback position in milliseconds.</param>\r
+ <exception cref="T:System.ArgumentException"><paramref name="state"/> is invalid.</exception>\r
+ <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="position"/> is less than zero.</exception>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.ServerInformation.Name">\r
+ <member name="P:Tizen.Multimedia.Remoting.PlaybackStateUpdatedEventArgs.State">\r
<summary>\r
- Get the Name of server\r
+ Gets the playback state.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.ServerInformation.State">\r
+ <member name="P:Tizen.Multimedia.Remoting.PlaybackStateUpdatedEventArgs.Position">\r
<summary>\r
- Get the State of server\r
+ Gets the playback position in milliseconds.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.ServerUpdatedEventArgs">\r
+ <member name="T:Tizen.Multimedia.Remoting.RepeatModeUpdatedEventArgs">\r
<summary>\r
- ServerUpdated event arguments\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaController.RepeatModeUpdated"/> event.\r
</summary>\r
- <remarks>\r
- ServerUpdated event arguments\r
- </remarks>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.ServerUpdatedEventArgs.ServerInfo">\r
+ <!-- "M:Tizen.Multimedia.Remoting.RepeatModeUpdatedEventArgs.#ctor(Tizen.Multimedia.Remoting.MediaControlRepeatMode)" 멤버에 대해 잘못된 형식의 XML 주석은 무시됩니다. -->\r
+ <member name="P:Tizen.Multimedia.Remoting.RepeatModeUpdatedEventArgs.RepeatMode">\r
<summary>\r
- Get the Server Information.\r
+ Gets the updated repeat mode.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>The <see cref="T:Tizen.Multimedia.Remoting.MediaControlRepeatMode"/>.</value>\r
</member>\r
- <member name="T:Tizen.Multimedia.MediaController.ShuffleModeUpdatedEventArgs">\r
+ <member name="T:Tizen.Multimedia.Remoting.ShuffleModeUpdatedEventArgs">\r
<summary>\r
- ShuffleModeUpdated event arguments\r
+ Provides data for the <see cref="E:Tizen.Multimedia.Remoting.MediaController.ShuffleModeUpdated"/> event.\r
</summary>\r
- <remarks>\r
- ShuffleModeUpdated event arguments\r
- </remarks>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.ShuffleModeUpdatedEventArgs.ServerName">\r
+ <member name="M:Tizen.Multimedia.Remoting.ShuffleModeUpdatedEventArgs.#ctor(System.Boolean)">\r
<summary>\r
- Get the Server Name.\r
+ Initializes a new instance of the <see cref="T:Tizen.Multimedia.Remoting.ShuffleModeUpdatedEventArgs"/> class.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <param name="enabled">A value indicating whether the shuffle mode is enabled.</param>\r
</member>\r
- <member name="P:Tizen.Multimedia.MediaController.ShuffleModeUpdatedEventArgs.ShuffleMode">\r
+ <member name="P:Tizen.Multimedia.Remoting.ShuffleModeUpdatedEventArgs.Enabled">\r
<summary>\r
- Get the Shuffle Mode.\r
+ Gets a value indicating whether the shuffle mode is enabled.\r
</summary>\r
- <since_tizen> 3 </since_tizen>\r
+ <value>true if the shuffle mode is enabled; otherwise, false.</value>\r
</member>\r
<member name="T:Tizen.Multimedia.Remoting.ScreenMirroringStateChangedEventArgs">\r
<summary>\r
Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
-Version: 4.0.0.147
+Version: 4.0.0.151
Release: 1
Group: Development/Libraries
License: Apache-2.0
Tizen.Account.SyncManager.dll #mobile #mobile-emul #wearable
Tizen.Applications.Alarm.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.AttachPanel.dll #mobile #mobile-emul
-Tizen.Applications.Badge.dll #mobile #mobile-emul #ivi
+Tizen.Applications.Badge.dll #mobile #mobile-emul #ivi #wearable
Tizen.Applications.Common.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.DataControl.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.MessagePort.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.NotificationEventListener.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.PackageManager.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.Preference.dll #common #mobile #mobile-emul #tv #ivi #wearable
-Tizen.Applications.RemoteView.dll #mobile #mobile-emul #tv
+Tizen.Applications.RemoteView.dll #mobile #mobile-emul #tv #wearable
Tizen.Applications.Service.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.ToastMessage.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.UI.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Applications.WatchApplication.dll #wearable
-Tizen.Applications.WidgetApplication.dll #mobile #mobile-emul #tv #ivi
-Tizen.Applications.WidgetControl.dll #mobile #mobile-emul #tv #ivi
+Tizen.Applications.WidgetApplication.dll #mobile #mobile-emul #tv #ivi #wearable
+Tizen.Applications.WidgetControl.dll #mobile #mobile-emul #tv #ivi #wearable
Tizen.Content.Download.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Content.MediaContent.dll #common #mobile #mobile-emul #tv #ivi #wearable
Tizen.Content.MimeType.dll #common #mobile #mobile-emul #tv #ivi #wearable
+++ /dev/null
-/*
- * 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;
-using Tizen.Applications;
-using Tizen.Multimedia;
-using Tizen.Multimedia.MediaController;
-
-internal static partial class Interop
-{
- internal static partial class MediaControllerClient
- {
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void ServerUpdatedCallback(IntPtr serverName, MediaControllerServerState serverState, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void PlaybackUpdatedCallback(IntPtr serverName, IntPtr playback, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void MetadataUpdatedCallback(IntPtr serverName, IntPtr metadata, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void ShuffleModeUpdatedCallback(IntPtr serverName, MediaControllerShuffleMode shuffleMode, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void RepeatModeUpdatedCallback(IntPtr serverName, MediaControllerRepeatMode repeatMode, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void CommandReplyRecievedCallback(IntPtr serverName, int result, IntPtr bundle, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate bool SubscribedServerCallback(IntPtr serverName, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate bool ActivatedServerCallback(IntPtr serverName, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_create")]
- internal static extern MediaControllerError Create(out IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy")]
- internal static extern MediaControllerError Destroy(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_server_update_cb")]
- internal static extern MediaControllerError SetServerUpdatedCb(IntPtr handle, ServerUpdatedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_server_update_cb")]
- internal static extern MediaControllerError UnsetServerUpdatedCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_playback_update_cb")]
- internal static extern MediaControllerError SetPlaybackUpdatedCb(IntPtr handle, PlaybackUpdatedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_playback_update_cb")]
- internal static extern MediaControllerError UnsetPlaybackUpdatedCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_metadata_update_cb")]
- internal static extern MediaControllerError SetMetadataUpdatedCb(IntPtr handle, MetadataUpdatedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_metadata_update_cb")]
- internal static extern MediaControllerError UnsetMetadataUpdatedCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_shuffle_mode_update_cb")]
- internal static extern MediaControllerError SetShuffleModeUpdatedCb(IntPtr handle, ShuffleModeUpdatedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_shuffle_mode_update_cb")]
- internal static extern MediaControllerError UnsetShuffleModeUpdatedCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_repeat_mode_update_cb")]
- internal static extern MediaControllerError SetRepeatModeUpdatedCb(IntPtr handle, RepeatModeUpdatedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_repeat_mode_update_cb")]
- internal static extern MediaControllerError UnsetRepeatModeUpdatedCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_subscribe")]
- internal static extern MediaControllerError Subscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unsubscribe")]
- internal static extern MediaControllerError Unsubscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_state")]
- internal static extern MediaControllerError GetPlaybackState(IntPtr playback, out MediaControllerPlaybackState state);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_position")]
- internal static extern MediaControllerError GetPlaybackPosition(IntPtr playback, out ulong position);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_playback")]
- internal static extern MediaControllerError DestroyPlayback(IntPtr playback);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_metadata")]
- private static extern MediaControllerError GetMetadata(IntPtr metadata, MediaControllerAttributes attribute, out IntPtr value);
-
- internal static string GetMetadata(IntPtr handle, MediaControllerAttributes attr)
- {
- IntPtr valuePtr = IntPtr.Zero;
-
- try
- {
- var ret = GetMetadata(handle, attr, out valuePtr);
- MediaControllerValidator.ThrowIfError(ret, "Failed to get value for " + attr);
- return Marshal.PtrToStringAnsi(valuePtr);
- }
- finally
- {
- LibcSupport.Free(valuePtr);
- }
- }
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_metadata")]
- internal static extern MediaControllerError DestroyMetadata(IntPtr metadata);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_latest_server_info")]
- internal static extern MediaControllerError GetLatestServer(IntPtr handle, out IntPtr serverName, out MediaControllerServerState serverState);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_playback_info")]
- internal static extern MediaControllerError GetServerPlayback(IntPtr handle, string serverName, out IntPtr playback);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_metadata")]
- internal static extern MediaControllerError GetServerMetadata(IntPtr handle, string serverName, out IntPtr metadata);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_shuffle_mode")]
- internal static extern MediaControllerError GetServerShuffleMode(IntPtr handle, string serverName, out MediaControllerShuffleMode mode);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_repeat_mode")]
- internal static extern MediaControllerError GetServerRepeatMode(IntPtr handle, string serverName, out MediaControllerRepeatMode mode);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_playback_state_command")]
- internal static extern MediaControllerError SendPlaybackStateCommand(IntPtr handle, string serverName, MediaControllerPlaybackState state);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_custom_command")]
- internal static extern MediaControllerError SendCustomCommand(IntPtr handle, string serverName, string command, SafeBundleHandle bundle, CommandReplyRecievedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server_subscribed")]
- internal static extern MediaControllerError ForeachSubscribedServer(IntPtr handle, MediaControllerSubscriptionType subscriptionType, SubscribedServerCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server")]
- internal static extern MediaControllerError ForeachActivatedServer(IntPtr handle, ActivatedServerCallback callback, IntPtr userData);
- }
-
- internal static partial class MediaControllerServer
- {
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void PlaybackStateCommandRecievedCallback(IntPtr clientName, MediaControllerPlaybackState state, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void CustomCommandRecievedCallback(IntPtr clientName, IntPtr command, IntPtr bundle, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")]
- internal static extern MediaControllerError Create(out IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")]
- internal static extern MediaControllerError Destroy(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")]
- internal static extern MediaControllerError SetPlaybackState(IntPtr handle, MediaControllerPlaybackState state);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")]
- internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")]
- internal static extern MediaControllerError UpdatePlayback(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")]
- internal static extern MediaControllerError SetMetadata(IntPtr handle, MediaControllerAttributes attribute, string value);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")]
- internal static extern MediaControllerError UpdateMetadata(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")]
- internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle, MediaControllerShuffleMode mode);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")]
- internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, MediaControllerRepeatMode mode);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")]
- internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle, PlaybackStateCommandRecievedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")]
- internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_custom_command_received_cb")]
- internal static extern MediaControllerError SetCustomCmdRecvCb(IntPtr handle, CustomCommandRecievedCallback callback, IntPtr userData);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_custom_command_received_cb")]
- internal static extern MediaControllerError UnsetCustomCmdRecvCb(IntPtr handle);
-
- [DllImport(Libraries.MediaController, EntryPoint = "mc_server_send_command_reply")]
- internal static extern MediaControllerError SendCommandReply(IntPtr handle, string clientName, int result, SafeBundleHandle bundle);
- }
-}
--- /dev/null
+/*
+ * 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;
+using Tizen.Multimedia.Remoting;
+
+internal static partial class Interop
+{
+ internal static partial class MediaControllerClient
+ {
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void ServerUpdatedCallback(string serverName, MediaControllerServerState serverState,
+ IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void PlaybackUpdatedCallback(string serverName, IntPtr playback, IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void MetadataUpdatedCallback(string serverName, IntPtr metadata, IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void ShuffleModeUpdatedCallback(string serverName, MediaControllerShuffleMode shuffleMode,
+ IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void RepeatModeUpdatedCallback(string serverName, NativeRepeatMode repeatMode, IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate bool ActivatedServerCallback(string serverName, IntPtr userData);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_create")]
+ internal static extern MediaControllerError Create(out MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy")]
+ internal static extern MediaControllerError Destroy(IntPtr handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_server_update_cb")]
+ internal static extern MediaControllerError SetServerUpdatedCb(MediaControllerClientHandle handle,
+ ServerUpdatedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_server_update_cb")]
+ internal static extern MediaControllerError UnsetServerUpdatedCb(MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_playback_update_cb")]
+ internal static extern MediaControllerError SetPlaybackUpdatedCb(MediaControllerClientHandle handle,
+ PlaybackUpdatedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_playback_update_cb")]
+ internal static extern MediaControllerError UnsetPlaybackUpdatedCb(MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_metadata_update_cb")]
+ internal static extern MediaControllerError SetMetadataUpdatedCb(MediaControllerClientHandle handle,
+ MetadataUpdatedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_metadata_update_cb")]
+ internal static extern MediaControllerError UnsetMetadataUpdatedCb(MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_shuffle_mode_update_cb")]
+ internal static extern MediaControllerError SetShuffleModeUpdatedCb(MediaControllerClientHandle handle,
+ ShuffleModeUpdatedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_shuffle_mode_update_cb")]
+ internal static extern MediaControllerError UnsetShuffleModeUpdatedCb(MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_repeat_mode_update_cb")]
+ internal static extern MediaControllerError SetRepeatModeUpdatedCb(MediaControllerClientHandle handle,
+ RepeatModeUpdatedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_repeat_mode_update_cb")]
+ internal static extern MediaControllerError UnsetRepeatModeUpdatedCb(MediaControllerClientHandle handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_state")]
+ internal static extern MediaControllerError GetPlaybackState(IntPtr playback, out MediaControllerPlaybackCode state);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_position")]
+ internal static extern MediaControllerError GetPlaybackPosition(IntPtr playback, out ulong position);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_playback")]
+ internal static extern MediaControllerError DestroyPlayback(IntPtr playback);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_metadata")]
+ private static extern MediaControllerError GetMetadata(IntPtr metadata, MediaControllerAttribute attribute,
+ out IntPtr value);
+
+ internal static string GetMetadata(IntPtr handle, MediaControllerAttribute attr)
+ {
+ IntPtr valuePtr = IntPtr.Zero;
+
+ try
+ {
+ GetMetadata(handle, attr, out valuePtr).ThrowIfError($"Failed to get value for {attr}.");
+ return Marshal.PtrToStringAnsi(valuePtr);
+ }
+ finally
+ {
+ Tizen.Multimedia.LibcSupport.Free(valuePtr);
+ }
+ }
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_metadata")]
+ internal static extern MediaControllerError DestroyMetadata(IntPtr metadata);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_latest_server_info")]
+ internal static extern MediaControllerError GetLatestServer(MediaControllerClientHandle handle,
+ out IntPtr serverName, out MediaControllerServerState serverState);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_playback_info")]
+ internal static extern MediaControllerError GetServerPlayback(MediaControllerClientHandle handle,
+ string serverName, out IntPtr playback);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_metadata")]
+ internal static extern MediaControllerError GetServerMetadata(MediaControllerClientHandle handle,
+ string serverName, out IntPtr metadata);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_shuffle_mode")]
+ internal static extern MediaControllerError GetServerShuffleMode(MediaControllerClientHandle handle,
+ string serverName, out MediaControllerShuffleMode mode);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_repeat_mode")]
+ internal static extern MediaControllerError GetServerRepeatMode(MediaControllerClientHandle handle,
+ string serverName, out NativeRepeatMode mode);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_playback_state_command")]
+ internal static extern MediaControllerError SendPlaybackStateCommand(MediaControllerClientHandle handle,
+ string serverName, MediaControllerPlaybackCode command);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server")]
+ internal static extern MediaControllerError ForeachActivatedServer(MediaControllerClientHandle handle,
+ ActivatedServerCallback callback, IntPtr userData);
+ }
+
+ internal class MediaControllerClientHandle : SafeHandle
+ {
+ protected MediaControllerClientHandle() : base(IntPtr.Zero, true)
+ {
+ }
+
+ public override bool IsInvalid => handle == IntPtr.Zero;
+
+ protected override bool ReleaseHandle()
+ {
+ var ret = MediaControllerClient.Destroy(handle);
+ if (ret != MediaControllerError.None)
+ {
+ Tizen.Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}");
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
--- /dev/null
+/*
+ * 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;
+using Tizen.Multimedia.Remoting;
+
+internal static partial class Interop
+{
+ internal static partial class MediaControllerServer
+ {
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void PlaybackStateCommandReceivedCallback(string clientName,
+ MediaControllerPlaybackCode state, IntPtr userData);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")]
+ internal static extern MediaControllerError Create(out IntPtr handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")]
+ internal static extern MediaControllerError Destroy(IntPtr handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")]
+ internal static extern MediaControllerError SetPlaybackState(IntPtr handle,
+ MediaControllerPlaybackCode state);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")]
+ internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")]
+ internal static extern MediaControllerError UpdatePlayback(IntPtr handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")]
+ internal static extern MediaControllerError SetMetadata(IntPtr handle,
+ MediaControllerAttribute attribute, string value);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")]
+ internal static extern MediaControllerError UpdateMetadata(IntPtr handle);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")]
+ internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle,
+ MediaControllerShuffleMode mode);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")]
+ internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, NativeRepeatMode mode);
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")]
+ internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle,
+ PlaybackStateCommandReceivedCallback callback, IntPtr userData = default(IntPtr));
+
+ [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")]
+ internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle);
+ }
+}
+++ /dev/null
-/*
-* 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 Tizen.Applications;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// CustomCommandRecieved event arguments
- /// </summary>
- /// <remarks>
- /// CustomCommandRecieved event arguments
- /// </remarks>
- public class CustomCommandEventArgs : EventArgs
- {
- internal CustomCommandEventArgs(string name, string command, Bundle bundle)
- {
- ClientName = name;
- Command = command;
- BundleData = bundle;
- }
-
- /// <summary>
- /// Get the Client Name.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ClientName { get; }
-
- /// <summary>
- /// Get the Custom Command.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Command { get; }
-
- /// <summary>
- /// Get the Bundle Data.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Bundle BundleData { get; }
- }
-}
-
+++ /dev/null
-/*
-* 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 Tizen.Applications;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// CustomCommandRecieved event arguments
- /// </summary>
- /// <remarks>
- /// CustomCommandRecieved event arguments
- /// </remarks>
- public class CustomCommandReplyEventArgs : EventArgs
- {
- internal CustomCommandReplyEventArgs(string serverName, int result, Bundle bundle)
- {
- ServerName = serverName;
- Result = result;
- BundleData = bundle;
- }
-
- /// <summary>
- /// Get the Sserver Name.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ServerName { get; }
-
- /// <summary>
- /// Get the Result.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public int Result { get; }
-
- /// <summary>
- /// Get the Bundle Data.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Bundle BundleData { get; }
- }
-}
-
--- /dev/null
+/*
+ * 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.Diagnostics;
+
+namespace Tizen.Multimedia.Remoting
+{
+ internal static class EnumExtensions
+ {
+ internal static MediaControlPlaybackState ToState(this MediaControllerPlaybackCode code)
+ {
+ switch (code)
+ {
+ case MediaControllerPlaybackCode.None: return MediaControlPlaybackState.None;
+ case MediaControllerPlaybackCode.Play: return MediaControlPlaybackState.Playing;
+ case MediaControllerPlaybackCode.Pause: return MediaControlPlaybackState.Paused;
+ case MediaControllerPlaybackCode.Stop: return MediaControlPlaybackState.Stopped;
+ case MediaControllerPlaybackCode.FastForward: return MediaControlPlaybackState.FastForwarding;
+ case MediaControllerPlaybackCode.Rewind: return MediaControlPlaybackState.Rewinding;
+ }
+
+ Debug.Fail($"Not supported code for playback state{code}.");
+ return MediaControlPlaybackState.None;
+ }
+
+ internal static MediaControllerPlaybackCode ToCode(this MediaControlPlaybackState state)
+ {
+ switch (state)
+ {
+ case MediaControlPlaybackState.Playing: return MediaControllerPlaybackCode.Play;
+ case MediaControlPlaybackState.Paused: return MediaControllerPlaybackCode.Pause;
+ case MediaControlPlaybackState.Stopped: return MediaControllerPlaybackCode.Stop;
+ case MediaControlPlaybackState.FastForwarding: return MediaControllerPlaybackCode.FastForward;
+ case MediaControlPlaybackState.Rewinding: return MediaControllerPlaybackCode.Rewind;
+ }
+ return MediaControllerPlaybackCode.None;
+ }
+
+ internal static MediaControlPlaybackCommand ToCommand(this MediaControllerPlaybackCode code)
+ {
+ switch (code)
+ {
+ case MediaControllerPlaybackCode.Play: return MediaControlPlaybackCommand.Play;
+ case MediaControllerPlaybackCode.Pause: return MediaControlPlaybackCommand.Pause;
+ case MediaControllerPlaybackCode.Stop: return MediaControlPlaybackCommand.Stop;
+ case MediaControllerPlaybackCode.Next: return MediaControlPlaybackCommand.Next;
+ case MediaControllerPlaybackCode.Prev: return MediaControlPlaybackCommand.Previous;
+ case MediaControllerPlaybackCode.FastForward: return MediaControlPlaybackCommand.FastForward;
+ case MediaControllerPlaybackCode.Rewind: return MediaControlPlaybackCommand.Rewind;
+ }
+
+ Debug.Fail($"Not supported code for playback command{code}.");
+ return MediaControlPlaybackCommand.Play;
+ }
+
+ internal static MediaControllerPlaybackCode ToCode(this MediaControlPlaybackCommand command)
+ {
+ switch (command)
+ {
+ case MediaControlPlaybackCommand.Play: return MediaControllerPlaybackCode.Play;
+ case MediaControlPlaybackCommand.Pause: return MediaControllerPlaybackCode.Pause;
+ case MediaControlPlaybackCommand.Stop: return MediaControllerPlaybackCode.Stop;
+ case MediaControlPlaybackCommand.Next: return MediaControllerPlaybackCode.Next;
+ case MediaControlPlaybackCommand.Previous: return MediaControllerPlaybackCode.Prev;
+ case MediaControlPlaybackCommand.FastForward: return MediaControllerPlaybackCode.FastForward;
+ case MediaControlPlaybackCommand.Rewind: return MediaControllerPlaybackCode.Rewind;
+ }
+ return MediaControllerPlaybackCode.Play;
+ }
+
+ internal static NativeRepeatMode ToNative(this MediaControlRepeatMode mode)
+ {
+ Debug.Assert(Enum.IsDefined(typeof(MediaControlRepeatMode), mode));
+
+ return mode == MediaControlRepeatMode.Off ? NativeRepeatMode.On : NativeRepeatMode.Off;
+ }
+
+ internal static MediaControlRepeatMode ToPublic(this NativeRepeatMode mode)
+ {
+ Debug.Assert(Enum.IsDefined(typeof(NativeRepeatMode), mode));
+
+ return mode == NativeRepeatMode.Off ? MediaControlRepeatMode.On : MediaControlRepeatMode.Off;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Diagnostics;
+
+namespace Tizen.Multimedia.Remoting
+{
+ internal enum MediaControllerPlaybackCode
+ {
+ None,
+ Play,
+ Pause,
+ Stop,
+ Next,
+ Prev,
+ FastForward,
+ Rewind,
+ }
+
+ internal enum MediaControllerServerState
+ {
+ None,
+ Activated,
+ Deactivated,
+ }
+
+ internal enum MediaControllerShuffleMode
+ {
+ On,
+ Off,
+ }
+
+ internal enum NativeRepeatMode
+ {
+ On,
+ Off,
+ }
+
+ internal enum MediaControllerAttribute
+ {
+ Title,
+ Artist,
+ Album,
+ Author,
+ Genre,
+ Duration,
+ Date,
+ Copyright,
+ Description,
+ TrackNumber,
+ Picture,
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Diagnostics;
+using Native = Interop.MediaControllerClient;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Represents metadata for media control.
+ /// </summary>
+ public class MediaControlMetadata
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MediaControlMetadata"/> class.
+ /// </summary>
+ public MediaControlMetadata()
+ {
+ }
+
+ internal MediaControlMetadata(IntPtr handle)
+ {
+ Debug.Assert(handle != IntPtr.Zero);
+
+ Title = Native.GetMetadata(handle, MediaControllerAttribute.Title);
+ Artist = Native.GetMetadata(handle, MediaControllerAttribute.Artist);
+ Album = Native.GetMetadata(handle, MediaControllerAttribute.Album);
+ Author = Native.GetMetadata(handle, MediaControllerAttribute.Author);
+ Genre = Native.GetMetadata(handle, MediaControllerAttribute.Genre);
+ Duration = Native.GetMetadata(handle, MediaControllerAttribute.Duration);
+ Date = Native.GetMetadata(handle, MediaControllerAttribute.Date);
+ Copyright = Native.GetMetadata(handle, MediaControllerAttribute.Copyright);
+ Description = Native.GetMetadata(handle, MediaControllerAttribute.Description);
+ TrackNumber = Native.GetMetadata(handle, MediaControllerAttribute.TrackNumber);
+ AlbumArtPath = Native.GetMetadata(handle, MediaControllerAttribute.Picture);
+ }
+
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ public string Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the artist.
+ /// </summary>
+ public string Artist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the album.
+ /// </summary>
+ public string Album { get; set; }
+
+ /// <summary>
+ /// Gets or sets the author.
+ /// </summary>
+ public string Author { get; set; }
+
+ /// <summary>
+ /// Gets or sets the genre.
+ /// </summary>
+ public string Genre { get; set; }
+
+ /// <summary>
+ /// Gets or sets the duration.
+ /// </summary>
+ public string Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date.
+ /// </summary>
+ public string Date { get; set; }
+
+ /// <summary>
+ /// Gets or sets the copyright.
+ /// </summary>
+ public string Copyright { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the track number.
+ /// </summary>
+ public string TrackNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the path of the album art.
+ /// </summary>
+ public string AlbumArtPath { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Remoting
+{
+ /// <summary>
+ /// Specifies playback commands.
+ /// </summary>
+ public enum MediaControlPlaybackCommand
+ {
+ /// <summary>
+ /// Play.
+ /// </summary>
+ Play,
+
+ /// <summary>
+ /// Pause.
+ /// </summary>
+ Pause,
+
+ /// <summary>
+ /// Stop.
+ /// </summary>
+ Stop,
+
+ /// <summary>
+ /// Skip to next.
+ /// </summary>
+ Next,
+
+ /// <summary>
+ /// Skip to previous.
+ /// </summary>
+ Previous,
+
+ /// <summary>
+ /// Fast forward.
+ /// </summary>
+ FastForward,
+
+ /// <summary>
+ /// Rewind.
+ /// </summary>
+ Rewind,
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Remoting
+{
+ /// <summary>
+ /// Specifies playback states.
+ /// </summary>
+ public enum MediaControlPlaybackState
+ {
+ /// <summary>
+ /// Unknown; no state is set.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Playing.
+ /// </summary>
+ Playing,
+
+ /// <summary>
+ /// Paused.
+ /// </summary>
+ Paused,
+
+ /// <summary>
+ /// Stopped.
+ /// </summary>
+ Stopped,
+
+ /// <summary>
+ /// Fast forwarding.
+ /// </summary>
+ FastForwarding,
+
+ /// <summary>
+ /// Rewinding.
+ /// </summary>
+ Rewinding,
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 Native = Interop.MediaControllerServer;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides a means to set playback information and metadata and receive commands from clients.
+ /// </summary>
+ /// <seealso cref="MediaControllerManager"/>
+ /// <seealso cref="MediaController"/>
+ public static class MediaControlServer
+ {
+ private static IntPtr _handle = IntPtr.Zero;
+
+ /// <summary>
+ /// Gets a value indicating whether the server is running.
+ /// </summary>
+ /// <value>true if the server has started; otherwise, false.</value>
+ /// <seealso cref="Start"/>
+ /// <seealso cref="Stop"/>
+ public static bool IsRunning
+ {
+ get => _handle != IntPtr.Zero;
+ }
+
+ private static void ThrowIfNotRunning()
+ {
+ if (IsRunning == false)
+ {
+ throw new InvalidOperationException("The server is not running.");
+ }
+ }
+
+ private static IntPtr Handle
+ {
+ get
+ {
+ ThrowIfNotRunning();
+
+ return _handle;
+ }
+ }
+
+ /// <summary>
+ /// Starts the media control server.
+ /// </summary>
+ /// <remarks>
+ /// When the server starts, <see cref="MediaControllerManager.ServerStarted"/> will be raised.
+ /// </remarks>
+ /// <privilege>http://tizen.org/privilege/mediacontroller.server</privilege>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already started.\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="UnauthorizedAccessException">Caller does not have required privilege.</exception>
+ /// <seealso cref="MediaControllerManager.ServerStarted"/>
+ public static void Start()
+ {
+ if (IsRunning)
+ {
+ throw new InvalidOperationException("The server is already running.");
+ }
+
+ Native.Create(out _handle).ThrowIfError("Failed to create media controller server.");
+
+ try
+ {
+ RegisterPlaybackCommandReceivedEvent();
+ }
+ catch
+ {
+ Native.Destroy(_handle);
+ _playbackCommandCallback = null;
+ _handle = IntPtr.Zero;
+ throw;
+ }
+ }
+
+ /// <summary>
+ /// Stops the media control server.
+ /// </summary>
+ /// <remarks>
+ /// When the server stops, <see cref="MediaControllerManager.ServerStopped"/> will be raised.
+ /// </remarks>
+ /// <exception cref="InvalidOperationException">
+ /// The server is not running .\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <seealso cref="MediaControllerManager.ServerStopped"/>
+ public static void Stop()
+ {
+ ThrowIfNotRunning();
+
+ Native.Destroy(_handle).ThrowIfError("Failed to stop the server.");
+
+ _handle = IntPtr.Zero;
+ _playbackCommandCallback = null;
+ }
+
+ /// <summary>
+ /// Updates playback state and playback position.</summary>
+ /// <param name="state">The playback state.</param>
+ /// <param name="position">The playback position in milliseconds.</param>
+ /// <exception cref="ArgumentException"><paramref name="state"/> is not valid.</exception>
+ /// <exception cref="ArgumentOutOfRangeException"><paramref name="position"/> is less than zero.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The server is not running .\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ public static void SetPlaybackState(MediaControlPlaybackState state, long position)
+ {
+ ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackState), state, nameof(state));
+
+ if (position < 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(position), position, "position can't be less than zero.");
+ }
+
+ Native.SetPlaybackState(Handle, state.ToCode()).ThrowIfError("Failed to set playback state.");
+
+ Native.SetPlaybackPosition(Handle, (ulong)position).ThrowIfError("Failed to set playback position.");
+
+ Native.UpdatePlayback(Handle).ThrowIfError("Failed to set playback.");
+ }
+
+ private static void SetMetadata(MediaControllerAttribute attribute, string value)
+ {
+ Native.SetMetadata(Handle, attribute, value).ThrowIfError($"Failed to set metadata({attribute}).");
+ }
+
+ /// <summary>
+ /// Updates metadata information.
+ /// </summary>
+ /// <param name="metadata">The metadata to update.</param>
+ /// <exception cref="ArgumentNullException"><paramref name="metadata"/> is null.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The server is not running .\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ public static void SetMetadata(MediaControlMetadata metadata)
+ {
+ if (metadata == null)
+ {
+ throw new ArgumentNullException(nameof(metadata));
+ }
+
+ SetMetadata(MediaControllerAttribute.Title, metadata.Title);
+ SetMetadata(MediaControllerAttribute.Artist, metadata.Artist);
+ SetMetadata(MediaControllerAttribute.Album, metadata.Album);
+ SetMetadata(MediaControllerAttribute.Author, metadata.Author);
+ SetMetadata(MediaControllerAttribute.Genre, metadata.Genre);
+ SetMetadata(MediaControllerAttribute.Duration, metadata.Duration);
+ SetMetadata(MediaControllerAttribute.Date, metadata.Date);
+ SetMetadata(MediaControllerAttribute.Copyright, metadata.Copyright);
+ SetMetadata(MediaControllerAttribute.Description, metadata.Description);
+ SetMetadata(MediaControllerAttribute.TrackNumber, metadata.TrackNumber);
+ SetMetadata(MediaControllerAttribute.Picture, metadata.AlbumArtPath);
+
+ Native.UpdateMetadata(Handle).ThrowIfError("Failed to set metadata.");
+ }
+
+ /// <summary>
+ /// Updates the shuffle mode.
+ /// </summary>
+ /// <param name="enabled">A value indicating whether the shuffle mode is enabled.</param>
+ /// <exception cref="InvalidOperationException">
+ /// The server is not running .\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ public static void SetShuffleModeEnabled(bool enabled)
+ {
+ Native.UpdateShuffleMode(Handle, enabled ? MediaControllerShuffleMode.On : MediaControllerShuffleMode.Off).
+ ThrowIfError("Failed to set shuffle mode.");
+ }
+
+ /// <summary>
+ /// Updates the repeat mode.
+ /// </summary>
+ /// <param name="mode">A value indicating the repeat mode.</param>
+ /// <exception cref="InvalidOperationException">
+ /// The server is not running .\n
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ArgumentException"/><paramref name="mode"/> is invalid.</exception>
+ public static void SetRepeatMode(MediaControlRepeatMode mode)
+ {
+ ValidationUtil.ValidateEnum(typeof(MediaControlRepeatMode), mode, nameof(mode));
+
+ Native.UpdateRepeatMode(Handle, mode.ToNative()).ThrowIfError("Failed to set repeat mode.");
+ }
+
+ /// <summary>
+ /// Occurs when a client sends playback command.
+ /// </summary>
+ public static event EventHandler<PlaybackCommandReceivedEventArgs> PlaybackCommandReceived;
+
+ private static Native.PlaybackStateCommandReceivedCallback _playbackCommandCallback;
+
+ private static void RegisterPlaybackCommandReceivedEvent()
+ {
+ _playbackCommandCallback = (clientName, playbackCode, _) =>
+ {
+ PlaybackCommandReceived?.Invoke(null, new PlaybackCommandReceivedEventArgs(clientName, playbackCode.ToCommand()));
+ };
+ Native.SetPlaybackStateCmdRecvCb(Handle, _playbackCommandCallback).
+ ThrowIfError("Failed to init PlaybackStateCommandReceived event."); ;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides data for the <see cref="MediaControllerManager.ServerStarted"/> event.
+ /// </summary>
+ public class MediaControlServerStartedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MediaControlServerStartedEventArgs"/> class.
+ /// </summary>
+ /// <param name="mediaController">A <see cref="MediaController"/> of the server.</param>
+ /// <exception cref="ArgumentNullException"><paramref name="mediaController"/> is null.</exception>
+ public MediaControlServerStartedEventArgs(MediaController mediaController)
+ {
+ if (mediaController == null)
+ {
+ throw new ArgumentNullException(nameof(mediaController));
+ }
+
+ Controller = mediaController;
+ }
+
+ /// <summary>
+ /// Gets the controller of the server added.
+ /// </summary>
+ /// <value>A <see cref="MediaController"/>.</value>
+ public MediaController Controller { get; }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides data for the <see cref="MediaControllerManager.ServerStopped"/> event.
+ /// </summary>
+ public class MediaControlServerStoppedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MediaControlServerStoppedEventArgs"/> class.
+ /// </summary>
+ /// <param name="serverAppId">The application id of the server stopped.</param>
+ /// <exception cref="ArgumentNullException"><paramref name="serverAppId"/> is null.</exception>
+ public MediaControlServerStoppedEventArgs(string serverAppId)
+ {
+ if (serverAppId == null)
+ {
+ throw new ArgumentNullException(nameof(serverAppId));
+ }
+
+ ServerAppId = serverAppId;
+ }
+
+ /// <summary>
+ /// Gets the application id of the server.
+ /// </summary>
+ /// <value>A string represents the application id.</value>
+ public string ServerAppId { get; }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Diagnostics;
+using Native = Interop.MediaControllerClient;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides a means to to send commands to and handle events from media control server.
+ /// </summary>
+ public class MediaController
+ {
+ internal MediaController(MediaControllerManager manager, string serverAppId)
+ {
+ Debug.Assert(manager != null);
+ Debug.Assert(serverAppId != null);
+
+ Manager = manager;
+ ServerAppId = serverAppId;
+ }
+
+ private MediaControllerManager Manager { get; }
+
+ /// <summary>
+ /// Gets the application id of the server.
+ /// </summary>
+ /// <value>The server application id.</value>
+ public string ServerAppId { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether the sever has been stopped.
+ /// </summary>
+ /// <value>true if the server has been stopped; otherwise, false.</value>
+ public bool IsStopped
+ {
+ get;
+ private set;
+ }
+
+ private void ThrowIfStopped()
+ {
+ if (IsStopped)
+ {
+ throw new InvalidOperationException("The server has already been stopped.");
+ }
+ }
+
+ /// <summary>
+ /// Occurs when the server is stopped.
+ /// </summary>
+ public event EventHandler ServerStopped;
+
+ internal void RaiseStoppedEvent()
+ {
+ IsStopped = true;
+ ServerStopped?.Invoke(this, EventArgs.Empty);
+ }
+
+ /// <summary>
+ /// Occurs when the playback state is updated.
+ /// </summary>
+ public event EventHandler<PlaybackStateUpdatedEventArgs> PlaybackStateUpdated;
+
+ private PlaybackStateUpdatedEventArgs CreatePlaybackUpdatedEventArgs(IntPtr playbackHandle)
+ {
+ try
+ {
+ Native.GetPlaybackState(playbackHandle, out var playbackCode).ThrowIfError("Failed to get state.");
+
+ Native.GetPlaybackPosition(playbackHandle, out var position).ThrowIfError("Failed to get position.");
+
+ return new PlaybackStateUpdatedEventArgs(playbackCode.ToState(), (long)position);
+ }
+ catch (Exception e)
+ {
+ Log.Error(GetType().FullName, e.ToString());
+ }
+ return null;
+ }
+
+ internal void RaisePlaybackUpdatedEvent(IntPtr playbackHandle)
+ {
+ var eventHandler = PlaybackStateUpdated;
+
+ if (eventHandler == null)
+ {
+ return;
+ }
+
+ var args = CreatePlaybackUpdatedEventArgs(playbackHandle);
+
+ if (args != null)
+ {
+ eventHandler.Invoke(this, args);
+ }
+ }
+
+ /// <summary>
+ /// Occurs when the metadata is updated.
+ /// </summary>
+ public event EventHandler<MetadataUpdatedEventArgs> MetadataUpdated;
+
+ private MetadataUpdatedEventArgs CreateMetadataUpdatedEventArgs(IntPtr metadataHandle)
+ {
+ try
+ {
+ return new MetadataUpdatedEventArgs(new MediaControlMetadata(metadataHandle));
+ }
+ catch (Exception e)
+ {
+ Log.Error(GetType().FullName, e.ToString());
+ }
+ return null;
+ }
+
+ internal void RaiseMetadataUpdatedEvent(IntPtr metadataHandle)
+ {
+ var eventHandler = MetadataUpdated;
+
+ if (eventHandler == null)
+ {
+ return;
+ }
+
+ var args = CreateMetadataUpdatedEventArgs(metadataHandle);
+
+ if (args != null)
+ {
+ eventHandler.Invoke(this, args);
+ }
+ }
+
+ /// <summary>
+ /// Occurs when the shuffle mode is updated.
+ /// </summary>
+ public event EventHandler<ShuffleModeUpdatedEventArgs> ShuffleModeUpdated;
+
+ internal void RaiseShuffleModeUpdatedEvent(MediaControllerShuffleMode mode)
+ {
+ ShuffleModeUpdated?.Invoke(this, new ShuffleModeUpdatedEventArgs(mode == MediaControllerShuffleMode.On));
+ }
+
+ /// <summary>
+ /// Occurs when the repeat mode is updated.
+ /// </summary>
+ public event EventHandler<RepeatModeUpdatedEventArgs> RepeatModeUpdated;
+
+ internal void RaiseRepeatModeUpdatedEvent(MediaControlRepeatMode mode)
+ {
+ RepeatModeUpdated?.Invoke(this, new RepeatModeUpdatedEventArgs(mode));
+ }
+
+ /// <summary>
+ /// Returns the playback state set by the server.
+ /// </summary>
+ /// <returns>The playback state.</returns>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.SetPlaybackState(MediaControlPlaybackState, long)"/>
+ public MediaControlPlaybackState GetPlaybackState()
+ {
+ ThrowIfStopped();
+
+ IntPtr playbackHandle = IntPtr.Zero;
+
+ try
+ {
+ Native.GetServerPlayback(Manager.Handle, ServerAppId, out playbackHandle).ThrowIfError("Failed to get playback.");
+
+ Native.GetPlaybackState(playbackHandle, out var playbackCode).ThrowIfError("Failed to get state.");
+
+ return playbackCode.ToState();
+ }
+ finally
+ {
+ if (playbackHandle != IntPtr.Zero)
+ {
+ Native.DestroyPlayback(playbackHandle);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns the playback position set by the server.
+ /// </summary>
+ /// <returns>The playback position in milliseconds.</returns>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.SetPlaybackState(MediaControlPlaybackState, long)"/>
+ public long GetPlaybackPosition()
+ {
+ ThrowIfStopped();
+
+ IntPtr playbackHandle = IntPtr.Zero;
+
+ try
+ {
+ Native.GetServerPlayback(Manager.Handle, ServerAppId, out playbackHandle).ThrowIfError("Failed to get playback.");
+
+ Native.GetPlaybackPosition(playbackHandle, out var position).ThrowIfError("Failed to get position.");
+
+ return (long)position;
+ }
+ finally
+ {
+ if (playbackHandle != IntPtr.Zero)
+ {
+ Native.DestroyPlayback(playbackHandle);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns the metadata set by the server.
+ /// </summary>
+ /// <returns>The metadata.</returns>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.SetMetadata(MediaControlMetadata)"/>
+ 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);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns whether the shuffle mode is enabled.
+ /// </summary>
+ /// <returns>A value indicating whether the shuffle mode is enabled.</returns>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.SetShuffleModeEnabled(bool)"/>
+ public bool IsShuffleModeEnabled()
+ {
+ ThrowIfStopped();
+
+ Native.GetServerShuffleMode(Manager.Handle, ServerAppId, out var shuffleMode).
+ ThrowIfError("Failed to get shuffle mode state.");
+
+ return shuffleMode == MediaControllerShuffleMode.On;
+ }
+
+ /// <summary>
+ /// Returns the repeat mode.
+ /// </summary>
+ /// <returns>A <see cref="MediaControlRepeatMode"/> set by the server.</returns>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.SetRepeatMode(MediaControlRepeatMode)"/>
+ public MediaControlRepeatMode GetRepeatMode()
+ {
+ ThrowIfStopped();
+
+ Native.GetServerRepeatMode(Manager.Handle, ServerAppId, out var repeatMode).
+ ThrowIfError("Failed to get repeat mode state.");
+
+ return repeatMode.ToPublic();
+ }
+
+ /// <summary>
+ /// Sends playback command to the server.</summary>
+ /// <param name="command">A playback command.</param>
+ /// <exception cref="InvalidOperationException">
+ /// The server has already been stopped.
+ /// -or-\n
+ /// An internal error occurs.
+ /// </exception>
+ /// <exception cref="ArgumentException"><paramref name="command"/> is not valid.</exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="MediaControllerManager"/> has already been disposed of.</exception>
+ /// <seealso cref="MediaControlServer.PlaybackCommandReceived"/>
+ public void SendPlaybackCommand(MediaControlPlaybackCommand command)
+ {
+ ThrowIfStopped();
+
+ ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackCommand), command, nameof(command));
+
+ Native.SendPlaybackStateCommand(Manager.Handle, ServerAppId, command.ToCode()).
+ ThrowIfError("Failed to send command.");
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
-using Tizen.Applications;
-using Native = Interop.MediaControllerClient;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// The MediaControllerClient class provides APIs required for media-controller-client.
- /// </summary>
- /// <privilege>
- /// http://tizen.org/privilege/mediacontroller.client
- /// </privilege>
- /// <remarks>
- /// The MediaControllerClient APIs provides functions to get media information from server.
- /// </remarks>
- public class MediaControllerClient : IDisposable
- {
- internal IntPtr _handle = IntPtr.Zero;
-
- private bool _disposed = false;
- private EventHandler<ServerUpdatedEventArgs> _serverUpdated;
- private Native.ServerUpdatedCallback _serverUpdatedCallback;
- private EventHandler<PlaybackUpdatedEventArgs> _playbackUpdated;
- private Native.PlaybackUpdatedCallback _playbackUpdatedCallback;
- private EventHandler<MetadataUpdatedEventArgs> _metadataUpdated;
- private Native.MetadataUpdatedCallback _metadataUpdatedCallback;
- private EventHandler<ShuffleModeUpdatedEventArgs> _shufflemodeUpdated;
- private Native.ShuffleModeUpdatedCallback _shufflemodeUpdatedCallback;
- private EventHandler<RepeatModeUpdatedEventArgs> _repeatmodeUpdated;
- private Native.RepeatModeUpdatedCallback _repeatmodeUpdatedCallback;
- private EventHandler<CustomCommandReplyEventArgs> _customcommandReply;
- private Native.CommandReplyRecievedCallback _customcommandReplyCallback;
-
- private bool IsValidHandle
- {
- get { return (_handle != IntPtr.Zero); }
- }
-
- private IntPtr SafeHandle
- {
- get
- {
- if (!IsValidHandle)
- {
- throw new ObjectDisposedException(nameof(MediaControllerClient), "Fail to operate MediaControllerClient");
- }
-
- return _handle;
- }
- }
-
- /// <summary>
- /// The constructor of MediaControllerClient class.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- /// <exception cref="UnauthorizedAccessException">Thrown when the access is denied for media controller client</exception>
- public MediaControllerClient()
- {
- MediaControllerValidator.ThrowIfError(
- Native.Create(out _handle), "Create client failed");
- }
-
- ~MediaControllerClient()
- {
- Dispose(false);
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (disposing)
- {
- // To be used if there are any other disposable objects
- }
-
- if (IsValidHandle)
- {
- Native.Destroy(_handle);
- _handle = IntPtr.Zero;
- }
-
- _disposed = true;
- }
- }
-
- /// <summary>
- /// ServerUpdated event is raised when server is changed
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<ServerUpdatedEventArgs> ServerUpdated
- {
- add
- {
- if (_serverUpdated == null)
- {
- RegisterServerUpdatedEvent();
- }
-
- _serverUpdated += value;
-
- }
-
- remove
- {
- _serverUpdated -= value;
- if (_serverUpdated == null)
- {
- UnregisterServerUpdatedEvent();
- }
- }
- }
-
- /// <summary>
- /// PlaybackUpdated event is raised when playback is changed
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<PlaybackUpdatedEventArgs> PlaybackUpdated
- {
- add
- {
- if (_playbackUpdated == null)
- {
- RegisterPlaybackUpdatedEvent();
- }
-
- _playbackUpdated += value;
-
- }
-
- remove
- {
- _playbackUpdated -= value;
- if (_playbackUpdated == null)
- {
- UnregisterPlaybackUpdatedEvent();
- }
- }
- }
-
- /// <summary>
- /// MetadataUpdated event is raised when metadata is changed
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<MetadataUpdatedEventArgs> MetadataUpdated
- {
- add
- {
- if (_metadataUpdated == null)
- {
- RegisterMetadataUpdatedEvent();
- }
-
- _metadataUpdated += value;
-
- }
-
- remove
- {
- _metadataUpdated -= value;
- if (_metadataUpdated == null)
- {
- UnregisterMetadataUpdatedEvent();
- }
- }
- }
-
- /// <summary>
- /// ShuffleModeUpdated event is raised when shuffle mode is changed
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<ShuffleModeUpdatedEventArgs> ShuffleModeUpdated
- {
- add
- {
- if (_shufflemodeUpdated == null)
- {
- RegisterShuffleModeUpdatedEvent();
- }
-
- _shufflemodeUpdated += value;
-
- }
-
- remove
- {
- _shufflemodeUpdated -= value;
- if (_shufflemodeUpdated == null)
- {
- UnregisterShuffleModeUpdatedEvent();
- }
- }
- }
-
- /// <summary>
- /// RepeatModeUpdated event is raised when server is changed
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<RepeatModeUpdatedEventArgs> RepeatModeUpdated
- {
- add
- {
- if (_repeatmodeUpdated == null)
- {
- RegisterRepeatModeUpdatedEvent();
- }
-
- _repeatmodeUpdated += value;
- }
-
- remove
- {
- _repeatmodeUpdated -= value;
- if (_repeatmodeUpdated == null)
- {
- UnregisterRepeatModeUpdatedEvent();
- }
- }
- }
-
- /// <summary>
- /// CommandReply event is raised when reply for command is recieved
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<CustomCommandReplyEventArgs> CustomCommandReply
- {
- add
- {
- if (_customcommandReply == null)
- {
- _customcommandReplyCallback = (IntPtr serverName, int result, IntPtr bundle, IntPtr userData) =>
- {
- SafeBundleHandle safeBundleHandle = new SafeBundleHandle(bundle, true);
- Bundle bundleData = new Bundle(safeBundleHandle);
- CustomCommandReplyEventArgs eventArgs = new CustomCommandReplyEventArgs(Marshal.PtrToStringAnsi(serverName), result, bundleData);
- _customcommandReply?.Invoke(this, eventArgs);
- };
- }
-
- _customcommandReply += value;
-
- }
-
- remove
- {
- _customcommandReply -= value;
- if (_customcommandReply == null)
- {
- _customcommandReplyCallback = null;
- }
- }
- }
-
- /// <summary>
- /// gets latest server information </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <returns>The name and state of the latest media controller server application: ServerInformation object</returns>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public ServerInformation GetLatestServer()
- {
- IntPtr name = IntPtr.Zero;
- MediaControllerServerState state = MediaControllerServerState.None;
-
- try
- {
- MediaControllerValidator.ThrowIfError(
- Native.GetLatestServer(SafeHandle, out name, out state), "Get Latest server failed");
- return new ServerInformation(Marshal.PtrToStringAnsi(name), (MediaControllerServerState)state);
- }
- finally
- {
- LibcSupport.Free(name);
- }
- }
-
- /// <summary>
- /// gets playback information for specific server </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="serverName"> Server Name </param>
- /// <returns>The playback state and playback position of the specific media controller server application:MediaControllerPlayback object</returns>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public MediaControllerPlayback GetPlayback(string serverName)
- {
- IntPtr playbackHandle = IntPtr.Zero;
- MediaControllerPlayback playback = null;
-
- try
- {
- MediaControllerValidator.ThrowIfError(
- Native.GetServerPlayback(SafeHandle, serverName, out playbackHandle), "Get Playback handle failed");
- playback = new MediaControllerPlayback(playbackHandle);
- }
- finally
- {
- if (playbackHandle != IntPtr.Zero)
- {
- MediaControllerValidator.ThrowIfError(
- Native.DestroyPlayback(playbackHandle), "Destroy playback failed");
- }
- }
-
- return playback;
- }
-
- /// <summary>
- /// gets metadata information for specific server </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="serverName"> Server Name </param>
- /// <returns>The metadata information of the specific media controller server application:MediaControllerMetadata object</returns>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public MediaControllerMetadata GetMetadata(string serverName)
- {
- IntPtr metadataHandle = IntPtr.Zero;
- MediaControllerMetadata metadata = null;
-
- try
- {
- MediaControllerValidator.ThrowIfError(
- Native.GetServerMetadata(SafeHandle, serverName, out metadataHandle), "Get Metadata handle failed");
- metadata = new MediaControllerMetadata(metadataHandle);
- }
- finally
- {
- if (metadataHandle != IntPtr.Zero)
- {
- MediaControllerValidator.ThrowIfError(
- Native.DestroyMetadata(metadataHandle), "Destroy metadata failed");
- }
- }
-
- return metadata;
- }
-
- /// <summary>
- /// gets shuffle mode for specific server </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="serverName"> Server Name </param>
- /// <returns>The shuffle mode of the specific media controller server application:MediaControllerShuffleMode enum</returns>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public MediaControllerShuffleMode GetShuffleMode(string serverName)
- {
- MediaControllerShuffleMode shuffleMode = MediaControllerShuffleMode.Off;
-
- MediaControllerValidator.ThrowIfError(
- Native.GetServerShuffleMode(SafeHandle, serverName, out shuffleMode), "Get ShuffleMode failed");
-
- return shuffleMode;
- }
-
- /// <summary>
- /// gets repeat mode for specific server </summary>\
- /// <since_tizen> 3 </since_tizen>
- /// <param name="serverName"> Server Name </param>
- /// <returns>The repeat mode of the specific media controller server application:MediaControllerRepeatMode enum</returns>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public MediaControllerRepeatMode GetRepeatMode(string serverName)
- {
- MediaControllerRepeatMode repeatMode = MediaControllerRepeatMode.Off;
-
- MediaControllerValidator.ThrowIfError(
- Native.GetServerRepeatMode(SafeHandle, serverName, out repeatMode), "Get RepeatMode failed");
-
- return repeatMode;
- }
-
- /// <summary>
- /// Send command of playback state to server application </summary>
- /// <param name="serverName"> Server Name </param>
- /// <param name="state"> Playback State </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void SendPlaybackStateCommand(string serverName, MediaControllerPlaybackState state)
- {
- MediaControllerValidator.ThrowIfError(
- Native.SendPlaybackStateCommand(SafeHandle, serverName, state), "Send playback state command failed");
- }
-
- /// <summary>
- /// Send customized command to server application </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="serverName"> Server Name </param>
- /// <param name="command"> Command </param>
- /// <param name="bundle"> Bundle data </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void SendCustomCommand(string serverName, string command, Bundle bundle)
- {
- MediaControllerValidator.ThrowIfError(
- Native.SendCustomCommand(SafeHandle, serverName, command, bundle.SafeBundleHandle, _customcommandReplyCallback, IntPtr.Zero),
- "Send custom command failed");
- }
-
- /// <summary>
- /// Subscribe subscription type from specific server application </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="type"> Subscription Type </param>
- /// <param name="serverName"> Server Name </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- public void Subscribe(MediaControllerSubscriptionType type, string serverName)
- {
- MediaControllerValidator.ThrowIfError(
- Native.Subscribe(SafeHandle, type, serverName), "Subscribe failed");
- }
-
- /// <summary>
- /// Subscribe subscription type from specific server application </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="type"> Subscription Type </param>
- /// <param name="serverName"> Server Name </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- public void Unsubscribe(MediaControllerSubscriptionType type, string serverName)
- {
- MediaControllerValidator.ThrowIfError(
- Native.Unsubscribe(SafeHandle, type, serverName), "Unsubscribe failed");
- }
-
- /// <summary>
- /// gets activated server list </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <returns>The list of activated media controller server applications: IEnumerable of string</returns>
- public Task<IEnumerable<string>> GetActivatedServerList()
- {
- var task = new TaskCompletionSource<IEnumerable<string>>();
-
- List<string> collectionList = ForEachActivatedServer(SafeHandle);
- task.TrySetResult((IEnumerable<string>)collectionList);
-
- return task.Task;
- }
-
- /// <summary>
- /// gets subscribed server list </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="subscriptionType"> Subscription Type </param>
- /// <returns>The list of subscribed media controller server applications: IEnumerable of string</returns>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public Task<IEnumerable<string>> GetSubscribedServerList(MediaControllerSubscriptionType subscriptionType)
- {
- var task = new TaskCompletionSource<IEnumerable<string>>();
-
- List<string> collectionList = ForEachSubscribedServer(SafeHandle, subscriptionType);
- task.TrySetResult((IEnumerable<string>)collectionList);
-
- return task.Task;
- }
-
- private void RegisterServerUpdatedEvent()
- {
- _serverUpdatedCallback = (IntPtr serverName, MediaControllerServerState serverState, IntPtr userData) =>
- {
- ServerUpdatedEventArgs eventArgs = new ServerUpdatedEventArgs(Marshal.PtrToStringAnsi(serverName), serverState);
- _serverUpdated?.Invoke(this, eventArgs);
- };
- Native.SetServerUpdatedCb(SafeHandle, _serverUpdatedCallback, IntPtr.Zero);
- }
-
- private void UnregisterServerUpdatedEvent()
- {
- Native.UnsetServerUpdatedCb(SafeHandle);
- }
-
- private void RegisterPlaybackUpdatedEvent()
- {
- _playbackUpdatedCallback = (IntPtr serverName, IntPtr playback, IntPtr userData) =>
- {
- PlaybackUpdatedEventArgs eventArgs = new PlaybackUpdatedEventArgs(Marshal.PtrToStringAnsi(serverName), playback);
- _playbackUpdated?.Invoke(this, eventArgs);
- };
- Native.SetPlaybackUpdatedCb(SafeHandle, _playbackUpdatedCallback, IntPtr.Zero);
- }
-
- private void UnregisterPlaybackUpdatedEvent()
- {
- Native.UnsetPlaybackUpdatedCb(SafeHandle);
- }
-
- private void RegisterMetadataUpdatedEvent()
- {
- _metadataUpdatedCallback = (IntPtr serverName, IntPtr metadata, IntPtr userData) =>
- {
- MetadataUpdatedEventArgs eventArgs = new MetadataUpdatedEventArgs(Marshal.PtrToStringAnsi(serverName), metadata);
- _metadataUpdated?.Invoke(this, eventArgs);
- };
- Native.SetMetadataUpdatedCb(SafeHandle, _metadataUpdatedCallback, IntPtr.Zero);
- }
-
- private void UnregisterMetadataUpdatedEvent()
- {
- Native.UnsetMetadataUpdatedCb(SafeHandle);
- }
-
- private void RegisterShuffleModeUpdatedEvent()
- {
- _shufflemodeUpdatedCallback = (IntPtr serverName, MediaControllerShuffleMode shuffleMode, IntPtr userData) =>
- {
- ShuffleModeUpdatedEventArgs eventArgs = new ShuffleModeUpdatedEventArgs(Marshal.PtrToStringAnsi(serverName), shuffleMode);
- _shufflemodeUpdated?.Invoke(this, eventArgs);
- };
-
- MediaControllerValidator.ThrowIfError(
- Native.SetShuffleModeUpdatedCb(SafeHandle, _shufflemodeUpdatedCallback, IntPtr.Zero),
- "Set ShuffleModeUpdated callback failed");
- }
-
- private void UnregisterShuffleModeUpdatedEvent()
- {
- Native.UnsetShuffleModeUpdatedCb(SafeHandle);
- }
-
- private void RegisterRepeatModeUpdatedEvent()
- {
- _repeatmodeUpdatedCallback = (IntPtr serverName, MediaControllerRepeatMode repeatMode, IntPtr userData) =>
- {
- RepeatModeUpdatedEventArgs eventArgs = new RepeatModeUpdatedEventArgs(Marshal.PtrToStringAnsi(serverName), repeatMode);
- _repeatmodeUpdated?.Invoke(this, eventArgs);
- };
-
- MediaControllerValidator.ThrowIfError(
- Native.SetRepeatModeUpdatedCb(SafeHandle, _repeatmodeUpdatedCallback, IntPtr.Zero),
- "Set RepeatModeUpdated callback failed");
- }
-
- private void UnregisterRepeatModeUpdatedEvent()
- {
- Native.UnsetRepeatModeUpdatedCb(SafeHandle);
- }
-
- private static List<string> ForEachSubscribedServer(IntPtr handle, MediaControllerSubscriptionType subscriptionType)
- {
- List<string> subscribedServerCollections = new List<string>();
-
- Native.SubscribedServerCallback serverCallback = (IntPtr serverName, IntPtr userData) =>
- {
- subscribedServerCollections.Add(Marshal.PtrToStringAnsi(serverName));
- return true;
- };
-
- MediaControllerValidator.ThrowIfError(
- Native.ForeachSubscribedServer(handle, subscriptionType, serverCallback, IntPtr.Zero),
- "Foreach Subscribed server failed");
-
- return subscribedServerCollections;
- }
-
- private static List<string> ForEachActivatedServer(IntPtr handle)
- {
- List<string> activatedServerCollections = new List<string>();
-
- Native.ActivatedServerCallback serverCallback = (IntPtr serverName, IntPtr userData) =>
- {
- activatedServerCollections.Add(Marshal.PtrToStringAnsi(serverName));
- return true;
- };
-
- MediaControllerValidator.ThrowIfError(
- Native.ForeachActivatedServer(handle, serverCallback, IntPtr.Zero),
- "Foreach Activated server failed");
-
- return activatedServerCollections;
- }
- }
-}
-
+++ /dev/null
-/*
-* 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.MediaController
-{
- /// <summary>
- /// Specifies states that a <see cref="ServerInformation"/> can have.
- /// </summary>
- public enum MediaControllerServerState
- {
- /// <summary>
- /// Server state is unknown
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- None,
-
- /// <summary>
- /// Server is activated
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Activated,
-
- /// <summary>
- /// Server is deactivated
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Deactivated,
- }
-
- /// <summary>
- /// Enumeration for playback state
- /// </summary>
- public enum MediaControllerPlaybackState
- {
- /// <summary>
- /// Playback state is unknown
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- None,
-
- /// <summary>
- /// Playback is playing
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Play,
-
- /// <summary>
- /// Playback is paused
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Pause,
-
- /// <summary>
- /// Playback is next
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Next,
-
- /// <summary>
- /// Playback is prev
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Prev,
-
- /// <summary>
- /// Playback is fastforward
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- FastForward,
-
- /// <summary>
- /// Playback is rewind
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Rewind,
- }
-
- /// <summary>
- /// Enumeration for shuffle mode
- /// </summary>
- public enum MediaControllerShuffleMode
- {
- /// <summary>
- /// Shuffle mode is On
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- On,
-
- /// <summary>
- /// Shuffle mode is Off
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Off,
- }
-
- /// <summary>
- /// Enumeration for repeat mode
- /// </summary>
- public enum MediaControllerRepeatMode
- {
- /// <summary>
- /// Repeat mode is On
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- On,
-
- /// <summary>
- /// Repeat mode is Off
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Off,
- }
-
- /// <summary>
- /// Enumeration for repeat mode
- /// </summary>
- public enum MediaControllerSubscriptionType
- {
- /// <summary>
- /// The type of subscription is the state of server
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- ServerState,
-
- /// <summary>
- /// The type of subscription is the playback
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Playback,
-
- /// <summary>
- /// The type of subscription is the metadata
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Metadata,
-
- /// <summary>
- /// The type of subscription is the shuffle mode
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- ShuffleMode,
-
- /// <summary>
- /// The type of subscription is the repeat mode
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- RepeatMode,
- }
-
- /// <summary>
- /// Enumeration for metadata attributes
- /// </summary>
- internal enum MediaControllerAttributes
- {
- /// <summary>
- /// Attribute is title
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Title,
-
- /// <summary>
- /// Attribute is artist
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Artist,
-
- /// <summary>
- /// Attribute is album
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Album,
-
- /// <summary>
- /// Attribute is author
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Author,
-
- /// <summary>
- /// Attribute is genre
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Genre,
-
- /// <summary>
- /// Attribute is duration
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Duration,
-
- /// <summary>
- /// Attribute is date
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Date,
-
- /// <summary>
- /// Attribute is copyright
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Copyright,
-
- /// <summary>
- /// Attribute is description
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Description,
-
- /// <summary>
- /// Attribute is track number
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- TrackNumber,
-
- /// <summary>
- /// Attribute is picture
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Picture,
- }
-}
-
/*
-* 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.
-*/
+ * 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.IO;
using Tizen.Internals.Errors;
-namespace Tizen.Multimedia.MediaController
+namespace Tizen.Multimedia.Remoting
{
internal enum MediaControllerError
{
InvalidOperation = ErrorCode.InvalidOperation,
NoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice,
PermissionDenied = ErrorCode.PermissionDenied,
- };
+ }
- internal static class MediaControllerValidator
+ internal static class MediaControllerErrorExtensions
{
- internal static void ThrowIfError(MediaControllerError error, string errorMessage)
+ internal static void ThrowIfError(this MediaControllerError error, string errorMessage)
{
+ if (error == MediaControllerError.None)
+ {
+ return;
+ }
+
switch (error)
{
case MediaControllerError.InvalidParameter:
throw new InvalidOperationException(errorMessage);
case MediaControllerError.NoSpaceOnDevice:
- throw new IOException(errorMessage);
+ throw new IOException($"Not enough storage : {errorMessage}");
case MediaControllerError.PermissionDenied:
throw new UnauthorizedAccessException(errorMessage);
}
+
+ throw new InvalidOperationException($"Unknown error({error}) : {errorMessage}");
}
}
-}
-
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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;
-
-namespace Tizen.Multimedia.MediaController
-{
- static internal class MediaControllerLog
- {
- internal const string LogTag = "Tizen.Multimedia.MediaController";
- }
-}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 Native = Interop.MediaControllerClient;
+
+namespace Tizen.Multimedia.Remoting
+{
+ public partial class MediaControllerManager
+ {
+ private Native.ServerUpdatedCallback _serverUpdatedCallback;
+ private Native.PlaybackUpdatedCallback _playbackUpdatedCallback;
+ private Native.MetadataUpdatedCallback _metadataUpdatedCallback;
+ private Native.ShuffleModeUpdatedCallback _shufflemodeUpdatedCallback;
+ private Native.RepeatModeUpdatedCallback _repeatmodeUpdatedCallback;
+
+ /// <summary>
+ /// Occurs when a server is started.
+ /// </summary>
+ public event EventHandler<MediaControlServerStartedEventArgs> ServerStarted;
+
+ /// <summary>
+ /// Occurs when a server is stopped.
+ /// </summary>
+ public event EventHandler<MediaControlServerStoppedEventArgs> ServerStopped;
+
+ private void InitializeEvents()
+ {
+ RegisterPlaybackUpdatedEvent();
+ RegisterServerUpdatedEvent();
+ RegisterMetadataUpdatedEvent();
+ RegisterShuffleModeUpdatedEvent();
+ RegisterRepeatModeUpdatedEvent();
+ }
+
+ private void RaiseServerChangedEvent(MediaControllerServerState state, MediaController controller)
+ {
+ if (controller == null)
+ {
+ return;
+ }
+
+ if (state == MediaControllerServerState.Activated)
+ {
+ ServerStarted?.Invoke(this, new MediaControlServerStartedEventArgs(controller));
+ }
+ else
+ {
+ controller.RaiseStoppedEvent();
+ ServerStopped?.Invoke(this, new MediaControlServerStoppedEventArgs(controller.ServerAppId));
+ }
+ }
+
+ private void RegisterServerUpdatedEvent()
+ {
+ _serverUpdatedCallback = (serverName, state, _) =>
+ {
+ RaiseServerChangedEvent(state, HandleServerUpdated(serverName, state));
+ };
+
+ Native.SetServerUpdatedCb(Handle, _serverUpdatedCallback).ThrowIfError("Failed to init server changed event.");
+ }
+
+ private void RegisterPlaybackUpdatedEvent()
+ {
+ _playbackUpdatedCallback = (serverName, playback, _) =>
+ {
+ GetController(serverName)?.RaisePlaybackUpdatedEvent(playback);
+ };
+
+ Native.SetPlaybackUpdatedCb(Handle, _playbackUpdatedCallback).ThrowIfError("Failed to init PlaybackUpdated event.");
+ }
+
+
+ private void RegisterMetadataUpdatedEvent()
+ {
+ _metadataUpdatedCallback = (serverName, metadata, _) =>
+ {
+ GetController(serverName)?.RaiseMetadataUpdatedEvent(metadata);
+ };
+
+ Native.SetMetadataUpdatedCb(Handle, _metadataUpdatedCallback).ThrowIfError("Failed to init MetadataUpdated event.");
+ }
+
+ private void RegisterShuffleModeUpdatedEvent()
+ {
+ _shufflemodeUpdatedCallback = (serverName, shuffleMode, _) =>
+ {
+ GetController(serverName)?.RaiseShuffleModeUpdatedEvent(shuffleMode);
+ };
+
+ Native.SetShuffleModeUpdatedCb(Handle, _shufflemodeUpdatedCallback).
+ ThrowIfError("Failed to init ShuffleModeUpdated event.");
+ }
+
+ private void RegisterRepeatModeUpdatedEvent()
+ {
+ _repeatmodeUpdatedCallback = (serverName, repeatMode, _) =>
+ {
+ GetController(serverName)?.RaiseRepeatModeUpdatedEvent(repeatMode.ToPublic());
+ };
+
+ Native.SetRepeatModeUpdatedCb(Handle, _repeatmodeUpdatedCallback).
+ ThrowIfError("Failed to init RepeatModeUpdated event.");
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Native = Interop.MediaControllerClient;
+using NativeHandle = Interop.MediaControllerClientHandle;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides a means to retrieve active controllers and observe controllers added and removed.
+ /// </summary>
+ public partial class MediaControllerManager : IDisposable
+ {
+ private NativeHandle _handle;
+
+ private Dictionary<string, MediaController> _activated = new Dictionary<string, MediaController>();
+
+ private ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();
+
+ internal NativeHandle Handle
+ {
+ get
+ {
+ if (_disposed)
+ {
+ throw new ObjectDisposedException(nameof(MediaControllerManager));
+ }
+
+ return _handle;
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MediaControllerManager"/> class.
+ /// </summary>
+ /// <privilege>http://tizen.org/privilege/mediacontroller.client</privilege>
+ /// <exception cref="InvalidOperationException">An internal error occurs.</exception>
+ /// <exception cref="UnauthorizedAccessException">Caller does not have required privilege.</exception>
+ public MediaControllerManager()
+ {
+ Native.Create(out _handle).ThrowIfError("Failed to create media controller client.");
+
+ InitializeEvents();
+
+ LoadActivatedServers();
+ }
+
+ private bool _disposed;
+
+ /// <summary>
+ /// Releases all resources used by the <see cref="MediaControllerManager"/>.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+
+ /// <summary>
+ /// Releases the unmanaged resources used by the <see cref="MediaControllerManager"/>.
+ /// </summary>
+ /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ if (disposing)
+ {
+ // To be used if there are any other disposable objects
+ }
+ _handle.Dispose();
+
+ _disposed = true;
+ }
+ }
+
+ /// <summary>
+ /// Gets the active controllers.
+ /// </summary>
+ /// <returns>An array of <see cref="MediaController"/>.</returns>
+ public MediaController[] GetActiveControllers()
+ {
+ if (_disposed)
+ {
+ return new MediaController[0];
+ }
+
+ try
+ {
+ _lock.EnterReadLock();
+ return _activated.Values.ToArray();
+ }
+ finally
+ {
+ _lock.ExitReadLock();
+ }
+ }
+
+ #region Controllers-related operations
+
+ #region Unlocking operations
+
+ private MediaController HandleActivation(string serverName)
+ {
+ if (_activated.ContainsKey(serverName))
+ {
+ return null;
+ }
+
+ var controller = new MediaController(this, serverName);
+ _activated.Add(serverName, controller);
+
+ return controller;
+ }
+
+ private MediaController HandleDeactivation(string serverName)
+ {
+ if (_activated.TryGetValue(serverName, out var controller))
+ {
+ _activated.Remove(serverName);
+ }
+
+ return controller;
+ }
+ #endregion
+
+ #region Locking operations
+
+ private MediaController HandleServerUpdated(string serverName, MediaControllerServerState state)
+ {
+ try
+ {
+ _lock.EnterWriteLock();
+
+ if (state == MediaControllerServerState.Activated)
+ {
+ return HandleActivation(serverName);
+ }
+
+ return HandleDeactivation(serverName);
+ }
+ finally
+ {
+ _lock.ExitWriteLock();
+ }
+ }
+
+ private MediaController GetController(string serverName)
+ {
+ try
+ {
+ _lock.EnterReadLock();
+
+ _activated.TryGetValue(serverName, out var value);
+ return value;
+ }
+ finally
+ {
+ _lock.ExitReadLock();
+ }
+ }
+
+ private void LoadActivatedServers()
+ {
+ try
+ {
+ _lock.EnterWriteLock();
+
+ Native.ActivatedServerCallback serverCallback = (serverName, _) =>
+ {
+ _activated.Add(serverName, new MediaController(this, serverName));
+ return true;
+ };
+
+ Native.ForeachActivatedServer(Handle, serverCallback, IntPtr.Zero).
+ ThrowIfError("Failed to get activated servers.");
+ }
+ finally
+ {
+ _lock.ExitWriteLock();
+ }
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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 Native = Interop.MediaControllerClient;
-
-namespace Tizen.Multimedia.MediaController
-{
- /// <summary>
- /// Metadata represents a metadata of media for server application to play
- /// </summary>
- public class MediaControllerMetadata
- {
- /// <summary>
- /// The constructor of MediaControllerMetadata class.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerMetadata()
- {
- // Do nothing
- }
-
- internal MediaControllerMetadata(IntPtr handle)
- {
- if (handle == IntPtr.Zero)
- {
- throw new InvalidOperationException("MediaControllerMetadata is not valid.");
- }
-
- Title = Native.GetMetadata(handle, MediaControllerAttributes.Title);
- Artist = Native.GetMetadata(handle, MediaControllerAttributes.Artist);
- Album = Native.GetMetadata(handle, MediaControllerAttributes.Album);
- Author = Native.GetMetadata(handle, MediaControllerAttributes.Author);
- Genre = Native.GetMetadata(handle, MediaControllerAttributes.Genre);
- Duration = Native.GetMetadata(handle, MediaControllerAttributes.Duration);
- Date = Native.GetMetadata(handle, MediaControllerAttributes.Date);
- Copyright = Native.GetMetadata(handle, MediaControllerAttributes.Copyright);
- Description = Native.GetMetadata(handle, MediaControllerAttributes.Description);
- TrackNumber = Native.GetMetadata(handle, MediaControllerAttributes.TrackNumber);
- Picture = Native.GetMetadata(handle, MediaControllerAttributes.Picture);
- }
-
- /// <summary>
- /// Set/Get the Title of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Title { get; set; }
-
- /// <summary>
- /// Set/Get the Artist of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Artist { get; set; }
-
- /// <summary>
- /// Set/Get the Album of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Album { get; set; }
-
- /// <summary>
- /// Set/Get the Author of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Author { get; set; }
-
- /// <summary>
- /// Set/Get the Genre of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Genre { get; set; }
-
- /// <summary>
- /// Set/Get the Duration of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Duration { get; set; }
-
- /// <summary>
- /// Set/Get the Date of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Date { get; set; }
-
- /// <summary>
- /// Set/Get the Copyright of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Copyright { get; set; }
-
- /// <summary>
- /// Set/Get the Description of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Description { get; set; }
-
- /// <summary>
- /// Set/Get the Track Number of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string TrackNumber { get; set; }
-
- /// <summary>
- /// Set/Get the Picture of media
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Picture { get; set; }
- }
-}
-
+++ /dev/null
-/*
-* 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 Native = Interop.MediaControllerClient;
-
-namespace Tizen.Multimedia.MediaController
-{
- /// <summary>
- /// Playback represents a playback state and playback position.
- /// </summary>
- public class MediaControllerPlayback
- {
- /// <summary>
- /// The constructor of MediaControllerPlayback class.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="state">
- /// The state of the playback which is playing in MediaConttoller server application
- /// </param>
- /// <param name="position">
- /// The position of the playback which is playing in MediaConttoller server application
- /// </param>
- public MediaControllerPlayback(MediaControllerPlaybackState state, ulong position)
- {
- State = state;
- Position = position;
- }
-
- internal MediaControllerPlayback(IntPtr handle)
- {
- MediaControllerPlaybackState state = MediaControllerPlaybackState.None;
- ulong position = 0L;
-
- if (handle == IntPtr.Zero)
- {
- throw new InvalidOperationException("MediaControllerPlayback is not valid.");
- }
-
- MediaControllerValidator.ThrowIfError(
- Native.GetPlaybackState(handle, out state), "Get Playback state failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.GetPlaybackPosition(handle, out position), "Get Playback position failed");
-
- State = state;
- Position = position;
- }
-
- /// <summary>
- /// Set/Get the State of playback information
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerPlaybackState State { get; }
-
- /// <summary>
- /// Set/Get the Position of playback information
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ulong Position { get; }
- }
-}
-
--- /dev/null
+/*
+ * 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.Remoting
+{
+ public enum MediaControlRepeatMode
+ {
+ Off,
+ On,
+ }
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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;
-using Tizen.Applications;
-using Native = Interop.MediaControllerServer;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// The MediaControllerServer class provides APIs required for media-controller-server.
- /// </summary>
- /// <privilege>
- /// http://tizen.org/privilege/mediacontroller.server
- /// </privilege>
- /// <remarks>
- /// The MediaControllerServer APIs provides functions to update media information.
- /// </remarks>
- public class MediaControllerServer : IDisposable
- {
- internal IntPtr _handle = IntPtr.Zero;
-
- private bool _disposed = false;
- private EventHandler<PlaybackStateCommandEventArgs> _playbackCommand;
- private Native.PlaybackStateCommandRecievedCallback _playbackCommandCallback;
- private EventHandler<CustomCommandEventArgs> _customCommand;
- private Native.CustomCommandRecievedCallback _customCommandCallback;
-
- private bool IsValidHandle
- {
- get { return (_handle != IntPtr.Zero); }
- }
-
- private IntPtr SafeHandle
- {
- get
- {
- if (!IsValidHandle)
- {
- throw new ObjectDisposedException(nameof(MediaControllerServer), "Fail to operate MediaControllerServer");
- }
-
- return _handle;
- }
- }
-
- /// <summary>
- /// The constructor of MediaControllerServer class.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- /// <exception cref="UnauthorizedAccessException">Thrown when the access is denied for media controller client</exception>
- public MediaControllerServer()
- {
- MediaControllerValidator.ThrowIfError(
- Native.Create(out _handle), "Create server failed");
- }
-
- ~MediaControllerServer()
- {
- Dispose(false);
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (disposing)
- {
- // To be used if there are any other disposable objects
- }
-
- if (IsValidHandle)
- {
- Native.Destroy(_handle);
- _handle = IntPtr.Zero;
- }
-
- _disposed = true;
- }
- }
-
- /// <summary>
- /// PlaybackStateCommandRecieved event is raised when client send command for playback
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<PlaybackStateCommandEventArgs> PlaybackStateCommand
- {
- add
- {
- if (_playbackCommand == null)
- {
- RegisterPlaybackCmdRecvEvent();
- }
-
- _playbackCommand += value;
-
- }
-
- remove
- {
- _playbackCommand -= value;
- if (_playbackCommand == null)
- {
- UnregisterPlaybackCmdRecvEvent();
- }
- }
- }
-
- /// <summary>
- /// CustomCommandRecieved event is raised when client send customized command
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<CustomCommandEventArgs> CustomCommand
- {
- add
- {
- if (_customCommand == null)
- {
- RegisterCustomCommandEvent();
- }
-
- _customCommand += value;
-
- }
-
- remove
- {
- _customCommand -= value;
- if (_customCommand == null)
- {
- UnregisterCustomCommandEvent();
- }
- }
- }
-
- /// <summary>
- /// Update playback state and playback position</summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="playback"> playback state and playback position </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void UpdatePlayback(MediaControllerPlayback playback)
- {
- if (playback == null)
- {
- throw new ArgumentNullException("playback is null");
- }
-
- MediaControllerValidator.ThrowIfError(
- Native.SetPlaybackState(SafeHandle, playback.State), "Set Playback state failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetPlaybackPosition(SafeHandle, playback.Position), "Set Playback position failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.UpdatePlayback(SafeHandle), "Update Playback failed");
- }
-
- /// <summary>
- /// Update metadata information </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="metadata"> metadata information </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void UpdateMetadata(MediaControllerMetadata metadata)
- {
- if (metadata == null)
- {
- throw new ArgumentNullException("metadata is null");
- }
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Title, metadata.Title), "Set Title failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Artist, metadata.Artist), "Set Artist failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Album, metadata.Album), "Set Album failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Author, metadata.Author), "Set Author failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Genre, metadata.Genre), "Set Genre failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Duration, metadata.Duration), "Set Duration failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Date, metadata.Date), "Set Date failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Copyright, metadata.Copyright), "Set Copyright failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Description, metadata.Description), "Set Description failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.TrackNumber, metadata.TrackNumber), "Set TrackNumber failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.SetMetadata(SafeHandle, MediaControllerAttributes.Picture, metadata.Picture), "Set Picture failed");
-
- MediaControllerValidator.ThrowIfError(
- Native.UpdateMetadata(SafeHandle), "UpdateMetadata Metadata failed");
- }
-
- /// <summary>
- /// Update shuffle mode </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="mode"> shuffle mode </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void UpdateShuffleMode(MediaControllerShuffleMode mode)
- {
- MediaControllerValidator.ThrowIfError(
- Native.UpdateShuffleMode(SafeHandle, mode), "Update Shuffle Mode failed");
- }
-
- /// <summary>
- /// Update repeat mode </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="mode"> repeat mode </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void UpdateRepeatMode(MediaControllerRepeatMode mode)
- {
- MediaControllerValidator.ThrowIfError(
- Native.UpdateRepeatMode(SafeHandle, mode), "Update Repeat Mode failed");
- }
-
- /// <summary>
- /// Send reply for command from server to client </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <param name="clientName"> client name to recieve reply </param>
- /// <param name="result"> result to run command </param>
- /// <param name="bundle"> Bundle to send various data </param>
- /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
- /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state</exception>
- public void SendCustomCommandReply(string clientName, int result, Bundle bundle)
- {
- MediaControllerValidator.ThrowIfError(
- Native.SendCommandReply(SafeHandle, clientName, result, bundle.SafeBundleHandle), "Send reply for command failed");
- }
-
- private void RegisterPlaybackCmdRecvEvent()
- {
- _playbackCommandCallback = (IntPtr clientName, MediaControllerPlaybackState state, IntPtr userData) =>
- {
- PlaybackStateCommandEventArgs eventArgs = new PlaybackStateCommandEventArgs(Marshal.PtrToStringAnsi(clientName), state);
- _playbackCommand?.Invoke(this, eventArgs);
- };
- Native.SetPlaybackStateCmdRecvCb(SafeHandle, _playbackCommandCallback, IntPtr.Zero);
- }
-
- private void UnregisterPlaybackCmdRecvEvent()
- {
- Native.UnsetPlaybackStateCmdRecvCb(SafeHandle);
- }
-
- private void RegisterCustomCommandEvent()
- {
- _customCommandCallback = (IntPtr clientName, IntPtr command, IntPtr bundle, IntPtr userData) =>
- {
- SafeBundleHandle safeBundleHandle = new SafeBundleHandle(bundle, true);
- Bundle bundleData = new Bundle(safeBundleHandle);
- CustomCommandEventArgs eventArgs = new CustomCommandEventArgs(Marshal.PtrToStringAnsi(clientName), Marshal.PtrToStringAnsi(command), bundleData);
- _customCommand?.Invoke(this, eventArgs);
- };
- Native.SetCustomCmdRecvCb(SafeHandle, _customCommandCallback, IntPtr.Zero);
- }
-
- private void UnregisterCustomCommandEvent()
- {
- Native.UnsetCustomCmdRecvCb(SafeHandle);
- }
- }
-}
-
/*
-* 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.
-*/
+ * 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;
-namespace Tizen.Multimedia.MediaController
+namespace Tizen.Multimedia.Remoting
{
-
/// <summary>
- /// MetadataUpdated event arguments
+ /// Provides data for the <see cref="MediaController.MetadataUpdated"/> event.
/// </summary>
- /// <remarks>
- /// MetadataUpdated event arguments
- /// </remarks>
public class MetadataUpdatedEventArgs : EventArgs
{
- internal MetadataUpdatedEventArgs(string name, IntPtr handle)
- {
- ServerName = name;
- Metadata = new MediaControllerMetadata(handle);
- }
-
/// <summary>
- /// Get the Server Name.
+ /// Initializes a new instance of the <see cref="MetadataUpdatedEventArgs"/> class.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ServerName { get; }
+ /// <param name="metadata">The updated <see cref="MediaControlMetadata"/>.</param>
+ public MetadataUpdatedEventArgs(MediaControlMetadata metadata)
+ {
+ Metadata = metadata;
+ }
/// <summary>
- /// Get the Metadata information.
+ /// Gets the metadata.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerMetadata Metadata { get; }
+ /// <value>The updated <see cref="MediaControlMetadata"/>.</value>
+ public MediaControlMetadata Metadata { get; }
}
-}
-
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides data for the <see cref="MediaControlServer.PlaybackCommandReceived"/> event.
+ /// </summary>
+ public class PlaybackCommandReceivedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PlaybackCommandReceivedEventArgs"/> class.
+ /// </summary>
+ /// <param name="clientAppId">The client application id.</param>
+ /// <param name="command">The playback command.</param>
+ /// <exception cref="ArgumentNullException"><paramref name="clientAppId"/> is null.</exception>
+ /// <exception cref="ArgumentException"><paramref name="command"/> is invalid.</exception>
+ public PlaybackCommandReceivedEventArgs(string clientAppId, MediaControlPlaybackCommand command)
+ {
+ if (clientAppId == null)
+ {
+ throw new ArgumentNullException(nameof(clientAppId));
+ }
+
+ ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackCommand), command, nameof(command));
+
+ ClientAppId = clientAppId;
+ Command = command;
+ }
+
+ /// <summary>
+ /// Gets the application id of the client that sent command.
+ /// </summary>
+ /// <value>The client application id.</value>
+ public string ClientAppId { get; }
+
+ /// <summary>
+ /// Gets the command.
+ /// </summary>
+ /// <value>The <see cref="MediaControlPlaybackCommand"/>.</value>
+ public MediaControlPlaybackCommand Command { get; }
+ }
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// PlaybackStateCommand event arguments
- /// </summary>
- /// <remarks>
- /// PlaybackStateCommand event arguments
- /// </remarks>
- public class PlaybackStateCommandEventArgs : EventArgs
- {
- internal PlaybackStateCommandEventArgs(string name, MediaControllerPlaybackState state)
- {
- ClientName = name;
- State = state;
- }
-
- /// <summary>
- /// Get the Client Name.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ClientName { get; }
-
- /// <summary>
- /// Get the State of playback.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerPlaybackState State { get; }
- }
-}
-
--- /dev/null
+/*
+ * 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.Diagnostics;
+using Native = Interop.MediaControllerClient;
+
+namespace Tizen.Multimedia.Remoting
+{
+ /// <summary>
+ /// Provides data for the <see cref="MediaController.PlaybackStateUpdated"/> event.
+ /// </summary>
+ public class PlaybackStateUpdatedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PlaybackStateUpdatedEventArgs"/> class.
+ /// </summary>
+ /// <param name="state">The playback state.</param>
+ /// <param name="position">The playback position in milliseconds.</param>
+ /// <exception cref="ArgumentException"><paramref name="state"/> is invalid.</exception>
+ /// <exception cref="ArgumentOutOfRangeException"><paramref name="position"/> is less than zero.</exception>
+ public PlaybackStateUpdatedEventArgs(MediaControlPlaybackState state, long position)
+ {
+ ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackState), state, nameof(state));
+
+ if (position < 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(position), position, "position can't be less than zero.");
+ }
+
+ State = state;
+ Position = position;
+ }
+
+ /// <summary>
+ /// Gets the playback state.
+ /// </summary>
+ public MediaControlPlaybackState State { get; }
+
+ /// <summary>
+ /// Gets the playback position in milliseconds.
+ /// </summary>
+ public long Position { get; }
+ }
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// PlaybackUpdated event arguments
- /// </summary>
- /// <remarks>
- /// PlaybackUpdated event arguments
- /// </remarks>
- public class PlaybackUpdatedEventArgs : EventArgs
- {
- internal PlaybackUpdatedEventArgs(string name, IntPtr handle)
- {
- ServerName = name;
- PlaybackInfo = new MediaControllerPlayback(handle);
- }
-
- /// <summary>
- /// Get the Server Name.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ServerName { get; }
-
- /// <summary>
- /// Get the Playback Information.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerPlayback PlaybackInfo { get; }
- }
-}
-
/*
-* 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.
-*/
+ * 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;
-namespace Tizen.Multimedia.MediaController
+namespace Tizen.Multimedia.Remoting
{
-
/// <summary>
- /// RepeatModeUpdated event arguments
+ /// Provides data for the <see cref="MediaController.RepeatModeUpdated"/> event.
/// </summary>
- /// <remarks>
- /// RepeatModeUpdated event arguments
- /// </remarks>
public class RepeatModeUpdatedEventArgs : EventArgs
{
- internal RepeatModeUpdatedEventArgs(string name, MediaControllerRepeatMode mode)
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RepeatModeUpdatedEventArgs"/> class.
+ /// </summary>
+ /// <param name="mode">A value indicating the updated repeat mode.</param>
+ /// <exception cref="ArgumentException"/><paramref name="mode"/> is invalid.</exception>
+ public RepeatModeUpdatedEventArgs(MediaControlRepeatMode mode)
{
- ServerName = name;
+ ValidationUtil.ValidateEnum(typeof(MediaControlRepeatMode), mode, nameof(mode));
+
RepeatMode = mode;
}
/// <summary>
- /// Get the Server Name.
+ /// Gets the updated repeat mode.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ServerName { get; }
-
- /// <summary>
- /// Get the Repeat Mode.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerRepeatMode RepeatMode { get; }
+ /// <value>The <see cref="MediaControlRepeatMode"/>.</value>
+ public MediaControlRepeatMode RepeatMode { get; }
}
-}
-
+}
\ No newline at end of file
+++ /dev/null
-/*
-* 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;
-
-namespace Tizen.Multimedia.MediaController
-{
- /// <summary>
- /// ServerInformation represents a name and state of server application.
- /// </summary>
- public class ServerInformation
- {
- internal ServerInformation(string name, MediaControllerServerState state)
- {
- Name = name;
- State = state;
- }
-
- /// <summary>
- /// Get the Name of server
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string Name { get; }
-
- /// <summary>
- /// Get the State of server
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerServerState State { get; }
- }
-}
-
+++ /dev/null
-/*
-* 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;
-
-namespace Tizen.Multimedia.MediaController
-{
-
- /// <summary>
- /// ServerUpdated event arguments
- /// </summary>
- /// <remarks>
- /// ServerUpdated event arguments
- /// </remarks>
- public class ServerUpdatedEventArgs : EventArgs
- {
- internal ServerUpdatedEventArgs(string name, MediaControllerServerState state)
- {
- ServerInfo = new ServerInformation(name, state);
- }
-
- /// <summary>
- /// Get the Server Information.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ServerInformation ServerInfo { get; }
- }
-}
-
/*
-* 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.
-*/
+ * 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;
-namespace Tizen.Multimedia.MediaController
+namespace Tizen.Multimedia.Remoting
{
-
/// <summary>
- /// ShuffleModeUpdated event arguments
+ /// Provides data for the <see cref="MediaController.ShuffleModeUpdated"/> event.
/// </summary>
- /// <remarks>
- /// ShuffleModeUpdated event arguments
- /// </remarks>
public class ShuffleModeUpdatedEventArgs : EventArgs
{
- internal ShuffleModeUpdatedEventArgs(string name, MediaControllerShuffleMode mode)
- {
- ServerName = name;
- ShuffleMode = mode;
- }
-
/// <summary>
- /// Get the Server Name.
+ /// Initializes a new instance of the <see cref="ShuffleModeUpdatedEventArgs"/> class.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public string ServerName { get; }
+ /// <param name="enabled">A value indicating whether the shuffle mode is enabled.</param>
+ public ShuffleModeUpdatedEventArgs(bool enabled)
+ {
+ Enabled = enabled;
+ }
/// <summary>
- /// Get the Shuffle Mode.
+ /// Gets a value indicating whether the shuffle mode is enabled.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public MediaControllerShuffleMode ShuffleMode { get; }
+ /// <value>true if the shuffle mode is enabled; otherwise, false.</value>
+ public bool Enabled { get; }
}
-}
-
+}
\ No newline at end of file