mme_prev()

Skip to the previous track

Synopsis:

#include <mme/mme.h>

int mme_prev( mme_hdl_t *hdl );

Arguments:

hdl
The MME handle for the control context playing the track session on which you want to skip to the previous track.

Library:

mme

Description:

The function mme_prev() skips to the previous title in the currently playing track session. The previously played track is obtained from the trksessionview table.

Effect of play modes on behavior

The behavior of mme_prev() is affected by the play modes set for the specified control context (sequential versus random, and repeat versus no repeat).

If sequential mode is set, the file ID of the previous track in the track session is in the previous row in the sequentialid column of the trksessionview table. If random mode is set, the file ID of the previous track in the track session is in the randomid column of the trksessionview table.

Effect of repeat mode on the first track of a session

When the first track in the track session is playing, the result of calling mme_prev() depends on whether the repeat mode is set.

If repeat mode is off, when it has reached the beginning of the track session (or, when random mode is set, when all songs in the track session have been played), mme_next() sets errno to ENODATA .

If repeat mode is on:

Working with an iPod device

iPod devices manage their own track sessions. To move to the next or previous track in an iPod track session, call the mme_button() function with mm_button_t set to MM_BUTTON_NEXT or MM_BUTTON_PREV, as required.

Events

This function may deliver any event of the class MME_EVENT_CLASS_PLAY, and any MME_PLAY_ERROR_* event.

Blocking and validation

This function verifies that the fid is valid. Does not verify that the file exists, or that it is playable.

This function blocks on control contexts. If mme_prev() is called and another function is called before mme_prev() returns, the second function blocks on io-media until mme_prev() returns. If there are no other pending calls, mme_prev() returns without blocking on io-media.

Returns:

0
Success: errno set to ENODATA indicates that there are no more tracks to play.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

mme_next(), mme_setrandom(), mme_setrepeat()