![]() |
![]() |
![]() |
![]() |
Sets the random playback mode for a control context
#include <mme/mme.h> int mme_setrandom( mme_hdl_t *hdl, int mode );
mme
The function mme_setrandom() sets the random playback mode for a control context. Tracks are played in pseudo-random order (using the QDB random() function), and won't be repeated until all the tracks in the track session have already been played.
You can clear a track session by:
![]() |
A random or repeat mode setting only works if the external device supports the setting. If the external device doesn't support the requested setting, the MME logs a warning and continues playback. |
![]() |
A call to mme_settrksession() or mme_set_msid_resume_trksession() regenerates the pseudo-random list the MME uses for random mode playback. |
The following describes how the MME plays through a track session when it switches between random and sequential modes, assuming that repeat mode is off.
When the MME switches the track session from sequential to random mode it:
When the MME switches the track session from random to sequential mode it:
If the client application calls mme_setrandom() when the track session is already in random mode, the MME clears all random history and:
For information about how the MME counts tracks played, see mme_trksession_get_info().
![]() |
The client application should always call the function mme_trksession_get_info() immediately after switching between random and sequential modes. Changing the random mode resets the value of current_trk, and if the client application doesn't update this information with mme_trksession_get_info() the client application can't know where it is in the track session. |
MME_EVENT_RANDOMCHANGE when the function has completed work.
This function blocks on control contexts. If mme_setrandom() is called and another function is called before mme_setrandom() returns, the second function blocks on io-media until mme_setrandom() returns. If there are no other pending calls, mme_setrandom() returns without blocking on io-media.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
mme_getrandom(), mme_getrepeat(), mme_getscanmode() mme_setrepeat(), mmme_mode_random_t, mmme_mode_repeat_t
![]() |
![]() |
![]() |
![]() |