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#
Copy
public class PlaylistCommand : MediaCommand
Inheritance
PlaylistCommand

Constructors

View Source

PlaylistCommand(MediaDatabase)

Initializes a new instance of the PlaylistCommand class with the specified MediaDatabase.

Declaration
C#
Copy
public PlaylistCommand(MediaDatabase database)
Parameters
Type Name Description
MediaDatabase database

A MediaDatabase that the commands run on.

Exceptions
Type Condition
ArgumentNullException

database is null.

ObjectDisposedException

database has already been disposed of.

API Level: 4

Methods

View Source

AddMember(Int32, String)

Adds the media to the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaId is null.

System.ArgumentException

mediaId is a zero-length string, contains only white space.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

AddMembers(Int32, IEnumerable<String>)

Adds the media set to the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaIds is null.

System.ArgumentException

mediaIds has no element.
-or-
mediaIds contains null value.
-or-
mediaIds contains a zero-length string or white space.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

Count()

Retrieves the number of playlists.

Declaration
C#
Copy
public int Count()
Returns
Type Description
System.Int32

The number of playlists.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

Count(CountArguments)

Retrieves the number of playlists with the CountArguments.

Declaration
C#
Copy
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
System.Int32

The number of playlists.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

CountMember(Int32)

Retrieves the number of media information of the playlist.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

CountMember(Int32, CountArguments)

Retrieves the number of media information of the playlist with the CountArguments.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

Delete(Int32)

Deletes a playlist from the database.

Declaration
C#
Copy
public bool Delete(int playlistId)
Parameters
Type Name Description
System.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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

ExportToFile(Int32, String)

Exports the playlist to a M3U file.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

path is null.

System.ArgumentException

path is a zero-length string, contains only white space.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

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 Source

GetMemberId(Int32, String)

Retrieves the member ID of the media in the playlist.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

ArgumentNullException

mediaId is null.

System.ArgumentException

mediaId is a zero-length string, contains only white space.

API Level: 4
View Source

GetPlayOrder(Int32, Int32)

Retrieves the play order of the member.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.
-or-
memberId is less than or equal to zero.

API Level: 4
View Source

Insert(String)

Inserts the playlist into the database with the specified name.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

name is null.

System.ArgumentException

name is a zero-length string.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

Insert(String, String)

Inserts the playlist into the database with the specified name and the thumbnail path.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

name is null.

System.ArgumentException

name is a zero-length string.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

InsertFromFile(String, String)

Inserts the playlist into the database from the specified M3U file.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

name is null.
-or-
path is null.

System.ArgumentException

name is a zero-length string.
-or-
path is a zero-length string, contains only white space.

System.IO.FileNotFoundException

path does not exists.

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 Source

RemoveMember(Int32, Int32)

Removes a member from the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.
-or-
memberId is less than or equal to zero.

API Level: 4
View Source

RemoveMembers(Int32, IEnumerable<Int32>)

Removes a media set from the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

memberIds is null.

System.ArgumentException

memberIds has no element.
-or-
memberIds contains a value which is less than or equal to zero.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

Select()

Retrieves the playlists.

Declaration
C#
Copy
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 of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

Select(Int32)

Retrieves the playlist with the specified playlist ID.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

Select(SelectArguments)

Retrieves the playlists with the SelectArguments.

Declaration
C#
Copy
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 of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

SelectMember(Int32)

Retrieves the media information of the playlist.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

SelectMember(Int32, SelectArguments)

Retrieves the media information of the playlist with the SelectArguments.

Declaration
C#
Copy
public 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
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

Update(Int32, PlaylistUpdateValues)

Updates the playlist with the specified values.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

values is null.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

UpdatePlayOrder(Int32, PlayOrder)

Updates a play order of the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

playOrder is null.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4
View Source

UpdatePlayOrders(Int32, IEnumerable<PlayOrder>)

Updates play orders of the playlist.

Declaration
C#
Copy
public 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
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 of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

orders is null.

System.ArgumentException

orders has no element.
-or-
orders contains a null value.

ArgumentOutOfRangeException

playlistId is less than or equal to zero.

API Level: 4

See Also