1 /*****************************************************************************
2 * libvlc_events.h: libvlc_events external API structure
3 *****************************************************************************
4 * Copyright (C) 1998-2007 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
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _LIBVLC_EVENTS_H
26 #define _LIBVLC_EVENTS_H 1
32 /*****************************************************************************
34 *****************************************************************************/
36 /** \defgroup libvlc_event libvlc_event
37 * \ingroup libvlc_core
38 * LibVLC Available Events
42 typedef enum libvlc_event_type_t {
43 libvlc_MediaMetaChanged,
44 libvlc_MediaSubItemAdded,
45 libvlc_MediaDurationChanged,
46 libvlc_MediaPreparsedChanged,
48 libvlc_MediaStateChanged,
50 libvlc_MediaPlayerNothingSpecial,
51 libvlc_MediaPlayerOpening,
52 libvlc_MediaPlayerBuffering,
53 libvlc_MediaPlayerPlaying,
54 libvlc_MediaPlayerPaused,
55 libvlc_MediaPlayerStopped,
56 libvlc_MediaPlayerForward,
57 libvlc_MediaPlayerBackward,
58 libvlc_MediaPlayerEndReached,
59 libvlc_MediaPlayerEncounteredError,
60 libvlc_MediaPlayerTimeChanged,
61 libvlc_MediaPlayerPositionChanged,
62 libvlc_MediaPlayerSeekableChanged,
63 libvlc_MediaPlayerPausableChanged,
65 libvlc_MediaListItemAdded,
66 libvlc_MediaListWillAddItem,
67 libvlc_MediaListItemDeleted,
68 libvlc_MediaListWillDeleteItem,
70 libvlc_MediaListViewItemAdded,
71 libvlc_MediaListViewWillAddItem,
72 libvlc_MediaListViewItemDeleted,
73 libvlc_MediaListViewWillDeleteItem,
75 libvlc_MediaListPlayerPlayed,
76 libvlc_MediaListPlayerNextItemSet,
77 libvlc_MediaListPlayerStopped,
79 libvlc_MediaDiscovererStarted,
80 libvlc_MediaDiscovererEnded
82 } libvlc_event_type_t;
86 * \param type the even type
87 * \param p_obj the sender object
88 * \param u Event dependent content
91 typedef struct libvlc_event_t
93 libvlc_event_type_t type;
95 union event_type_specific
97 /* media descriptor */
100 libvlc_meta_t meta_type;
101 } media_meta_changed;
104 libvlc_media_t * new_child;
105 } media_subitem_added;
108 int64_t new_duration;
109 } media_duration_changed;
113 } media_preparsed_changed;
120 libvlc_state_t new_state;
121 } media_state_changed;
127 } media_player_position_changed;
130 libvlc_time_t new_time;
131 } media_player_time_changed;
134 libvlc_time_t new_seekable;
135 } media_player_seekable_changed;
138 libvlc_time_t new_pausable;
139 } media_player_pausable_changed;
144 libvlc_media_t * item;
146 } media_list_item_added;
149 libvlc_media_t * item;
151 } media_list_will_add_item;
154 libvlc_media_t * item;
156 } media_list_item_deleted;
159 libvlc_media_t * item;
161 } media_list_will_delete_item;
163 /* media list view */
166 libvlc_media_t * item;
168 } media_list_view_item_added;
171 libvlc_media_t * item;
173 } media_list_view_will_add_item;
176 libvlc_media_t * item;
178 } media_list_view_item_deleted;
181 libvlc_media_t * item;
183 } media_list_view_will_delete_item;
185 /* media discoverer */
189 } media_media_discoverer_started;
193 } media_media_discoverer_ended;
199 * Event manager that belongs to a libvlc object, and from whom events can
203 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
206 * Callback function notification
207 * \param p_event the event triggering the callback
210 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
218 #endif /* _LIBVLC_EVENTS_H */