mme_setautopause()

Set the autopause mode for a control context

Synopsis:

#include <mme/mme.h>

int mme_setautopause( mme_hdl_t *hdl,
                      bool enable );

Arguments:

hdl
An MME connection handle.
enable
The autopause setting. Pass as true to turn on autopause mode, and false to turn it off.

Library:

mme

Description:

The function mme_setautopause() sets the autopause mode for a control context. Changing the autopause mode for a control context doesn't affect a currently playing track. The change comes into effect for the next track played. By default, autopause mode is off.

The ability to set a control context's default behavior to start tracks in the paused state is particularly useful if you need to perform additional audio processing outside the MME before playing tracks, or if the system needs to change mediastores during playback of a tracksession.

Playback behavior when autopause mode is on

When autopause is turned on, tracks start playback in the paused state. When a track is started in the paused state, the MME delivers a MME_EVENT_PLAYAUTOPAUSED event, and you need to explicitly resume paused tracks with a call to mme_play_set_speed() with speed set to 1000.

This behavior affects all calls that initiate playback of a track, including:

Autopause with devices that control their own track sessions

Do not set autopause for control contexts with devices, such as iPods and Bluetooth phones, that control their own playback. If you set autopause for control contexts with these devices attached:

Autopause with playback pre-queuing

Autopause will not take effect if all the following conditions are true:

See also Playback pre-queuing in the chapter Configuring Playback of the MME Configuration Guide.

Events

This function delivers the event MME_EVENT_AUTOPAUSECHANGED, if it has changed the autopause state for the control context (for example, from “on” to “off”, or from “off” to “on”). If mme_setautopause() doesn't change the autopause state for the control context, it doesn't deliver an event (for example, if the state was “on” and was set to “on”, or the state was “off” and was set to “off”).

Blocking and validation

This function blocks on control contexts.

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_getautopause(), mme_next(), mme_play(), mme_prev()