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