]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_events.h
Add another bunch of doxygen file comments.
[vlc] / include / vlc / libvlc_events.h
1 /*****************************************************************************
2  * libvlc_events.h:  libvlc_events external API structure
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * $Id $
6  *
7  * Authors: Filippo Carone <littlejohn@videolan.org>
8  *          Pierre d'Herbemont <pdherbemont@videolan.org>
9  *
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.
14  *
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.
19  *
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  *****************************************************************************/
24
25 #ifndef LIBVLC_EVENTS_H
26 #define LIBVLC_EVENTS_H 1
27
28 /**
29  * \file
30  * This file defines libvlc_event external API
31  */
32
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
36
37 /*****************************************************************************
38  * Events handling
39  *****************************************************************************/
40
41 /** \defgroup libvlc_event libvlc_event
42  * \ingroup libvlc_core
43  * LibVLC Available Events
44  * @{
45  */
46
47 typedef enum libvlc_event_type_t {
48     libvlc_MediaMetaChanged,
49     libvlc_MediaSubItemAdded,
50     libvlc_MediaDurationChanged,
51     libvlc_MediaPreparsedChanged,
52     libvlc_MediaFreed,
53     libvlc_MediaStateChanged,
54
55     libvlc_MediaPlayerNothingSpecial,
56     libvlc_MediaPlayerOpening,
57     libvlc_MediaPlayerBuffering,
58     libvlc_MediaPlayerPlaying,
59     libvlc_MediaPlayerPaused,
60     libvlc_MediaPlayerStopped,
61     libvlc_MediaPlayerForward,
62     libvlc_MediaPlayerBackward,
63     libvlc_MediaPlayerEndReached,
64     libvlc_MediaPlayerEncounteredError,
65     libvlc_MediaPlayerTimeChanged,
66     libvlc_MediaPlayerPositionChanged,
67     libvlc_MediaPlayerSeekableChanged,
68     libvlc_MediaPlayerPausableChanged,
69
70     libvlc_MediaListItemAdded,
71     libvlc_MediaListWillAddItem,
72     libvlc_MediaListItemDeleted,
73     libvlc_MediaListWillDeleteItem,
74
75     libvlc_MediaListViewItemAdded,
76     libvlc_MediaListViewWillAddItem,
77     libvlc_MediaListViewItemDeleted,
78     libvlc_MediaListViewWillDeleteItem,
79
80     libvlc_MediaListPlayerPlayed,
81     libvlc_MediaListPlayerNextItemSet,
82     libvlc_MediaListPlayerStopped,
83
84     libvlc_MediaDiscovererStarted,
85     libvlc_MediaDiscovererEnded
86
87 } libvlc_event_type_t;
88
89 /**
90  * An Event
91  * \param type the even type
92  * \param p_obj the sender object
93  * \param u Event dependent content
94  */
95
96 typedef struct libvlc_event_t
97 {
98     libvlc_event_type_t type;
99     void * p_obj;
100     union event_type_specific
101     {
102         /* media descriptor */
103         struct
104         {
105             libvlc_meta_t meta_type;
106         } media_meta_changed;
107         struct
108         {
109             libvlc_media_t * new_child;
110         } media_subitem_added;
111         struct
112         {
113             int64_t new_duration;
114         } media_duration_changed;
115         struct
116         {
117             int new_status;
118         } media_preparsed_changed;
119         struct
120         {
121             libvlc_media_t * md;
122         } media_freed;
123         struct
124         {
125             libvlc_state_t new_state;
126         } media_state_changed;
127
128         /* media instance */
129         struct
130         {
131             float new_position;
132         } media_player_position_changed;
133         struct
134         {
135             libvlc_time_t new_time;
136         } media_player_time_changed;
137         struct
138         {
139             libvlc_time_t new_seekable;
140         } media_player_seekable_changed;
141         struct
142         {
143             libvlc_time_t new_pausable;
144         } media_player_pausable_changed;
145
146         /* media list */
147         struct
148         {
149             libvlc_media_t * item;
150             int index;
151         } media_list_item_added;
152         struct
153         {
154             libvlc_media_t * item;
155             int index;
156         } media_list_will_add_item;
157         struct
158         {
159             libvlc_media_t * item;
160             int index;
161         } media_list_item_deleted;
162         struct
163         {
164             libvlc_media_t * item;
165             int index;
166         } media_list_will_delete_item;
167
168         /* media list view */
169         struct
170         {
171             libvlc_media_t * item;
172             int index;
173         } media_list_view_item_added;
174         struct
175         {
176             libvlc_media_t * item;
177             int index;
178         } media_list_view_will_add_item;
179         struct
180         {
181             libvlc_media_t * item;
182             int index;
183         } media_list_view_item_deleted;
184         struct
185         {
186             libvlc_media_t * item;
187             int index;
188         } media_list_view_will_delete_item;
189
190         /* media discoverer */
191         struct
192         {
193             void * unused;
194         } media_media_discoverer_started;
195         struct
196         {
197             void * unused;
198         } media_media_discoverer_ended;
199
200     } u;
201 } libvlc_event_t;
202
203 /**
204  * Event manager that belongs to a libvlc object, and from whom events can
205  * be received.
206  */
207
208 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
209
210 /**
211  * Callback function notification
212  * \param p_event the event triggering the callback
213  */
214
215 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
216
217 /**@} */
218
219 # ifdef __cplusplus
220 }
221 # endif
222
223 #endif /* _LIBVLC_EVENTS_H */