Shuffle and unshuffle

Just after creating a playlist, it is unshuffled, so if you begin playing it in a renderer, the playing order will be the one defined when inserting the elements in the playlist.

If you want to play the playlist in a random order, you need to shuffle it with mafw_playlist_shuffle. After calling that you can traverse through the playlist, from the first to the last item in playing order. To get the first item's index and object id, call the mafw_playlist_get_starting_index. To get the next or previous item, you can use mafw_playlist_get_next and mafw_playlist_get_prev.

From MafwPlaylist you cannot really know which element is being played because this issue is related to MafwRenderer. The "media-changed" signal is emitted when a the selected item in the playlist assigned to a particular renderer changes. The application developer can also query the currently selected entry in the renderer's playlist using the method mafw_renderer_get_status (see Mafw API reference for details). The signal handler for the media-changed signal looks like this:

static void 
media_changed_cb(MafwRenderer *renderer, 
		 gint index, 
		 gchar *object_id,
		 gpointer user_data)
{
    /* Probably, mark new selected item in the UI */
}