Type-specific mm-player event details.


#include <mmplayer/event.h>

union mmp_event_details {

	struct mmp_event_state {
		status_e   oldstatus;
		float      oldrate;
		repeat_e   oldrepeat;
		shuffle_e  oldshuffle;
	} state;

	struct mmp_event_trksession {
		trksession_event_e type;
		int        length;
		uint64_t   tsid;
	} trksession;

	struct mmp_event_error {
		ms_error_e type;
	} error;

	struct mmp_event_track {
		int        index;
		uint64_t   tsid;
		mmp_ms_node_t *media_node;
		mmp_ms_node_metadata_t *metadata;
	} track;

	struct mmp_event_trkpos {
		int        position;
	} trkpos; 

	struct mmp_event_mediasource {
		ms_event_e type;
		mmp_ms_t   *mediasource;
	} mediasource_info;
} details;


Used when mmp_event.type is MMP_EVENT_STATE.

The mmp_event_state structure has these members:

status_e oldstatus
The player's status before the event
float oldrate
The playback rate (speed) before the event
repeat_e oldrepeat
The player's repeat mode before the event
shuffle_e oldshuffle
The player's shuffle mode before the event
Used when mmp_event.type is MMP_EVENT_TRACKSESSION.

The mmp_event_trksession structure has these members:

trksession_event_e type
The tracksession event type
int length
The number of tracks within the tracksession
uint64_t tsid
The tracksession ID
Used when mmp_event.type is MMP_EVENT_ERROR.

The mmp_event_error structure has these members:

ms_error_e type
The severity level of the media source error
Used when mmp_event.type is MMP_EVENT_TRACK.

The mmp_event_track structure has these members:

int index
The track's position within the tracksession
uint64_t tsid
The ID of the associated tracksession
mmp_ms_node_t *media_node
A reference to the structure that describes the media node associated with the track
mmp_ms_node_metadata_t *metadata
A reference to the structure that stores the track's metadata
Used when mmp_event.type is MMP_EVENT_TRACKPOSITION.

The mmp_event_trkpos structure has these members:

int position
The track's new position in the tracksession
Used when mmp_event.type is MMP_EVENT_MEDIASOURCE.

The mmp_event_mediasource structure has these members:

ms_event_e type
The media source event type
mmp_ms_t *mediasource
A reference to the structure that describes the media source




Type-specific mm-player event details. Only one structure within the details field can be defined at a time. The structure that's defined depends on the event type. Applications must read the mmp_event.type field to learn the event type so they can properly parse the contents of the details field.