1 /*****************************************************************************
2 * libvlc_events.h: libvlc_events external API structure
3 *****************************************************************************
4 * Copyright (C) 1998-2008 the VideoLAN team
7 * Authors: Filippo Carone <littlejohn@videolan.org>
8 * Pierre d'Herbemont <pdherbemont@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef LIBVLC_EVENTS_H
26 #define LIBVLC_EVENTS_H 1
30 * This file defines libvlc_event external API
37 /*****************************************************************************
39 *****************************************************************************/
41 /** \defgroup libvlc_event libvlc_event
42 * \ingroup libvlc_core
43 * LibVLC Available Events
47 /* Append new event types at the end. Do not remove, insert or
48 * re-order any entry. The cpp will prepend libvlc_ to the symbols. */
49 #define DEFINE_LIBVLC_EVENT_TYPES \
50 DEF( MediaMetaChanged ), \
51 DEF( MediaSubItemAdded ), \
52 DEF( MediaDurationChanged ), \
53 DEF( MediaPreparsedChanged ), \
55 DEF( MediaStateChanged ), \
57 DEF( MediaPlayerNothingSpecial ), \
58 DEF( MediaPlayerOpening ), \
59 DEF( MediaPlayerBuffering ), \
60 DEF( MediaPlayerPlaying ), \
61 DEF( MediaPlayerPaused ), \
62 DEF( MediaPlayerStopped ), \
63 DEF( MediaPlayerForward ), \
64 DEF( MediaPlayerBackward ), \
65 DEF( MediaPlayerEndReached ), \
66 DEF( MediaPlayerEncounteredError ), \
67 DEF( MediaPlayerTimeChanged ), \
68 DEF( MediaPlayerPositionChanged ), \
69 DEF( MediaPlayerSeekableChanged ), \
70 DEF( MediaPlayerPausableChanged ), \
72 DEF( MediaListItemAdded ), \
73 DEF( MediaListWillAddItem ), \
74 DEF( MediaListItemDeleted ), \
75 DEF( MediaListWillDeleteItem ), \
77 DEF( MediaListViewItemAdded ), \
78 DEF( MediaListViewWillAddItem ), \
79 DEF( MediaListViewItemDeleted ), \
80 DEF( MediaListViewWillDeleteItem ), \
82 DEF( MediaListPlayerPlayed ), \
83 DEF( MediaListPlayerNextItemSet ), \
84 DEF( MediaListPlayerStopped ), \
86 DEF( MediaDiscovererStarted ), \
87 DEF( MediaDiscovererEnded ), \
89 DEF( MediaPlayerTitleChanged ), \
90 DEF( MediaPlayerSnapshotTaken ), \
91 DEF( MediaPlayerLengthChanged ), \
93 DEF( VlmMediaAdded ), \
94 DEF( VlmMediaRemoved ), \
95 DEF( VlmMediaChanged ), \
96 DEF( VlmMediaInstanceStarted ), \
97 DEF( VlmMediaInstanceStopped ), \
98 DEF( VlmMediaInstanceStatusInit ), \
99 DEF( VlmMediaInstanceStatusOpening ), \
100 DEF( VlmMediaInstanceStatusPlaying ), \
101 DEF( VlmMediaInstanceStatusPause ), \
102 DEF( VlmMediaInstanceStatusEnd ), \
103 DEF( VlmMediaInstanceStatusError ), \
104 /* New event types HERE */
107 enum libvlc_event_type_e {
109 enum libvlc_event_type_t {
111 #define DEF(a) libvlc_##a
112 DEFINE_LIBVLC_EVENT_TYPES
113 libvlc_num_event_types
117 /* Implementing libvlc_event_type_name() needs the definition too. */
118 #ifndef LIBVLC_EVENT_TYPES_KEEP_DEFINE
119 #undef DEFINE_LIBVLC_EVENT_TYPES
124 * \param type the even type
125 * \param p_obj the sender object
126 * \param u Event dependent content
129 struct libvlc_event_t
131 libvlc_event_type_t type;
133 union event_type_specific
135 /* media descriptor */
138 libvlc_meta_t meta_type;
139 } media_meta_changed;
142 libvlc_media_t * new_child;
143 } media_subitem_added;
146 int64_t new_duration;
147 } media_duration_changed;
151 } media_preparsed_changed;
158 libvlc_state_t new_state;
159 } media_state_changed;
165 } media_player_position_changed;
168 libvlc_time_t new_time;
169 } media_player_time_changed;
173 } media_player_title_changed;
177 } media_player_seekable_changed;
181 } media_player_pausable_changed;
186 libvlc_media_t * item;
188 } media_list_item_added;
191 libvlc_media_t * item;
193 } media_list_will_add_item;
196 libvlc_media_t * item;
198 } media_list_item_deleted;
201 libvlc_media_t * item;
203 } media_list_will_delete_item;
205 /* media list view */
208 libvlc_media_t * item;
210 } media_list_view_item_added;
213 libvlc_media_t * item;
215 } media_list_view_will_add_item;
218 libvlc_media_t * item;
220 } media_list_view_item_deleted;
223 libvlc_media_t * item;
225 } media_list_view_will_delete_item;
227 /* media list player */
230 libvlc_media_t * item;
231 } media_list_player_next_item_set;
237 } media_player_snapshot_taken ;
242 libvlc_time_t new_length;
243 } media_player_length_changed;
248 const char * psz_media_name;
249 const char * psz_instance_name;
261 #endif /* _LIBVLC_EVENTS_H */