Class PlaylistCommand
Definition
- Namespace:
- Tizen.Content.MediaContent
- Assembly:
- Tizen.Content.MediaContent.dll
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 |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException |
|
See Also
Methods
View SourceAddMember(int, string)
Adds the media to the playlist.
Declaration
public bool AddMember(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID that the media will be added to. |
string | mediaId | The media ID to add to the playlist. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
See Also
View SourceAddMembers(int, IEnumerable<string>)
Adds the media set to the playlist.
Declaration
public bool AddMembers(int playlistId, IEnumerable<string> mediaIds)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID that the media will be added to. |
System.Collections.Generic.IEnumerable<T><string> | mediaIds | The collection of media ID to add to the playlist. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
See Also
View SourceCount()
Retrieves the number of playlists.
Declaration
public int Count()
Returns
Type | Description |
---|---|
int | The number of playlists. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
See Also
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 |
---|---|
int | The number of playlists. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
See Also
View SourceCountMember(int, 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 |
---|---|---|
int | 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 |
---|---|
int | The number of media information. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
View SourceCountMember(int)
Retrieves the number of media information of the playlist.
Declaration
public int CountMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID to count media added to the playlist. |
Returns
Type | Description |
---|---|
int | The number of media information. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
View SourceDelete(int)
Deletes a playlist from the database.
Declaration
public bool Delete(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID to delete. |
Returns
Type | Description |
---|---|
bool | true if the matched record was found and deleted, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
View SourceExportToFile(int, string)
Exports the playlist to a M3U file.
Declaration
public void ExportToFile(int playlistId, string path)
Parameters
Type | Name | Description |
---|---|---|
int | 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 |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
RecordNotFoundException | No matching playlist exists. |
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
View SourceGetMemberId(int, string)
Retrieves the member ID of the media in the playlist.
Declaration
public int GetMemberId(int playlistId, string mediaId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
string | mediaId | The media ID. |
Returns
Type | Description |
---|---|
int | The member ID if the member was found in the playlist, otherwise -1. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
See Also
View SourceGetPlayOrder(int, int)
Retrieves the play order of the member.
Declaration
public int GetPlayOrder(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
int | memberId | The member ID of the playlist. |
Returns
Type | Description |
---|---|
int | The order of the member in the playlist. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
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 |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
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 |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
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 |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.IO.FileNotFoundException |
|
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
View SourceRemoveMember(int, int)
Removes a member from the playlist.
Declaration
public bool RemoveMember(int playlistId, int memberId)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
int | memberId | The member ID to be removed. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
View SourceRemoveMembers(int, IEnumerable<int>)
Removes a media set from the playlist.
Declaration
public bool RemoveMembers(int playlistId, IEnumerable<int> memberIds)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
System.Collections.Generic.IEnumerable<T><int> | memberIds | The collection of member ID to remove from to the playlist. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
See Also
View SourceSelect()
Retrieves the playlists.
Declaration
public MediaDataReader<Playlist> Select()
Returns
Type | Description |
---|---|
MediaDataReader<Playlist> | The MediaDataReader<TRecord> containing the results. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
See Also
View SourceSelect(int)
Retrieves the playlist with the specified playlist ID.
Declaration
public Playlist Select(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
int | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
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 |
---|---|
System.InvalidOperationException | The MediaDatabase is disconnected. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
See Also
View SourceSelectMember(int, SelectArguments)
Retrieves the media information of the playlist with the SelectArguments.
Declaration
public MediaDataReader<PlaylistMember> SelectMember(int playlistId, SelectArguments filter)
Parameters
Type | Name | Description |
---|---|---|
int | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
View SourceSelectMember(int)
Retrieves the media information of the playlist.
Declaration
public MediaDataReader<PlaylistMember> SelectMember(int playlistId)
Parameters
Type | Name | Description |
---|---|---|
int | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentOutOfRangeException |
|
See Also
View SourceUpdate(int, PlaylistUpdateValues)
Updates the playlist with the specified values.
Declaration
public bool Update(int playlistId, PlaylistUpdateValues values)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID to update. |
PlaylistUpdateValues | values | The values for the update. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
System.UnauthorizedAccessException | The caller has no required privilege. |
See Also
View SourceUpdatePlayOrder(int, PlayOrder)
Updates a play order of the playlist.
Declaration
public bool UpdatePlayOrder(int playlistId, PlayOrder playOrder)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
PlayOrder | playOrder | The PlayOrder to apply. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
See Also
View SourceUpdatePlayOrders(int, IEnumerable<PlayOrder>)
Updates play orders of the playlist.
Declaration
public bool UpdatePlayOrders(int playlistId, IEnumerable<PlayOrder> orders)
Parameters
Type | Name | Description |
---|---|---|
int | playlistId | The playlist ID. |
System.Collections.Generic.IEnumerable<T><PlayOrder> | orders | The collection of the PlayOrder to apply. |
Returns
Type | Description |
---|---|
bool | 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. |
System.ObjectDisposedException | The MediaDatabase has already been disposed of. |
MediaDatabaseException | An error occurred while executing the command. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|