Tizen Native API
5.0
|
The Media Controller Playlist API provides functions for playlist of the media.
#include <media_controller_playlist.h>
The Media Controller Playlist API allows you to get playlist name and its items (mc_playlist_get_name() and mc_playlist_foreach_item()).
You can copy the playlist by using mc_playlist_clone(). And if you don't use handle anymore, you have to destroy it(mc_playlist_destroy()).
Functions | |
int | mc_playlist_get_name (mc_playlist_h playlist, char **playlist_name) |
Gets the name of the playlist. | |
int | mc_playlist_foreach_item (mc_playlist_h playlist, mc_playlist_item_cb callback, void *user_data) |
Iterates through media items in a playlist. | |
int | mc_playlist_clone (mc_playlist_h src, mc_playlist_h *dst) |
Clones a media controller playlist handle. | |
int | mc_playlist_destroy (mc_playlist_h playlist) |
Destroys a media controller playlist handle. | |
Typedefs | |
typedef bool(* | mc_playlist_cb )(mc_playlist_h playlist, void *user_data) |
Called for every playlist. | |
typedef bool(* | mc_playlist_item_cb )(const char *index, mc_metadata_h metadata, void *user_data) |
Called for every playlist item in the playlist. |
typedef bool(* mc_playlist_cb)(mc_playlist_h playlist, void *user_data) |
Called for every playlist.
[in] | playlist | The handle to the media controller playlist. |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the looptypedef bool(* mc_playlist_item_cb)(const char *index, mc_metadata_h metadata, void *user_data) |
Called for every playlist item in the playlist.
[in] | index | The ID of the playlist member. |
[in] | metadata | The handle to metadata of the playlist item. |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loopint mc_playlist_clone | ( | mc_playlist_h | src, |
mc_playlist_h * | dst | ||
) |
Clones a media controller playlist handle.
This function copies the media controller playlist handle from a source to destination. The mc_playlist_h is created internally and available through media controller playlist functions.
[in] | src | The source handle to the media controller playlist |
[out] | dst | The destination handle to the media controller playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
int mc_playlist_destroy | ( | mc_playlist_h | playlist | ) |
Destroys a media controller playlist handle.
This function frees all resources related to the media controller playlist handle. This handle no longer can be used to perform any operations. A new handle has to be created before next usage.
[in] | playlist | The handle to the media controller playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
int mc_playlist_foreach_item | ( | mc_playlist_h | playlist, |
mc_playlist_item_cb | callback, | ||
void * | user_data | ||
) |
Iterates through media items in a playlist.
This function gets all items in a playlist. The callback function will be invoked for every retrieved playlist item. If there are no items on the playlist, the callback will not be invoked.
[in] | playlist | The handle to the media controller playlist |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
int mc_playlist_get_name | ( | mc_playlist_h | playlist, |
char ** | playlist_name | ||
) |
Gets the name of the playlist.
[in] | playlist | The handle to the media controller playlist |
[out] | playlist_name | The name of the playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |