Create a tracksession from a media node.


#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 )


The mm-player connection handle
The ID of the media source the base media node is stored on
The ID of the base media node
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).
The index of the tracksession item to be set as the current track
Currently, this is set to 0 because it's reserved for future use




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.


0 on success, -1 on failure