X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc%2Flibvlc_events.h;h=e6af9b25da9c2e52b48eb81bbaad3812422091d7;hb=6c2286c22b6074320338c085d78d4a795478c1c3;hp=9373896861d48bad3a496ab5a51fe55655728e52;hpb=6030a03b5a82ffbdc19a58dc5a34397e53560076;p=vlc diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h index 9373896861..e6af9b25da 100644 --- a/include/vlc/libvlc_events.h +++ b/include/vlc/libvlc_events.h @@ -17,9 +17,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef LIBVLC_EVENTS_H @@ -44,64 +44,83 @@ extern "C" { * @{ */ + /* 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 ), \ +/* New event types HERE */ + #ifdef __cplusplus enum libvlc_event_type_e { #else enum libvlc_event_type_t { #endif - /* Append new event types at the end. - * Do not remove, insert or re-order any entry. */ - libvlc_MediaMetaChanged, - libvlc_MediaSubItemAdded, - libvlc_MediaDurationChanged, - libvlc_MediaPreparsedChanged, - libvlc_MediaFreed, - libvlc_MediaStateChanged, - - 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_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_MediaPlayerTitleChanged, - libvlc_MediaPlayerSnapshotTaken, - libvlc_MediaPlayerLengthChanged, - - libvlc_VlmMediaAdded, - libvlc_VlmMediaRemoved, - libvlc_VlmMediaChanged, - libvlc_VlmMediaInstanceStarted, - libvlc_VlmMediaInstanceStopped, - /* New event types HERE */ +#define DEF(a) libvlc_##a + DEFINE_LIBVLC_EVENT_TYPES + libvlc_num_event_types +#undef DEF }; +/* 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 @@ -156,11 +175,11 @@ struct libvlc_event_t } media_player_title_changed; struct { - uint64_t new_seekable; /* FIXME: that's a boolean! */ + int new_seekable; } media_player_seekable_changed; struct { - uint64_t new_pausable; /* FIXME: that's a BOOL!!! */ + int new_pausable; } media_player_pausable_changed; /* media list */ @@ -185,27 +204,11 @@ struct libvlc_event_t int index; } media_list_will_delete_item; - /* media list view */ - struct - { - libvlc_media_t * item; - int index; - } media_list_view_item_added; - struct - { - libvlc_media_t * item; - int index; - } media_list_view_will_add_item; + /* media list player */ struct { libvlc_media_t * item; - int index; - } media_list_view_item_deleted; - struct - { - libvlc_media_t * item; - int index; - } media_list_view_will_delete_item; + } media_list_player_next_item_set; /* snapshot taken */ struct @@ -223,8 +226,14 @@ struct libvlc_event_t struct { const char * psz_media_name; + const char * psz_instance_name; } vlm_media_event; + /* Extra MediaPlayer */ + struct + { + libvlc_media_t * new_media; + } media_player_media_changed; } u; };