mm_player_create_trksession()

Create a tracksession from a media node.

Synopsis:

#include <mmplayer/mmplayerclient.h>

int mm_player_create_trksession( mmplayer_hdl_t *hdl, 
                                 const int media_source_id, 
                                 const char *media_node_id, 
                                 int *limit, 
                                 const int index, 
                                 uint64_t *tsid )

Arguments:

hdl
The mm-player connection handle
media_source_id
The ID of the media source the base media node is stored on
media_node_id
The ID of the base media node
limit
On input, the maximum number of items to place in the tracksession. On output, the number of items actually placed in the tracksession (if the function succeeded).
index
The index of the tracksession item to be set as the current track
tsid
Currently, this is set to 0 because it's reserved for future use

Library:

mmplayerclient

Description:

Create a tracksession filled with tracks found within a "base" media node, which is identified by media_node_id. The media node must be located on the media source identified by media_source_id.

The items put into the new tracksession depend on the type of the base node. If it's a leaf node (i.e., an audio track, video, or photo), the tracksession contains only that media file. If it's a folder node, the tracksession contains its children (which can be media files or subfolders) up to the number of directory levels specified in the recursion_depth setting (for details, see "Configuration file"). For instance, suppose recursion_depth is 1; in this case, the tracksession contains the media files from the base node folder but none of its subfolders or their media files. If this setting is -1, there's no limit to the directory depths of the items included in the tracksession.

You can define limit to restrict how many tracks get placed in the tracksession as well as index to set the current track (i.e., the track to be played first). For example, suppose you specify an index of 5. The track at position 5 in the children of the base node then becomes the current track. Note that these two parameters apply only when the base node is a folder.

Returns:

0 on success, -1 on failure