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_MediaDescriptorMetaChanged,
44 libvlc_MediaDescriptorSubItemAdded,
45 libvlc_MediaDescriptorDurationChanged,
46 libvlc_MediaDescriptorPreparsedChanged,
47 libvlc_MediaDescriptorFreed,
48 libvlc_MediaDescriptorStateChanged,
50 libvlc_MediaInstancePlayed,
51 libvlc_MediaInstancePaused,
52 libvlc_MediaInstanceReachedEnd,
53 libvlc_MediaInstanceEncounteredError,
54 libvlc_MediaInstanceTimeChanged,
55 libvlc_MediaInstancePositionChanged,
56 libvlc_MediaInstanceSeekableChanged,
57 libvlc_MediaInstancePausableChanged,
59 libvlc_MediaListItemAdded,
60 libvlc_MediaListWillAddItem,
61 libvlc_MediaListItemDeleted,
62 libvlc_MediaListWillDeleteItem,
64 libvlc_MediaListViewItemAdded,
65 libvlc_MediaListViewWillAddItem,
66 libvlc_MediaListViewItemDeleted,
67 libvlc_MediaListViewWillDeleteItem,
69 libvlc_MediaListPlayerPlayed,
70 libvlc_MediaListPlayerNextItemSet,
71 libvlc_MediaListPlayerStopped,
73 libvlc_MediaDiscovererStarted,
74 libvlc_MediaDiscovererEnded
76 } libvlc_event_type_t;
80 * \param type the even type
81 * \param p_obj the sender object
82 * \param u Event dependent content
85 typedef struct libvlc_event_t
87 libvlc_event_type_t type;
89 union event_type_specific
91 /* media descriptor */
94 libvlc_meta_t meta_type;
95 } media_descriptor_meta_changed;
98 libvlc_media_descriptor_t * new_child;
99 } media_descriptor_subitem_added;
102 vlc_int64_t new_duration;
103 } media_descriptor_duration_changed;
107 } media_descriptor_preparsed_changed;
110 libvlc_media_descriptor_t * md;
111 } media_descriptor_freed;
114 libvlc_state_t new_state;
115 } media_descriptor_state_changed;
121 } media_instance_position_changed;
124 libvlc_time_t new_time;
125 } media_instance_time_changed;
128 libvlc_time_t new_seekable;
129 } media_instance_seekable_changed;
132 libvlc_time_t new_pausable;
133 } media_instance_pausable_changed;
138 libvlc_media_descriptor_t * item;
140 } media_list_item_added;
143 libvlc_media_descriptor_t * item;
145 } media_list_will_add_item;
148 libvlc_media_descriptor_t * item;
150 } media_list_item_deleted;
153 libvlc_media_descriptor_t * item;
155 } media_list_will_delete_item;
157 /* media list view */
160 libvlc_media_descriptor_t * item;
162 } media_list_view_item_added;
165 libvlc_media_descriptor_t * item;
167 } media_list_view_will_add_item;
170 libvlc_media_descriptor_t * item;
172 } media_list_view_item_deleted;
175 libvlc_media_descriptor_t * item;
177 } media_list_view_will_delete_item;
179 /* media discoverer */
183 } media_media_discoverer_started;
187 } media_media_discoverer_ended;
193 * Event manager that belongs to a libvlc object, and from whom events can
197 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
200 * Callback function notification
201 * \param p_event the event triggering the callback
204 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
212 #endif /* _LIBVLC_EVENTS_H */