Class PlaylistCommand
Definition
- Namespace:
- Tizen.Content.MediaContent
- Assembly:
- Tizen.Content.MediaContent.dll
- API Level:
- 4
Provides the commands to manage playlists in the database.
C#Copypublic class PlaylistCommand : MediaCommand
- Inheritance
Constructors
PlaylistCommand(MediaDatabase)
Initializes a new instance of the PlaylistCommand class with the specified MediaDatabase.
Declaration
C#Copypublic PlaylistCommand(MediaDatabase database)
Parameters
Type | Name | Description |
---|---|---|
MediaDatabase | database | A MediaDatabase that the commands run on. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ObjectDisposedException |
|
API Level: 4
Methods
Declaration
C#Copypublic bool AddMember(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID that the media will be added to. |
System.String | mediaId | The media ID to add to the playlist. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid media ID will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic bool AddMembers(int playlistId, IEnumerable<string> mediaIds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID that the media will be added to. |
System.Collections.Generic.IEnumerable<System.String> | mediaIds | The collection of media ID to add to the playlist. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid media IDs will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic int Count()
Returns
Type | Description |
---|---|
System.Int32 | The number of playlists. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
Declaration
C#Copypublic int Count(CountArguments arguments)
Parameters
Type | Name | Description |
---|---|---|
CountArguments | arguments | The criteria to use to filter. This value can be null. |
Returns
Type | Description |
---|---|
System.Int32 | The number of playlists. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
Declaration
C#Copypublic int CountMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to count media added to the playlist. |
Returns
Type | Description |
---|---|
System.Int32 | The number of media information. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
CountMember(Int32, CountArguments)
Retrieves the number of media information of the playlist with the CountArguments.
Declaration
C#Copypublic int CountMember(int playlistId, CountArguments arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to count the media added to the playlist. |
CountArguments | arguments | The criteria to use to filter. This value can be null. |
Returns
Type | Description |
---|---|
System.Int32 | The number of media information. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic bool Delete(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to delete. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and deleted, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
Declaration
C#Copypublic void ExportToFile(int playlistId, string path)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to export. |
System.String | path | The path to a M3U file. |
Remarks
If the file already exists in the file system, then it will be overwritten.
If you want to access an internal storage, you should add privilege http://tizen.org/privilege/mediastorage.
If you want to access an external storage, you should add privilege http://tizen.org/privilege/externalstorage.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
RecordNotFoundException | No matching playlist exists. |
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/mediastoragehttp://tizen.org/privilege/externalstorage
Declaration
C#Copypublic int GetMemberId(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
System.String | mediaId | The media ID. |
Returns
Type | Description |
---|---|
System.Int32 | The member ID if the member was found in the playlist, otherwise -1. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
API Level: 4
Declaration
C#Copypublic int GetPlayOrder(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
System.Int32 | memberId | The member ID of the playlist. |
Returns
Type | Description |
---|---|
System.Int32 | The order of the member in the playlist. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic Playlist Insert(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the playlist. |
Returns
Type | Description |
---|---|
Playlist | The Playlist instance that contains the record information inserted. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
Insert(String, String)
Inserts the playlist into the database with the specified name and the thumbnail path.
Declaration
C#Copypublic Playlist Insert(string name, string thumbnailPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the playlist. |
System.String | thumbnailPath | The path of the thumbnail for the playlist. This value can be null. |
Returns
Type | Description |
---|---|
Playlist | The Playlist instance that contains the record information inserted. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
InsertFromFile(String, String)
Inserts the playlist into the database from the specified M3U file.
Declaration
C#Copypublic Playlist InsertFromFile(string name, string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the playlist. |
System.String | path | The path to a M3U file to import. |
Returns
Type | Description |
---|---|
Playlist | The Playlist instance that contains the record information inserted. |
Remarks
If you want to access an internal storage, you should add privilege http://tizen.org/privilege/mediastorage.
If you want to access an external storage, you should add privilege http://tizen.org/privilege/externalstorage.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.IO.FileNotFoundException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.writehttp://tizen.org/privilege/mediastoragehttp://tizen.org/privilege/externalstorage
Declaration
C#Copypublic bool RemoveMember(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
System.Int32 | memberId | The member ID to be removed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid ID will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic bool RemoveMembers(int playlistId, IEnumerable<int> memberIds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
System.Collections.Generic.IEnumerable<System.Int32> | memberIds | The collection of member ID to remove from to the playlist. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid IDs will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic MediaDataReader<Playlist> Select()
Returns
Type | Description |
---|---|
MediaDataReader<Playlist> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
Declaration
C#Copypublic Playlist Select(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to select. |
Returns
Type | Description |
---|---|
Playlist | The Playlist instance if the matched record was found in the database, otherwise null. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic MediaDataReader<Playlist> Select(SelectArguments filter)
Parameters
Type | Name | Description |
---|---|---|
SelectArguments | filter | The criteria to use to filter. This value can be null. |
Returns
Type | Description |
---|---|
MediaDataReader<Playlist> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
Declaration
C#Copypublic MediaDataReader<PlaylistMember> SelectMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to query with. |
Returns
Type | Description |
---|---|
MediaDataReader<PlaylistMember> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
SelectMember(Int32, SelectArguments)
Retrieves the media information of the playlist with the SelectArguments.
Declaration
C#Copypublic MediaDataReader<PlaylistMember> SelectMember(int playlistId, SelectArguments filter)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to query with. |
SelectArguments | filter | The criteria to use to filter. This value can be null. |
Returns
Type | Description |
---|---|
MediaDataReader<PlaylistMember> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic bool Update(int playlistId, PlaylistUpdateValues values)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID to update. |
PlaylistUpdateValues | values | The values for the update. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
Only values set in the PlaylistUpdateValues are updated.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
Declaration
C#Copypublic bool UpdatePlayOrder(int playlistId, PlayOrder playOrder)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
PlayOrder | playOrder | The PlayOrder to apply. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The MemberId that is invalid will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
API Level: 4
Declaration
C#Copypublic bool UpdatePlayOrders(int playlistId, IEnumerable<PlayOrder> orders)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playlistId | The playlist ID. |
System.Collections.Generic.IEnumerable<PlayOrder> | orders | The collection of the PlayOrder to apply. |
Returns
Type | Description |
---|---|
System.Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The MemberId that is invalid will be ignored.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|