mme_play()

Play a track session

Synopsis:

#include <mme/mme.h>

int mme_play( mme_hdl_t *hdl,
              uint64_t fid );

Arguments:

hdl
An MME connection handle.
fid
The file ID of the file or track you want to play. Pass as 0 to start playback at the first track in the track session.

Library:

mme

Description:

The function mme_play() plays tracks in a track session. This function can only be used after the client application has called mme_newtrksession() to create a track session, and mme_settrksession() to set the track session.

If you specify the fid in a library-based track-session, the MME starts playback with the specified fid. If the library-based track session contains more than one instance of the specified fid, the MME starts playback at the first instance of this fid.

The MME control context notifies the client application at set intervals while it is playing a track session by delivering the event MME_EVENT_TIME. You can change this period through the function mme_set_notification_interval().


Note:
  • If you need the file ID (fid) of the track being played, your client application can do one of the following:
    • wait for the MME_EVENT_TRACKCHANGE event, delivered when the track session starts playing a new track. This event contains the fid
    • call the function mme_play_get_info() and get the fid from mme_play_info_t.fid
  • If you call mme_play() while a track is playing, the MME will drop the current track and start playing the new track.
  • If mme_play() is unable to play a track in a track session it generates an MME_PLAY_ERROR_* event, then attempts to play the next track in the track session.
  • If you attempt to play a file ID (fid) that is not in your track session, the MME will play the first track in the track session. This behavior is specific to MME 1.1.0; in subsequent releases, mme_play() will return an error.

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 does not verify that the fid is in the track session. If the connection to the MME is synchronous, the function validates that the file exists and that it is playable.

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

Returns:

0
Success.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

mme_newtrksession(), mme_next(), mme_prev(), mme_stop()