Class PlaylistCommand
Definition
- Namespace:
- Tizen.Content.MediaContent
- Assembly:
- Tizen.Content.MediaContent.dll
- API Level:
- 4
Provides the commands to manage playlists in the database.
public class PlaylistCommand : MediaCommand
- Inheritance
Constructors
View SourcePlaylistCommand(MediaDatabase)
Initializes a new instance of the PlaylistCommand class with the specified MediaDatabase.
Declaration
public PlaylistCommand(MediaDatabase database)
Parameters
Type | Name | Description |
---|---|---|
MediaDatabase | database | A MediaDatabase that the commands run on. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ObjectDisposedException |
|
API Level: 4
Methods
View SourceAddMember(Int32, String)
Adds the media to the playlist.
Declaration
public bool AddMember(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID that the media will be added to. |
String | mediaId | The media ID to add to the playlist. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid media ID will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|
API Level: 4
View SourceAddMembers(Int32, IEnumerable<String>)
Adds the media set to the playlist.
Declaration
public bool AddMembers(int playlistId, IEnumerable<string> mediaIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID that the media will be added to. |
IEnumerable<String> | mediaIds | The collection of media ID to add to the playlist. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid media IDs will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|
API Level: 4
View SourceCount()
Retrieves the number of playlists.
Declaration
public int Count()
Returns
Type | Description |
---|---|
Int32 | The number of playlists. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
View SourceCount(CountArguments)
Retrieves the number of playlists with the CountArguments.
Declaration
public int Count(CountArguments arguments)
Parameters
Type | Name | Description |
---|---|---|
CountArguments | arguments | The criteria to use to filter. This value can be null. |
Returns
Type | Description |
---|---|
Int32 | The number of playlists. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
View SourceCountMember(Int32)
Retrieves the number of media information of the playlist.
Declaration
public int CountMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID to count media added to the playlist. |
Returns
Type | Description |
---|---|
Int32 | The number of media information. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceCountMember(Int32, CountArguments)
Retrieves the number of media information of the playlist with the CountArguments.
Declaration
public int CountMember(int playlistId, CountArguments arguments)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
Int32 | The number of media information. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceDelete(Int32)
Deletes a playlist from the database.
Declaration
public bool Delete(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID to delete. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and deleted, otherwise false. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View SourceExportToFile(Int32, String)
Exports the playlist to a M3U file.
Declaration
public void ExportToFile(int playlistId, string path)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID to export. |
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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
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
View SourceGetMemberId(Int32, String)
Retrieves the member ID of the media in the playlist.
Declaration
public int GetMemberId(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
String | mediaId | The media ID. |
Returns
Type | Description |
---|---|
Int32 | The member ID if the member was found in the playlist, otherwise -1. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
ArgumentException |
|
API Level: 4
View SourceGetPlayOrder(Int32, Int32)
Retrieves the play order of the member.
Declaration
public int GetPlayOrder(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
Int32 | memberId | The member ID of the playlist. |
Returns
Type | Description |
---|---|
Int32 | The order of the member in the playlist. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceInsert(String)
Inserts the playlist into the database with the specified name.
Declaration
public Playlist Insert(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the playlist. |
Returns
Type | Description |
---|---|
Playlist | The Playlist instance that contains the record information inserted. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View SourceInsert(String, String)
Inserts the playlist into the database with the specified name and the thumbnail path.
Declaration
public Playlist Insert(string name, string thumbnailPath)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the playlist. |
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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View SourceInsertFromFile(String, String)
Inserts the playlist into the database from the specified M3U file.
Declaration
public Playlist InsertFromFile(string name, string path)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the playlist. |
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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
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
View SourceRemoveMember(Int32, Int32)
Removes a member from the playlist.
Declaration
public bool RemoveMember(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
Int32 | memberId | The member ID to be removed. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid ID will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceRemoveMembers(Int32, IEnumerable<Int32>)
Removes a media set from the playlist.
Declaration
public bool RemoveMembers(int playlistId, IEnumerable<int> memberIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
IEnumerable<Int32> | memberIds | The collection of member ID to remove from to the playlist. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The invalid IDs will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|
API Level: 4
View SourceSelect()
Retrieves the playlists.
Declaration
public MediaDataReader<Playlist> Select()
Returns
Type | Description |
---|---|
MediaDataReader<Playlist> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
View SourceSelect(Int32)
Retrieves the playlist with the specified playlist ID.
Declaration
public Playlist Select(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceSelect(SelectArguments)
Retrieves the playlists with the SelectArguments.
Declaration
public 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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
API Level: 4
View SourceSelectMember(Int32)
Retrieves the media information of the playlist.
Declaration
public MediaDataReader<PlaylistMember> SelectMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID to query with. |
Returns
Type | Description |
---|---|
MediaDataReader<PlaylistMember> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceSelectMember(Int32, SelectArguments)
Retrieves the media information of the playlist with the SelectArguments.
Declaration
public MediaDataReader<PlaylistMember> SelectMember(int playlistId, SelectArguments filter)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentOutOfRangeException |
|
API Level: 4
View SourceUpdate(Int32, PlaylistUpdateValues)
Updates the playlist with the specified values.
Declaration
public bool Update(int playlistId, PlaylistUpdateValues values)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID to update. |
PlaylistUpdateValues | values | The values for the update. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
Only values set in the PlaylistUpdateValues are updated.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
UnauthorizedAccessException | The caller has no required privilege. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View SourceUpdatePlayOrder(Int32, PlayOrder)
Updates a play order of the playlist.
Declaration
public bool UpdatePlayOrder(int playlistId, PlayOrder playOrder)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
PlayOrder | playOrder | The PlayOrder to apply. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The MemberId that is invalid will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
API Level: 4
View SourceUpdatePlayOrders(Int32, IEnumerable<PlayOrder>)
Updates play orders of the playlist.
Declaration
public bool UpdatePlayOrders(int playlistId, IEnumerable<PlayOrder> orders)
Parameters
Type | Name | Description |
---|---|---|
Int32 | playlistId | The playlist ID. |
IEnumerable<PlayOrder> | orders | The collection of the PlayOrder to apply. |
Returns
Type | Description |
---|---|
Boolean | true if the matched record was found and updated, otherwise false. |
Remarks
The MemberId that is invalid will be ignored.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The MediaDatabase is disconnected. |
ObjectDisposedException | The MediaDatabase has already been disposed. |
MediaDatabaseException | An error occurred while executing the command. |
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|