mme_button()

Respond to button events for navigable tracks

Synopsis:

#include <mme/mme.h>

int mme_button( mme_hdl_t *hdl,
                mm_button_t button );

Arguments:

hdl
An MME connection handle.
button
The “button” command to pass to the MME in the enumerated type mm_button_t.

Library:

mme

Description:

The function mme_button() passes button commands for navigable tracks from your client application to the MME. A navigable track is one of the following:

Using the mme_button() function with an iPod device

iPods 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.

Checking if a device can manage its own track sessions

To check is a device can manage its own track sessions, the client application can call mme_play_get_info() to get the data structure mme_play_info_t. If the support flag contains MME_PLAYSUPPORT_DEVICE_TRACKSESSION, the current device manages its own track sessions.

Using Repeat and Repeat AB modes

The MM_BUTTON_REPEAT_OFF and MM_BUTTON_REPEAT_AB_OFF values can be used together to add repeat functionality. For example, you can repeat the current title, then while repeating the title, mark A and mark B and repeat the AB range. You can then turn off the repeat AB mode, leaving the repeat title mode active; or, you can turn off the repeat title mode, leaving the repeat AB mode active.

mm_button_t

The enumerated type mm_button_t defines the button command to pass to the MME. It can be set to any of the values listed in the table below.

Note that button commands only work for devices with navigable tracks, as described above (iPod, DVD-V, Bluetooth), and that most devices only support a subset of the functionality listed in the table. Check the table to see which devices support which button values.

Value iPod Bluetooth DVD-V Action
MM_BUTTON_NEXT Y Y Y Skip to next track.
MM_BUTTON_PREV Y Y Y Skip to previous track.
MM_BUTTON_TOP N N Y Skip to first track.
MM_BUTTON_CURSOR_LEFT N N Y Move cursor left.
MM_BUTTON_CURSOR_RIGHT N N Y Move cursor right.
MM_BUTTON_CURSOR_UP N N Y Move cursor up.
MM_BUTTON_CURSOR_DOWN N N Y Move cursor down.
MM_BUTTON_ENTER N N Y Activate the currently highlighted item.
MM_BUTTON_RETURN N N Y Return to previous activity (i.e. playback). This button is equivalent to MM_BUTTON_RESUME
MM_BUTTON_GOUP N N Y See MM_BUTTON_GOUP below.
MM_BUTTON_MENU_TITLE N N Y Show title menu.
MM_BUTTON_MENU_ROOT N N Y Go to root menu.
MM_BUTTON_MENU_AUDIO N N Y Show audio properties menu.
MM_BUTTON_MENU_ANGLE N N Y Show video angle menu.
MM_BUTTON_MENU_SUBTITLE N N Y Show subtitle menu.
MM_BUTTON_MENU_PTT N N Y Show title or chapter menu.
MM_BUTTON_REPEAT_AB_OFF N N Y Turn repeat from point A to B off. See Using Repeat and Repeat AB modes below.
MM_BUTTON_REPEAT_AB_POINT_A N N Y Set repeat point A.
MM_BUTTON_REPEAT_AB_POINT_B N N Y Set repeat point B.
MM_BUTTON_REPEAT_OFF N N Y Turn repeat mode off.
MM_BUTTON_REPEAT_CHAPTER N N Y Repeat current chapter.
MM_BUTTON_REPEAT_TITLE N N Y Repeat current title.
MM_BUTTON_REPEAT_DISC N N Y Repeat current disc.
MM_BUTTON_RESUME N N Y Resume previous activity (i.e. playback).
MM_BUTTON_FRAME_ADVANCE N N Y Advance to next video frame.
MM_BUTTON_FRAME_REVERSE N N Y Move to previous video frame.
MM_BUTTON_PAUSE N Y Y Pause play.
MM_BUTTON_PLAY N Y Y Play.
MM_BUTTON_STOP N Y Y Stop play.
MM_BUTTON_0 to 99 N N Y Accept input from button n on a remote control.

Note: DVD, and video support is platform specific, and the current MME release supports DVD mediastores and video playback only with custom io-media modules. Similarly, Bluetooth support is scheduled for a future release, or custom implementations.

If MME API functions that support DVD mediastores and video playback are called on a system that does not have the required io-media modules, these functions return -1 and set errno to ENOSYS.

Please contact QNX to discuss your implementation requirements.


MM_BUTTON_GOUP

The behavior of MM_BUTTON_GOUP is determined by the author of the DVD. Typically, this button is used to jump to the start of the context the user is in. For example, if the user is playing a movie, this button jumps to the start of the movie; or, if the user is in a fourth level menu, this button jumps to the topmost menu.

Events

This function may return playback error events: MME_PLAY_ERROR_* andMME_EVENT_PLAY_ERROR.

Blocking and validation

This function verifies that the client application code is valid. It blocks on control contexts.

If mme_button() is called and another function is called before mme_button() returns, the second function blocks on io-media until mme_button() returns. If there are no other pending calls, mme_button() 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_play_get_info(), mme_play_info_t