mmp_event_get()

Get the next available event.

Synopsis:

#include <mmplayer/event.h>
 
const mmp_event_t* mmp_event_get( mmplayer_hdl_t *hdl )

Arguments:

hdl
A player handle

Library:

mmplayerclient

Description:

Get the next available event. This function returns an mmp_event_t structure populated with the event details. Typically, you would call this function within an event-processing loop, after calling mmp_event_wait().

The data in the returned structure is valid only until the next mmp_event_get() call. If you want to keep the data longer, copy the mmp_event_t contents into other program variables, cloning any strm_string_t fields within the structure.

Note: If an event occurs, causing mmp_event_wait() to return, but the event's data gets deleted by mm-player before you call mmp_event_get(), the latter function will return the MMP_EVENT_NONE event. This event does not signify an error but instead that the previous event is no longer available. Applications must gracefully handle the MMP_EVENT_NONE event, preferrably by ignoring it.

Returns:

A pointer to an event, or NULL on error