]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_events.h
f1fc40fec3da329ca79fe8dcb0f7abf73643ca53
[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 #ifdef __cplusplus
48 enum libvlc_event_type_e {
49 #else
50 enum libvlc_event_type_t {
51 #endif
52     /* Append new event types at the end.
53      * Do not remove, insert or re-order any entry. */
54     libvlc_MediaMetaChanged,
55     libvlc_MediaSubItemAdded,
56     libvlc_MediaDurationChanged,
57     libvlc_MediaPreparsedChanged,
58     libvlc_MediaFreed,
59     libvlc_MediaStateChanged,
60
61     libvlc_MediaPlayerNothingSpecial,
62     libvlc_MediaPlayerOpening,
63     libvlc_MediaPlayerBuffering,
64     libvlc_MediaPlayerPlaying,
65     libvlc_MediaPlayerPaused,
66     libvlc_MediaPlayerStopped,
67     libvlc_MediaPlayerForward,
68     libvlc_MediaPlayerBackward,
69     libvlc_MediaPlayerEndReached,
70     libvlc_MediaPlayerEncounteredError,
71     libvlc_MediaPlayerTimeChanged,
72     libvlc_MediaPlayerPositionChanged,
73     libvlc_MediaPlayerSeekableChanged,
74     libvlc_MediaPlayerPausableChanged,
75
76     libvlc_MediaListItemAdded,
77     libvlc_MediaListWillAddItem,
78     libvlc_MediaListItemDeleted,
79     libvlc_MediaListWillDeleteItem,
80
81     libvlc_MediaListViewItemAdded,
82     libvlc_MediaListViewWillAddItem,
83     libvlc_MediaListViewItemDeleted,
84     libvlc_MediaListViewWillDeleteItem,
85
86     libvlc_MediaListPlayerPlayed,
87     libvlc_MediaListPlayerNextItemSet,
88     libvlc_MediaListPlayerStopped,
89
90     libvlc_MediaDiscovererStarted,
91     libvlc_MediaDiscovererEnded,
92
93     libvlc_MediaPlayerTitleChanged,
94     libvlc_MediaPlayerSnapshotTaken,
95     libvlc_MediaPlayerLengthChanged,
96
97     libvlc_VlmMediaAdded,
98     libvlc_VlmMediaRemoved,
99     libvlc_VlmMediaChanged,
100     libvlc_VlmMediaInstanceStarted,
101     libvlc_VlmMediaInstanceStopped,
102     libvlc_VlmMediaInstanceStatusInit,
103     libvlc_VlmMediaInstanceStatusOpening,
104     libvlc_VlmMediaInstanceStatusPlaying,
105     libvlc_VlmMediaInstanceStatusPause,
106     libvlc_VlmMediaInstanceStatusEnd,
107     libvlc_VlmMediaInstanceStatusError,
108     /* New event types HERE */
109 };
110
111 /**
112  * An Event
113  * \param type the even type
114  * \param p_obj the sender object
115  * \param u Event dependent content
116  */
117
118 struct libvlc_event_t
119 {
120     libvlc_event_type_t type;
121     void * p_obj;
122     union event_type_specific
123     {
124         /* media descriptor */
125         struct
126         {
127             libvlc_meta_t meta_type;
128         } media_meta_changed;
129         struct
130         {
131             libvlc_media_t * new_child;
132         } media_subitem_added;
133         struct
134         {
135             int64_t new_duration;
136         } media_duration_changed;
137         struct
138         {
139             int new_status;
140         } media_preparsed_changed;
141         struct
142         {
143             libvlc_media_t * md;
144         } media_freed;
145         struct
146         {
147             libvlc_state_t new_state;
148         } media_state_changed;
149
150         /* media instance */
151         struct
152         {
153             float new_position;
154         } media_player_position_changed;
155         struct
156         {
157             libvlc_time_t new_time;
158         } media_player_time_changed;
159         struct
160         {
161             int new_title;
162         } media_player_title_changed;
163         struct
164         {
165             uint64_t new_seekable; /* FIXME: that's a boolean! */
166         } media_player_seekable_changed;
167         struct
168         {
169             uint64_t new_pausable; /* FIXME: that's a BOOL!!! */
170         } media_player_pausable_changed;
171
172         /* media list */
173         struct
174         {
175             libvlc_media_t * item;
176             int index;
177         } media_list_item_added;
178         struct
179         {
180             libvlc_media_t * item;
181             int index;
182         } media_list_will_add_item;
183         struct
184         {
185             libvlc_media_t * item;
186             int index;
187         } media_list_item_deleted;
188         struct
189         {
190             libvlc_media_t * item;
191             int index;
192         } media_list_will_delete_item;
193
194         /* media list view */
195         struct
196         {
197             libvlc_media_t * item;
198             int index;
199         } media_list_view_item_added;
200         struct
201         {
202             libvlc_media_t * item;
203             int index;
204         } media_list_view_will_add_item;
205         struct
206         {
207             libvlc_media_t * item;
208             int index;
209         } media_list_view_item_deleted;
210         struct
211         {
212             libvlc_media_t * item;
213             int index;
214         } media_list_view_will_delete_item;
215
216         /* snapshot taken */
217         struct
218         {
219              char* psz_filename ;
220         } media_player_snapshot_taken ;
221
222         /* Length changed */
223         struct
224         {
225             libvlc_time_t   new_length;
226         } media_player_length_changed;
227
228         /* VLM media */
229         struct
230         {
231             const char * psz_media_name;
232             const char * psz_instance_name;
233         } vlm_media_event;
234     } u;
235 };
236
237
238 /**@} */
239
240 # ifdef __cplusplus
241 }
242 # endif
243
244 #endif /* _LIBVLC_EVENTS_H */