VLC  3.0.21
Typedefs | Functions
LibVLC asynchronous events

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. More...
 
typedef int libvlc_event_type_t
 Type of a LibVLC event. More...
 
typedef void(* libvlc_callback_t) (const struct libvlc_event_t *p_event, void *p_data)
 Callback function notification. More...
 

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. More...
 
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. More...
 
const char * libvlc_event_type_name (libvlc_event_type_t event_type)
 Get an event's type name. More...
 
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_MediaPlayerESAdded,
  libvlc_MediaPlayerESDeleted, libvlc_MediaPlayerESSelected, libvlc_MediaPlayerCorked, libvlc_MediaPlayerUncorked,
  libvlc_MediaPlayerMuted, libvlc_MediaPlayerUnmuted, libvlc_MediaPlayerAudioVolume, libvlc_MediaPlayerAudioDevice,
  libvlc_MediaPlayerChapterChanged, libvlc_MediaListItemAdded =0x200, libvlc_MediaListWillAddItem, libvlc_MediaListItemDeleted,
  libvlc_MediaListWillDeleteItem, libvlc_MediaListEndReached, libvlc_MediaListViewItemAdded =0x300, libvlc_MediaListViewWillAddItem,
  libvlc_MediaListViewItemDeleted, libvlc_MediaListViewWillDeleteItem, libvlc_MediaListPlayerPlayed =0x400, libvlc_MediaListPlayerNextItemSet,
  libvlc_MediaListPlayerStopped, libvlc_MediaDiscovererStarted =0x500, libvlc_MediaDiscovererEnded, libvlc_RendererDiscovererItemAdded,
  libvlc_RendererDiscovererItemDeleted, 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. More...
 

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

◆ libvlc_callback_t

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

Callback function notification.

Parameters
p_eventthe event triggering the callback

◆ libvlc_event_manager_t

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

◆ libvlc_event_t

A LibVLC event.

◆ libvlc_event_type_t

typedef int libvlc_event_type_t

Type of a LibVLC event.

Enumeration Type Documentation

◆ libvlc_event_e

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_MediaPlayerESAdded 
libvlc_MediaPlayerESDeleted 
libvlc_MediaPlayerESSelected 
libvlc_MediaPlayerCorked 
libvlc_MediaPlayerUncorked 
libvlc_MediaPlayerMuted 
libvlc_MediaPlayerUnmuted 
libvlc_MediaPlayerAudioVolume 
libvlc_MediaPlayerAudioDevice 
libvlc_MediaPlayerChapterChanged 
libvlc_MediaListItemAdded 
libvlc_MediaListWillAddItem 
libvlc_MediaListItemDeleted 
libvlc_MediaListWillDeleteItem 
libvlc_MediaListEndReached 
libvlc_MediaListViewItemAdded 
libvlc_MediaListViewWillAddItem 
libvlc_MediaListViewItemDeleted 
libvlc_MediaListViewWillDeleteItem 
libvlc_MediaListPlayerPlayed 
libvlc_MediaListPlayerNextItemSet 
libvlc_MediaListPlayerStopped 
libvlc_MediaDiscovererStarted 
Deprecated:
Useless event, it will be triggered only when calling libvlc_media_discoverer_start()
libvlc_MediaDiscovererEnded 
Deprecated:
Useless event, it will be triggered only when calling libvlc_media_discoverer_stop()
libvlc_RendererDiscovererItemAdded 
libvlc_RendererDiscovererItemDeleted 
libvlc_VlmMediaAdded 
libvlc_VlmMediaRemoved 
libvlc_VlmMediaChanged 
libvlc_VlmMediaInstanceStarted 
libvlc_VlmMediaInstanceStopped 
libvlc_VlmMediaInstanceStatusInit 
libvlc_VlmMediaInstanceStatusOpening 
libvlc_VlmMediaInstanceStatusPlaying 
libvlc_VlmMediaInstanceStatusPause 
libvlc_VlmMediaInstanceStatusEnd 
libvlc_VlmMediaInstanceStatusError 

Function Documentation

◆ libvlc_event_attach()

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

◆ libvlc_event_detach()

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

◆ libvlc_event_type_name()

const char* libvlc_event_type_name ( libvlc_event_type_t  event_type)

Get an event's type name.

Parameters
event_typethe desired event