]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_events.h
Improve Doxygen documentation, deobfuscate event types
[vlc] / include / vlc / libvlc_events.h
1 /*****************************************************************************
2  * libvlc_events.h:  libvlc_events external API structure
3  *****************************************************************************
4  * Copyright (C) 1998-2010 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 along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 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  * \ingroup libvlc_event
39  * @{
40  */
41
42 /**
43  * Event types
44  */
45 enum libvlc_event_e {
46     /* Append new event types at the end. Do not remove, insert or
47      * re-order any entry. The cpp will prepend libvlc_ to the symbols. */
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_MediaPlayerTitleChanged,
88     libvlc_MediaPlayerSnapshotTaken,
89     libvlc_MediaPlayerLengthChanged,
90
91     libvlc_VlmMediaAdded,
92     libvlc_VlmMediaRemoved,
93     libvlc_VlmMediaChanged,
94     libvlc_VlmMediaInstanceStarted,
95     libvlc_VlmMediaInstanceStopped,
96     libvlc_VlmMediaInstanceStatusInit,
97     libvlc_VlmMediaInstanceStatusOpening,
98     libvlc_VlmMediaInstanceStatusPlaying,
99     libvlc_VlmMediaInstanceStatusPause,
100     libvlc_VlmMediaInstanceStatusEnd,
101     libvlc_VlmMediaInstanceStatusError,
102
103     libvlc_MediaPlayerMediaChanged,
104     /* New event types HERE */
105     libvlc_num_event_types
106 };
107
108 /**
109  * A LibVLC event
110  */
111 typedef struct libvlc_event_t
112 {
113     int   type; /**< Event type (see @ref libvlc_event_e) */
114     void *p_obj; /**< Object emitting the event */
115     union
116     {
117         /* media descriptor */
118         struct
119         {
120             libvlc_meta_t meta_type;
121         } media_meta_changed;
122         struct
123         {
124             libvlc_media_t * new_child;
125         } media_subitem_added;
126         struct
127         {
128             int64_t new_duration;
129         } media_duration_changed;
130         struct
131         {
132             int new_status;
133         } media_preparsed_changed;
134         struct
135         {
136             libvlc_media_t * md;
137         } media_freed;
138         struct
139         {
140             libvlc_state_t new_state;
141         } media_state_changed;
142
143         /* media instance */
144         struct
145         {
146             float new_position;
147         } media_player_position_changed;
148         struct
149         {
150             libvlc_time_t new_time;
151         } media_player_time_changed;
152         struct
153         {
154             int new_title;
155         } media_player_title_changed;
156         struct
157         {
158             int new_seekable;
159         } media_player_seekable_changed;
160         struct
161         {
162             int new_pausable;
163         } media_player_pausable_changed;
164
165         /* media list */
166         struct
167         {
168             libvlc_media_t * item;
169             int index;
170         } media_list_item_added;
171         struct
172         {
173             libvlc_media_t * item;
174             int index;
175         } media_list_will_add_item;
176         struct
177         {
178             libvlc_media_t * item;
179             int index;
180         } media_list_item_deleted;
181         struct
182         {
183             libvlc_media_t * item;
184             int index;
185         } media_list_will_delete_item;
186
187         /* media list player */
188         struct
189         {
190             libvlc_media_t * item;
191         } media_list_player_next_item_set;
192
193         /* snapshot taken */
194         struct
195         {
196              char* psz_filename ;
197         } media_player_snapshot_taken ;
198
199         /* Length changed */
200         struct
201         {
202             libvlc_time_t   new_length;
203         } media_player_length_changed;
204
205         /* VLM media */
206         struct
207         {
208             const char * psz_media_name;
209             const char * psz_instance_name;
210         } vlm_media_event;
211
212         /* Extra MediaPlayer */
213         struct
214         {
215             libvlc_media_t * new_media;
216         } media_player_media_changed;
217     } u; /**< Type-dependent event description */
218 } libvlc_event_t;
219
220
221 /**@} */
222
223 # ifdef __cplusplus
224 }
225 # endif
226
227 #endif /* _LIBVLC_EVENTS_H */