HTTP: fix possible crash in vlc_http_res_get_redirect
[vlc.git] / include / vlc / libvlc_events.h
blobf8b0e9b5b2c95f8d68463484316c0bacf68ecb83
1 /*****************************************************************************
2 * libvlc_events.h: libvlc_events external API structure
3 *****************************************************************************
4 * Copyright (C) 1998-2010 VLC authors and VideoLAN
5 * $Id $
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 it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef LIBVLC_EVENTS_H
26 #define LIBVLC_EVENTS_H 1
28 /**
29 * \file
30 * This file defines libvlc_event external API
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
37 typedef struct libvlc_renderer_item_t libvlc_renderer_item_t;
39 /**
40 * \ingroup libvlc_event
41 * @{
44 /**
45 * Event types
47 enum libvlc_event_e {
48 /* Append new event types at the end of a category.
49 * Do not remove, insert or re-order any entry.
50 * Keep this in sync with lib/event.c:libvlc_event_type_name(). */
51 libvlc_MediaMetaChanged=0,
52 libvlc_MediaSubItemAdded,
53 libvlc_MediaDurationChanged,
54 libvlc_MediaParsedChanged,
55 libvlc_MediaFreed,
56 libvlc_MediaStateChanged,
57 libvlc_MediaSubItemTreeAdded,
59 libvlc_MediaPlayerMediaChanged=0x100,
60 libvlc_MediaPlayerNothingSpecial,
61 libvlc_MediaPlayerOpening,
62 libvlc_MediaPlayerBuffering,
63 libvlc_MediaPlayerPlaying,
64 libvlc_MediaPlayerPaused,
65 libvlc_MediaPlayerStopped,
66 libvlc_MediaPlayerForward,
67 libvlc_MediaPlayerBackward,
68 libvlc_MediaPlayerEndReached,
69 libvlc_MediaPlayerEncounteredError,
70 libvlc_MediaPlayerTimeChanged,
71 libvlc_MediaPlayerPositionChanged,
72 libvlc_MediaPlayerSeekableChanged,
73 libvlc_MediaPlayerPausableChanged,
74 libvlc_MediaPlayerTitleChanged,
75 libvlc_MediaPlayerSnapshotTaken,
76 libvlc_MediaPlayerLengthChanged,
77 libvlc_MediaPlayerVout,
78 libvlc_MediaPlayerScrambledChanged,
79 libvlc_MediaPlayerESAdded,
80 libvlc_MediaPlayerESDeleted,
81 libvlc_MediaPlayerESSelected,
82 libvlc_MediaPlayerCorked,
83 libvlc_MediaPlayerUncorked,
84 libvlc_MediaPlayerMuted,
85 libvlc_MediaPlayerUnmuted,
86 libvlc_MediaPlayerAudioVolume,
87 libvlc_MediaPlayerAudioDevice,
88 libvlc_MediaPlayerChapterChanged,
90 libvlc_MediaListItemAdded=0x200,
91 libvlc_MediaListWillAddItem,
92 libvlc_MediaListItemDeleted,
93 libvlc_MediaListWillDeleteItem,
94 libvlc_MediaListEndReached,
96 libvlc_MediaListViewItemAdded=0x300,
97 libvlc_MediaListViewWillAddItem,
98 libvlc_MediaListViewItemDeleted,
99 libvlc_MediaListViewWillDeleteItem,
101 libvlc_MediaListPlayerPlayed=0x400,
102 libvlc_MediaListPlayerNextItemSet,
103 libvlc_MediaListPlayerStopped,
106 * \deprecated Useless event, it will be triggered only when calling
107 * libvlc_media_discoverer_start()
109 libvlc_MediaDiscovererStarted=0x500,
111 * \deprecated Useless event, it will be triggered only when calling
112 * libvlc_media_discoverer_stop()
114 libvlc_MediaDiscovererEnded,
116 libvlc_RendererDiscovererItemAdded,
117 libvlc_RendererDiscovererItemDeleted,
119 libvlc_VlmMediaAdded=0x600,
120 libvlc_VlmMediaRemoved,
121 libvlc_VlmMediaChanged,
122 libvlc_VlmMediaInstanceStarted,
123 libvlc_VlmMediaInstanceStopped,
124 libvlc_VlmMediaInstanceStatusInit,
125 libvlc_VlmMediaInstanceStatusOpening,
126 libvlc_VlmMediaInstanceStatusPlaying,
127 libvlc_VlmMediaInstanceStatusPause,
128 libvlc_VlmMediaInstanceStatusEnd,
129 libvlc_VlmMediaInstanceStatusError
133 * A LibVLC event
135 typedef struct libvlc_event_t
137 int type; /**< Event type (see @ref libvlc_event_e) */
138 void *p_obj; /**< Object emitting the event */
139 union
141 /* media descriptor */
142 struct
144 libvlc_meta_t meta_type;
145 } media_meta_changed;
146 struct
148 libvlc_media_t * new_child;
149 } media_subitem_added;
150 struct
152 int64_t new_duration;
153 } media_duration_changed;
154 struct
156 int new_status; /**< see @ref libvlc_media_parsed_status_t */
157 } media_parsed_changed;
158 struct
160 libvlc_media_t * md;
161 } media_freed;
162 struct
164 int new_state; /**< see @ref libvlc_state_t */
165 } media_state_changed;
166 struct
168 libvlc_media_t * item;
169 } media_subitemtree_added;
171 /* media instance */
172 struct
174 float new_cache;
175 } media_player_buffering;
176 struct
178 int new_chapter;
179 } media_player_chapter_changed;
180 struct
182 float new_position;
183 } media_player_position_changed;
184 struct
186 libvlc_time_t new_time;
187 } media_player_time_changed;
188 struct
190 int new_title;
191 } media_player_title_changed;
192 struct
194 int new_seekable;
195 } media_player_seekable_changed;
196 struct
198 int new_pausable;
199 } media_player_pausable_changed;
200 struct
202 int new_scrambled;
203 } media_player_scrambled_changed;
204 struct
206 int new_count;
207 } media_player_vout;
209 /* media list */
210 struct
212 libvlc_media_t * item;
213 int index;
214 } media_list_item_added;
215 struct
217 libvlc_media_t * item;
218 int index;
219 } media_list_will_add_item;
220 struct
222 libvlc_media_t * item;
223 int index;
224 } media_list_item_deleted;
225 struct
227 libvlc_media_t * item;
228 int index;
229 } media_list_will_delete_item;
231 /* media list player */
232 struct
234 libvlc_media_t * item;
235 } media_list_player_next_item_set;
237 /* snapshot taken */
238 struct
240 char* psz_filename ;
241 } media_player_snapshot_taken ;
243 /* Length changed */
244 struct
246 libvlc_time_t new_length;
247 } media_player_length_changed;
249 /* VLM media */
250 struct
252 const char * psz_media_name;
253 const char * psz_instance_name;
254 } vlm_media_event;
256 /* Extra MediaPlayer */
257 struct
259 libvlc_media_t * new_media;
260 } media_player_media_changed;
262 struct
264 libvlc_track_type_t i_type;
265 int i_id;
266 } media_player_es_changed;
268 struct
270 float volume;
271 } media_player_audio_volume;
273 struct
275 const char *device;
276 } media_player_audio_device;
278 struct
280 libvlc_renderer_item_t *item;
281 } renderer_discoverer_item_added;
282 struct
284 libvlc_renderer_item_t *item;
285 } renderer_discoverer_item_deleted;
286 } u; /**< Type-dependent event description */
287 } libvlc_event_t;
290 /**@} */
292 # ifdef __cplusplus
294 # endif
296 #endif /* _LIBVLC_EVENTS_H */