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_events Events
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_MediaPlayerPlayed,
51 libvlc_MediaPlayerPaused,
52 libvlc_MediaPlayerEndReached,
53 libvlc_MediaPlayerStopped,
54 libvlc_MediaPlayerEncounteredError,
55 libvlc_MediaPlayerTimeChanged,
56 libvlc_MediaPlayerPositionChanged,
57 libvlc_MediaPlayerSeekableChanged,
58 libvlc_MediaPlayerPausableChanged,
60 libvlc_MediaListItemAdded,
61 libvlc_MediaListWillAddItem,
62 libvlc_MediaListItemDeleted,
63 libvlc_MediaListWillDeleteItem,
65 libvlc_MediaListViewItemAdded,
66 libvlc_MediaListViewWillAddItem,
67 libvlc_MediaListViewItemDeleted,
68 libvlc_MediaListViewWillDeleteItem,
70 libvlc_MediaListPlayerPlayed,
71 libvlc_MediaListPlayerNextItemSet,
72 libvlc_MediaListPlayerStopped,
74 libvlc_MediaDiscovererStarted,
75 libvlc_MediaDiscovererEnded
77 } libvlc_event_type_t;
81 * \param type the even type
82 * \param p_obj the sender object
83 * \param u Event dependent content
86 typedef struct libvlc_event_t
88 libvlc_event_type_t type;
90 union event_type_specific
92 /* media descriptor */
95 libvlc_meta_t meta_type;
99 libvlc_media_t * new_child;
100 } media_subitem_added;
103 vlc_int64_t new_duration;
104 } media_duration_changed;
108 } media_preparsed_changed;
115 libvlc_state_t new_state;
116 } media_state_changed;
122 } media_player_position_changed;
125 libvlc_time_t new_time;
126 } media_player_time_changed;
129 libvlc_time_t new_seekable;
130 } media_player_seekable_changed;
133 libvlc_time_t new_pausable;
134 } media_player_pausable_changed;
139 libvlc_media_t * item;
141 } media_list_item_added;
144 libvlc_media_t * item;
146 } media_list_will_add_item;
149 libvlc_media_t * item;
151 } media_list_item_deleted;
154 libvlc_media_t * item;
156 } media_list_will_delete_item;
158 /* media list view */
161 libvlc_media_t * item;
163 } media_list_view_item_added;
166 libvlc_media_t * item;
168 } media_list_view_will_add_item;
171 libvlc_media_t * item;
173 } media_list_view_item_deleted;
176 libvlc_media_t * item;
178 } media_list_view_will_delete_item;
180 /* media discoverer */
184 } media_media_discoverer_started;
188 } media_media_discoverer_ended;
194 * Event manager that belongs to a libvlc object, and from whom events can
198 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
201 * Callback function notification
202 * \param p_event the event triggering the callback
205 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
213 #endif /* _LIBVLC_EVENTS_H */