X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc%2Flibvlc_events.h;h=8aa41d820cb6ffd86ed6ba84b603664749d3ed03;hb=fdc455adc812cf9b02ae40c8bd47a1a261a32ce6;hp=94968395a250aff75832452cfd3b55a25ac1b9c6;hpb=114b922fa7bbe06f4acfcc3d7af9c47ef534b1a2;p=vlc diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h index 94968395a2..8aa41d820c 100644 --- a/include/vlc/libvlc_events.h +++ b/include/vlc/libvlc_events.h @@ -34,111 +34,82 @@ extern "C" { # endif -/***************************************************************************** - * Events handling - *****************************************************************************/ - -/** \defgroup libvlc_event libvlc_event - * \ingroup libvlc_core - * LibVLC Available Events +/** + * \ingroup libvlc_event * @{ */ - /* Append new event types at the end. Do not remove, insert or - * re-order any entry. The cpp will prepend libvlc_ to the symbols. */ -#define DEFINE_LIBVLC_EVENT_TYPES \ - DEF( MediaMetaChanged ), \ - DEF( MediaSubItemAdded ), \ - DEF( MediaDurationChanged ), \ - DEF( MediaPreparsedChanged ), \ - DEF( MediaFreed ), \ - DEF( MediaStateChanged ), \ - \ - DEF( MediaPlayerNothingSpecial ), \ - DEF( MediaPlayerOpening ), \ - DEF( MediaPlayerBuffering ), \ - DEF( MediaPlayerPlaying ), \ - DEF( MediaPlayerPaused ), \ - DEF( MediaPlayerStopped ), \ - DEF( MediaPlayerForward ), \ - DEF( MediaPlayerBackward ), \ - DEF( MediaPlayerEndReached ), \ - DEF( MediaPlayerEncounteredError ), \ - DEF( MediaPlayerTimeChanged ), \ - DEF( MediaPlayerPositionChanged ), \ - DEF( MediaPlayerSeekableChanged ), \ - DEF( MediaPlayerPausableChanged ), \ - \ - DEF( MediaListItemAdded ), \ - DEF( MediaListWillAddItem ), \ - DEF( MediaListItemDeleted ), \ - DEF( MediaListWillDeleteItem ), \ - \ - DEF( MediaListViewItemAdded ), \ - DEF( MediaListViewWillAddItem ), \ - DEF( MediaListViewItemDeleted ), \ - DEF( MediaListViewWillDeleteItem ), \ - \ - DEF( MediaListPlayerPlayed ), \ - DEF( MediaListPlayerNextItemSet ), \ - DEF( MediaListPlayerStopped ), \ - \ - DEF( MediaDiscovererStarted ), \ - DEF( MediaDiscovererEnded ), \ - \ - DEF( MediaPlayerTitleChanged ), \ - DEF( MediaPlayerSnapshotTaken ), \ - DEF( MediaPlayerLengthChanged ), \ - \ - DEF( VlmMediaAdded ), \ - DEF( VlmMediaRemoved ), \ - DEF( VlmMediaChanged ), \ - DEF( VlmMediaInstanceStarted ), \ - DEF( VlmMediaInstanceStopped ), \ - DEF( VlmMediaInstanceStatusInit ), \ - DEF( VlmMediaInstanceStatusOpening ), \ - DEF( VlmMediaInstanceStatusPlaying ), \ - DEF( VlmMediaInstanceStatusPause ), \ - DEF( VlmMediaInstanceStatusEnd ), \ - DEF( VlmMediaInstanceStatusError ), \ - \ - DEF( MediaPlayerMediaChanged ), \ - \ - DEF( MediaPlayerMouseMoved ), \ - DEF( MediaPlayerMouseButton ), \ - DEF( MediaPlayerMouseClick ), \ - DEF( MediaPlayerMouseObject ), \ - \ -/* New event types HERE */ - -#ifdef __cplusplus -enum libvlc_event_type_e { -#else -enum libvlc_event_type_t { -#endif -#define DEF(a) libvlc_##a - DEFINE_LIBVLC_EVENT_TYPES - libvlc_num_event_types -#undef DEF +/** + * Event types + */ +enum libvlc_event_e { + /* Append new event types at the end of a category. + * Do not remove, insert or re-order any entry. + * Keep this in sync with src/control/event.c:libvlc_event_type_name(). */ + libvlc_MediaMetaChanged=0, + libvlc_MediaSubItemAdded, + libvlc_MediaDurationChanged, + libvlc_MediaParsedChanged, + libvlc_MediaFreed, + libvlc_MediaStateChanged, + + 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_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, }; -/* Implementing libvlc_event_type_name() needs the definition too. */ -#ifndef LIBVLC_EVENT_TYPES_KEEP_DEFINE -#undef DEFINE_LIBVLC_EVENT_TYPES -#endif - /** - * An Event - * \param type the even type - * \param p_obj the sender object - * \param u Event dependent content + * A LibVLC event */ - -struct libvlc_event_t +typedef struct libvlc_event_t { - libvlc_event_type_t type; - void * p_obj; - union event_type_specific + int type; /**< Event type (see @ref libvlc_event_e) */ + void *p_obj; /**< Object emitting the event */ + union { /* media descriptor */ struct @@ -156,7 +127,7 @@ struct libvlc_event_t struct { int new_status; - } media_preparsed_changed; + } media_parsed_changed; struct { libvlc_media_t * md; @@ -240,35 +211,8 @@ struct libvlc_event_t { libvlc_media_t * new_media; } media_player_media_changed; - - /* Mouse events */ - struct - { - int x; - int y; - } media_player_mouse_moved; - - struct - { - int mb_left; - int mb_center; - int mb_right; - int mb_wheel_up; - int mb_wheel_down; - } media_player_mouse_button; - - struct - { - int clicked; - } media_player_mouse_clicked; - - struct - { - int moved; - } media_player_mouse_object; - - } u; -}; + } u; /**< Type-dependent event description */ +} libvlc_event_t; /**@} */