VLC  2.2.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
LibVLC asynchronous events
LibVLC core

LibVLC emits asynchronous events. More...

Collaboration diagram for LibVLC asynchronous events:

Typedefs

typedef struct
libvlc_event_manager_t 
libvlc_event_manager_t
 Event manager that belongs to a libvlc object, and from whom events can be received.
typedef int libvlc_event_type_t
 Type of a LibVLC event.
typedef void(* libvlc_callback_t )(const struct libvlc_event_t *, void *)
 Callback function notification.

Functions

int libvlc_event_attach (libvlc_event_manager_t *p_event_manager, libvlc_event_type_t i_event_type, libvlc_callback_t f_callback, void *user_data)
 Register for an event notification.
void libvlc_event_detach (libvlc_event_manager_t *p_event_manager, libvlc_event_type_t i_event_type, libvlc_callback_t f_callback, void *p_user_data)
 Unregister an event notification.
const char * libvlc_event_type_name (libvlc_event_type_t event_type)
 Get an event's type name.
enum  libvlc_event_e {
  libvlc_MediaMetaChanged = 0, libvlc_MediaSubItemAdded, libvlc_MediaDurationChanged, libvlc_MediaParsedChanged,
  libvlc_MediaFreed, libvlc_MediaStateChanged, libvlc_MediaSubItemTreeAdded, libvlc_MediaPlayerMediaChanged = 0x100,
  libvlc_MediaPlayerNothingSpecial, libvlc_MediaPlayerOpening, libvlc_MediaPlayerBuffering, libvlc_MediaPlayerPlaying,
  libvlc_MediaPlayerPaused, libvlc_MediaPlayerStopped, libvlc_MediaPlayerForward, libvlc_MediaPlayerBackward,
  libvlc_MediaPlayerEndReached, libvlc_MediaPlayerEncounteredError, libvlc_MediaPlayerTimeChanged, libvlc_MediaPlayerPositionChanged,
  libvlc_MediaPlayerSeekableChanged, libvlc_MediaPlayerPausableChanged, libvlc_MediaPlayerTitleChanged, libvlc_MediaPlayerSnapshotTaken,
  libvlc_MediaPlayerLengthChanged, libvlc_MediaPlayerVout, libvlc_MediaPlayerScrambledChanged, libvlc_MediaListItemAdded = 0x200,
  libvlc_MediaListWillAddItem, libvlc_MediaListItemDeleted, libvlc_MediaListWillDeleteItem, libvlc_MediaListViewItemAdded = 0x300,
  libvlc_MediaListViewWillAddItem, libvlc_MediaListViewItemDeleted, libvlc_MediaListViewWillDeleteItem, libvlc_MediaListPlayerPlayed = 0x400,
  libvlc_MediaListPlayerNextItemSet, libvlc_MediaListPlayerStopped, libvlc_MediaDiscovererStarted = 0x500, libvlc_MediaDiscovererEnded,
  libvlc_VlmMediaAdded = 0x600, libvlc_VlmMediaRemoved, libvlc_VlmMediaChanged, libvlc_VlmMediaInstanceStarted,
  libvlc_VlmMediaInstanceStopped, libvlc_VlmMediaInstanceStatusInit, libvlc_VlmMediaInstanceStatusOpening, libvlc_VlmMediaInstanceStatusPlaying,
  libvlc_VlmMediaInstanceStatusPause, libvlc_VlmMediaInstanceStatusEnd, libvlc_VlmMediaInstanceStatusError
}
 Event types. More...
typedef struct libvlc_event_t libvlc_event_t
 A LibVLC event.

Detailed Description

LibVLC emits asynchronous events.

Several LibVLC objects (such libvlc_instance_t as libvlc_media_player_t) generate events asynchronously. Each of them provides libvlc_event_manager_t event manager. You can subscribe to events with libvlc_event_attach() and unsubscribe with libvlc_event_detach().

Typedef Documentation

typedef void( * libvlc_callback_t)(const struct libvlc_event_t *, void *)

Callback function notification.

Parameters
p_eventthe event triggering the callback

Event manager that belongs to a libvlc object, and from whom events can be received.

A LibVLC event.

typedef int libvlc_event_type_t

Type of a LibVLC event.

Enumeration Type Documentation

Event types.

Enumerator:
libvlc_MediaMetaChanged 
libvlc_MediaSubItemAdded 
libvlc_MediaDurationChanged 
libvlc_MediaParsedChanged 
libvlc_MediaFreed 
libvlc_MediaStateChanged 
libvlc_MediaSubItemTreeAdded 
libvlc_MediaPlayerMediaChanged 
libvlc_MediaPlayerNothingSpecial 
libvlc_MediaPlayerOpening 
libvlc_MediaPlayerBuffering 
libvlc_MediaPlayerPlaying 
libvlc_MediaPlayerPaused 
libvlc_MediaPlayerStopped 
libvlc_MediaPlayerForward 
libvlc_MediaPlayerBackward 
libvlc_MediaPlayerEndReached 
libvlc_MediaPlayerEncounteredError 
libvlc_MediaPlayerTimeChanged 
libvlc_MediaPlayerPositionChanged 
libvlc_MediaPlayerSeekableChanged 
libvlc_MediaPlayerPausableChanged 
libvlc_MediaPlayerTitleChanged 
libvlc_MediaPlayerSnapshotTaken 
libvlc_MediaPlayerLengthChanged 
libvlc_MediaPlayerVout 
libvlc_MediaPlayerScrambledChanged 
libvlc_MediaListItemAdded 
libvlc_MediaListWillAddItem 
libvlc_MediaListItemDeleted 
libvlc_MediaListWillDeleteItem 
libvlc_MediaListViewItemAdded 
libvlc_MediaListViewWillAddItem 
libvlc_MediaListViewItemDeleted 
libvlc_MediaListViewWillDeleteItem 
libvlc_MediaListPlayerPlayed 
libvlc_MediaListPlayerNextItemSet 
libvlc_MediaListPlayerStopped 
libvlc_MediaDiscovererStarted 
libvlc_MediaDiscovererEnded 
libvlc_VlmMediaAdded 
libvlc_VlmMediaRemoved 
libvlc_VlmMediaChanged 
libvlc_VlmMediaInstanceStarted 
libvlc_VlmMediaInstanceStopped 
libvlc_VlmMediaInstanceStatusInit 
libvlc_VlmMediaInstanceStatusOpening 
libvlc_VlmMediaInstanceStatusPlaying 
libvlc_VlmMediaInstanceStatusPause 
libvlc_VlmMediaInstanceStatusEnd 
libvlc_VlmMediaInstanceStatusError 

Function Documentation

int libvlc_event_attach ( libvlc_event_manager_t p_event_manager,
libvlc_event_type_t  i_event_type,
libvlc_callback_t  f_callback,
void *  user_data 
)

Register for an event notification.

Parameters
p_event_managerthe event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to.
i_event_typethe desired event to which we want to listen
f_callbackthe function to call when i_event_type occurs
user_datauser provided data to carry with the event
Returns
0 on success, ENOMEM on error
void libvlc_event_detach ( libvlc_event_manager_t p_event_manager,
libvlc_event_type_t  i_event_type,
libvlc_callback_t  f_callback,
void *  p_user_data 
)

Unregister an event notification.

Parameters
p_event_managerthe event manager
i_event_typethe desired event to which we want to unregister
f_callbackthe function to call when i_event_type occurs
p_user_datauser provided data to carry with the event
const char* libvlc_event_type_name ( libvlc_event_type_t  event_type)

Get an event's type name.

Parameters
event_typethe desired event