VLC 4.0.0-dev
libvlc_events.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_events.h: libvlc_events external API structure
3 *****************************************************************************
4 * Copyright (C) 1998-2010 VLC authors and VideoLAN
5 *
6 * Authors: Filippo Carone <littlejohn@videolan.org>
7 * Pierre d'Herbemont <pdherbemont@videolan.org>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef LIBVLC_EVENTS_H
25#define LIBVLC_EVENTS_H 1
26
27/**
28 * \file
29 * This file defines libvlc_event external API
30 */
31
32# ifdef __cplusplus
33extern "C" {
34# else
35# include <stdbool.h>
36# endif
37
40
41/**
42 * \ingroup libvlc_event
43 * @{
44 */
45
46/**
47 * Event types
48 */
50 /* Append new event types at the end of a category.
51 * Do not remove, insert or re-order any entry.
52 */
53
54 /**
55 * Metadata of a \link #libvlc_media_t media item\endlink changed
56 */
58 /**
59 * Subitem was added to a \link #libvlc_media_t media item\endlink
60 * \see libvlc_media_subitems()
61 */
63 /**
64 * Duration of a \link #libvlc_media_t media item\endlink changed
65 * \see libvlc_media_get_duration()
66 */
68 /**
69 * Parsing state of a \link #libvlc_media_t media item\endlink changed
70 * \see libvlc_media_parse_request(),
71 * libvlc_media_get_parsed_status(),
72 * libvlc_media_parse_stop()
73 */
75
76 /* Removed: libvlc_MediaFreed, */
77 /* Removed: libvlc_MediaStateChanged */
78
79 /**
80 * Subitem tree was added to a \link #libvlc_media_t media item\endlink
81 */
83 /**
84 * A thumbnail generation for this \link #libvlc_media_t media \endlink completed.
85 * \see libvlc_media_thumbnail_request_by_time()
86 * \see libvlc_media_thumbnail_request_by_pos()
87 */
89 /**
90 * One or more embedded thumbnails were found during the media preparsing
91 * The user can hold these picture(s) using libvlc_picture_retain if they
92 * wish to use them
93 */
95
111 /* libvlc_MediaPlayerTitleChanged, */
115
116 /* libvlc_MediaPlayerScrambledChanged, use libvlc_MediaPlayerProgramUpdated */
117
118 /** A track was added, cf. media_player_es_changed in \ref libvlc_event_t.u
119 * to get the id of the new track. */
121 /** A track was removed, cf. media_player_es_changed in \ref
122 * libvlc_event_t.u to get the id of the removed track. */
124 /** Tracks were selected or unselected, cf.
125 * media_player_es_selection_changed in \ref libvlc_event_t.u to get the
126 * unselected and/or the selected track ids. */
134 /** A track was updated, cf. media_player_es_changed in \ref
135 * libvlc_event_t.u to get the id of the updated track. */
141 /**
142 * The title list changed, call
143 * libvlc_media_player_get_full_title_descriptions() to get the new list.
144 */
146 /**
147 * The title selection changed, cf media_player_title_selection_changed in
148 * \ref libvlc_event_t.u
149 */
153
154 /**
155 * A \link #libvlc_media_t media item\endlink was added to a
156 * \link #libvlc_media_list_t media list\endlink.
157 */
159 /**
160 * A \link #libvlc_media_t media item\endlink is about to get
161 * added to a \link #libvlc_media_list_t media list\endlink.
162 */
164 /**
165 * A \link #libvlc_media_t media item\endlink was deleted from
166 * a \link #libvlc_media_list_t media list\endlink.
167 */
169 /**
170 * A \link #libvlc_media_t media item\endlink is about to get
171 * deleted from a \link #libvlc_media_list_t media list\endlink.
172 */
174 /**
175 * A \link #libvlc_media_list_t media list\endlink has reached the
176 * end.
177 * All \link #libvlc_media_t items\endlink were either added (in
178 * case of a \ref libvlc_media_discoverer_t) or parsed (preparser).
179 */
181
182 /**
183 * \deprecated No longer used.
184 * This belonged to the removed libvlc_media_list_view_t
185 */
186 libvlc_MediaListViewItemAdded LIBVLC_DEPRECATED =0x300,
187 /**
188 * \deprecated No longer used.
189 * This belonged to the removed libvlc_media_list_view_t
190 */
191 libvlc_MediaListViewWillAddItem LIBVLC_DEPRECATED,
192 /**
193 * \deprecated No longer used.
194 * This belonged to the removed libvlc_media_list_view_t
195 */
196 libvlc_MediaListViewItemDeleted LIBVLC_DEPRECATED,
197 /**
198 * \deprecated No longer used.
199 * This belonged to the removed libvlc_media_list_view_t
200 */
201 libvlc_MediaListViewWillDeleteItem LIBVLC_DEPRECATED,
202
203 /**
204 * Playback of a \link #libvlc_media_list_player_t media list
205 * player\endlink has started.
206 */
208
209 /**
210 * The current \link #libvlc_media_t item\endlink of a
211 * \link #libvlc_media_list_player_t media list player\endlink
212 * has changed to a different item.
213 */
215
216 /**
217 * Playback of a \link #libvlc_media_list_player_t media list
218 * player\endlink has stopped.
219 */
221
222 /**
223 * A new \link #libvlc_renderer_item_t renderer item\endlink was found by a
224 * \link #libvlc_renderer_discoverer_t renderer discoverer\endlink.
225 * The renderer item is valid until deleted.
226 */
228
229 /**
230 * A previously discovered \link #libvlc_renderer_item_t renderer item\endlink
231 * was deleted by a \link #libvlc_renderer_discoverer_t renderer discoverer\endlink.
232 * The renderer item is no longer valid.
233 */
235};
236
237/**
238 * A LibVLC event
239 */
240typedef struct libvlc_event_t
241{
242 int type; /**< Event type (see @ref libvlc_event_e) */
243 void *p_obj; /**< Object emitting the event */
244 union
245 {
246 /* media descriptor */
247 struct
248 {
251 struct
252 {
255 struct
256 {
259 struct
260 {
261 int new_status; /**< see @ref libvlc_media_parsed_status_t */
263 struct
264 {
265 int new_state; /**< see @ref libvlc_state_t */
267 struct
268 {
271 struct
272 {
275 struct
276 {
279
280 /* media instance */
281 struct
282 {
285 struct
286 {
289 struct
290 {
293 struct
294 {
297 struct
298 {
300 int index;
302 struct
303 {
306 struct
307 {
310 struct
311 {
314 struct
315 {
318
319 /* media list */
320 struct
321 {
323 int index;
325 struct
326 {
328 int index;
330 struct
331 {
333 int index;
335 struct
336 {
338 int index;
340
341 /* media list player */
342 struct
343 {
346
347 /* snapshot taken */
348 struct
349 {
352
353 /* Length changed */
354 struct
355 {
358
359 /* Extra MediaPlayer */
360 struct
361 {
364
365 /* ESAdded, ESDeleted, ESUpdated */
366 struct
367 {
369 int i_id; /**< Deprecated, use psz_id */
370 /** Call libvlc_media_player_get_track_from_id() to get the track
371 * description. */
372 const char *psz_id;
374
375 /* ESSelected */
376 struct
377 {
379 const char *psz_unselected_id;
380 const char *psz_selected_id;
382
383 /* ProgramAdded, ProgramDeleted, ProgramUpdated */
384 struct
385 {
386 int i_id;
388
389 /* ProgramSelected */
390 struct
391 {
395
396 struct
397 {
398 float volume;
400
401 struct
402 {
403 const char *device;
405
406 struct
407 {
409 /** Only valid when recording ends (recording == false) */
412
413 struct
414 {
417 struct
418 {
421 } u; /**< Type-dependent event description */
423
424
425/**@} */
426
427# ifdef __cplusplus
428}
429# endif
430
431#endif /* _LIBVLC_EVENTS_H */
int64_t libvlc_time_t
Definition: libvlc.h:78
libvlc_event_e
Event types.
Definition: libvlc_events.h:49
struct libvlc_event_t libvlc_event_t
A LibVLC event.
@ libvlc_MediaPlayerTitleSelectionChanged
The title selection changed, cf media_player_title_selection_changed in libvlc_event_t::u.
Definition: libvlc_events.h:150
@ libvlc_MediaSubItemTreeAdded
Subitem tree was added to a media item.
Definition: libvlc_events.h:82
@ libvlc_MediaPlayerOpening
Definition: libvlc_events.h:98
@ libvlc_MediaPlayerTimeChanged
Definition: libvlc_events.h:107
@ libvlc_MediaPlayerRecordChanged
Definition: libvlc_events.h:152
@ libvlc_MediaSubItemAdded
Subitem was added to a media item.
Definition: libvlc_events.h:62
@ libvlc_MediaAttachedThumbnailsFound
One or more embedded thumbnails were found during the media preparsing The user can hold these pictur...
Definition: libvlc_events.h:94
@ libvlc_MediaPlayerUncorked
Definition: libvlc_events.h:129
@ libvlc_MediaMetaChanged
Metadata of a media item changed.
Definition: libvlc_events.h:57
@ LIBVLC_DEPRECATED
Definition: libvlc_events.h:186
@ libvlc_MediaPlayerSnapshotTaken
Definition: libvlc_events.h:112
@ libvlc_MediaPlayerESAdded
A track was added, cf.
Definition: libvlc_events.h:120
@ libvlc_MediaPlayerEncounteredError
Definition: libvlc_events.h:106
@ libvlc_MediaPlayerPlaying
Definition: libvlc_events.h:100
@ libvlc_MediaPlayerPositionChanged
Definition: libvlc_events.h:108
@ libvlc_MediaPlayerESDeleted
A track was removed, cf.
Definition: libvlc_events.h:123
@ libvlc_MediaPlayerProgramAdded
Definition: libvlc_events.h:137
@ libvlc_MediaDurationChanged
Duration of a media item changed.
Definition: libvlc_events.h:67
@ libvlc_MediaPlayerProgramUpdated
Definition: libvlc_events.h:140
@ libvlc_MediaPlayerESSelected
Tracks were selected or unselected, cf.
Definition: libvlc_events.h:127
@ libvlc_MediaPlayerNothingSpecial
Definition: libvlc_events.h:97
@ libvlc_MediaPlayerChapterChanged
Definition: libvlc_events.h:151
@ libvlc_MediaPlayerTitleListChanged
The title list changed, call libvlc_media_player_get_full_title_descriptions() to get the new list.
Definition: libvlc_events.h:145
@ libvlc_MediaPlayerUnmuted
Definition: libvlc_events.h:131
@ libvlc_MediaPlayerBuffering
Definition: libvlc_events.h:99
@ libvlc_RendererDiscovererItemAdded
A new renderer item was found by a renderer discoverer.
Definition: libvlc_events.h:227
@ libvlc_MediaPlayerAudioVolume
Definition: libvlc_events.h:132
@ libvlc_MediaListPlayerNextItemSet
The current item of a media list player has changed to a different item.
Definition: libvlc_events.h:214
@ libvlc_MediaPlayerCorked
Definition: libvlc_events.h:128
@ libvlc_MediaListItemDeleted
A media item was deleted from a media list.
Definition: libvlc_events.h:168
@ libvlc_MediaListPlayerStopped
Playback of a media list player has stopped.
Definition: libvlc_events.h:220
@ libvlc_MediaPlayerStopping
Definition: libvlc_events.h:105
@ libvlc_MediaThumbnailGenerated
A thumbnail generation for this media completed.
Definition: libvlc_events.h:88
@ libvlc_MediaPlayerAudioDevice
Definition: libvlc_events.h:133
@ libvlc_MediaListWillAddItem
A media item is about to get added to a media list.
Definition: libvlc_events.h:163
@ libvlc_MediaParsedChanged
Parsing state of a media item changed.
Definition: libvlc_events.h:74
@ libvlc_MediaPlayerMuted
Definition: libvlc_events.h:130
@ libvlc_MediaListPlayerPlayed
Playback of a media list player has started.
Definition: libvlc_events.h:207
@ libvlc_MediaPlayerVout
Definition: libvlc_events.h:114
@ libvlc_MediaListItemAdded
A media item was added to a media list.
Definition: libvlc_events.h:158
@ libvlc_MediaPlayerPausableChanged
Definition: libvlc_events.h:110
@ libvlc_MediaPlayerProgramDeleted
Definition: libvlc_events.h:138
@ libvlc_MediaPlayerPaused
Definition: libvlc_events.h:101
@ libvlc_MediaPlayerProgramSelected
Definition: libvlc_events.h:139
@ libvlc_MediaPlayerESUpdated
A track was updated, cf.
Definition: libvlc_events.h:136
@ libvlc_MediaPlayerLengthChanged
Definition: libvlc_events.h:113
@ libvlc_MediaPlayerSeekableChanged
Definition: libvlc_events.h:109
@ libvlc_MediaListEndReached
A media list has reached the end.
Definition: libvlc_events.h:180
@ libvlc_MediaListWillDeleteItem
A media item is about to get deleted from a media list.
Definition: libvlc_events.h:173
@ libvlc_MediaPlayerForward
Definition: libvlc_events.h:103
@ libvlc_MediaPlayerBackward
Definition: libvlc_events.h:104
@ libvlc_RendererDiscovererItemDeleted
A previously discovered renderer item was deleted by a renderer discoverer.
Definition: libvlc_events.h:234
@ libvlc_MediaPlayerStopped
Definition: libvlc_events.h:102
@ libvlc_MediaPlayerMediaChanged
Definition: libvlc_events.h:96
libvlc_track_type_t
Definition: libvlc_media_track.h:43
libvlc_meta_t
Meta data types.
Definition: libvlc_media.h:49
struct libvlc_media_t libvlc_media_t
Definition: libvlc_media.h:46
struct libvlc_renderer_item_t libvlc_renderer_item_t
Definition: libvlc_events.h:38
struct libvlc_picture_t libvlc_picture_t
Definition: libvlc_picture.h:30
struct libvlc_picture_list_t libvlc_picture_list_t
Definition: libvlc_picture.h:31
A LibVLC event.
Definition: libvlc_events.h:241
struct libvlc_event_t::@140::@169 media_player_program_selection_changed
int type
Event type (see libvlc_event_e)
Definition: libvlc_events.h:242
const libvlc_title_description_t * title
Definition: libvlc_events.h:299
struct libvlc_event_t::@140::@164 media_player_length_changed
libvlc_media_t * new_media
Definition: libvlc_events.h:362
float volume
Definition: libvlc_events.h:398
int new_seekable
Definition: libvlc_events.h:304
int new_pausable
Definition: libvlc_events.h:308
libvlc_picture_list_t * thumbnails
Definition: libvlc_events.h:277
libvlc_time_t new_length
Definition: libvlc_events.h:356
double new_position
Definition: libvlc_events.h:291
struct libvlc_event_t::@140::@159 media_list_will_add_item
libvlc_time_t new_time
Definition: libvlc_events.h:295
struct libvlc_event_t::@140::@154 media_player_seekable_changed
void * p_obj
Object emitting the event.
Definition: libvlc_events.h:243
struct libvlc_event_t::@140::@170 media_player_audio_volume
libvlc_media_t * new_child
Definition: libvlc_events.h:253
libvlc_track_type_t i_type
Definition: libvlc_events.h:368
union libvlc_event_t::@140 u
Type-dependent event description.
struct libvlc_event_t::@140::@151 media_player_position_changed
int new_state
see libvlc_state_t
Definition: libvlc_events.h:265
struct libvlc_event_t::@140::@142 media_subitem_added
const char * recorded_file_path
Only valid when recording ends (recording == false)
Definition: libvlc_events.h:410
struct libvlc_event_t::@140::@172 media_player_record_changed
struct libvlc_event_t::@140::@160 media_list_item_deleted
libvlc_picture_t * p_thumbnail
Definition: libvlc_events.h:269
int i_unselected_id
Definition: libvlc_events.h:392
struct libvlc_event_t::@140::@152 media_player_time_changed
struct libvlc_event_t::@140::@149 media_player_buffering
struct libvlc_event_t::@140::@173 renderer_discoverer_item_added
struct libvlc_event_t::@140::@162 media_list_player_next_item_set
const char * psz_selected_id
Definition: libvlc_events.h:380
float new_cache
Definition: libvlc_events.h:283
struct libvlc_event_t::@140::@148 media_attached_thumbnails_found
struct libvlc_event_t::@140::@163 media_player_snapshot_taken
const char * psz_unselected_id
Definition: libvlc_events.h:379
struct libvlc_event_t::@140::@167 media_player_es_selection_changed
struct libvlc_event_t::@140::@166 media_player_es_changed
int i_selected_id
Definition: libvlc_events.h:393
struct libvlc_event_t::@140::@155 media_player_pausable_changed
int new_count
Definition: libvlc_events.h:316
struct libvlc_event_t::@140::@147 media_subitemtree_added
const char * psz_id
Call libvlc_media_player_get_track_from_id() to get the track description.
Definition: libvlc_events.h:372
struct libvlc_event_t::@140::@165 media_player_media_changed
struct libvlc_event_t::@140::@153 media_player_title_selection_changed
int new_scrambled
Definition: libvlc_events.h:312
bool recording
Definition: libvlc_events.h:408
char * psz_filename
Definition: libvlc_events.h:350
const char * device
Definition: libvlc_events.h:403
struct libvlc_event_t::@140::@171 media_player_audio_device
struct libvlc_event_t::@140::@158 media_list_item_added
libvlc_media_t * item
Definition: libvlc_events.h:273
struct libvlc_event_t::@140::@144 media_parsed_changed
int64_t new_duration
Definition: libvlc_events.h:257
int i_id
Deprecated, use psz_id.
Definition: libvlc_events.h:369
struct libvlc_event_t::@140::@143 media_duration_changed
struct libvlc_event_t::@140::@141 media_meta_changed
struct libvlc_event_t::@140::@161 media_list_will_delete_item
libvlc_meta_t meta_type
Definition: libvlc_events.h:249
struct libvlc_event_t::@140::@156 media_player_scrambled_changed
struct libvlc_event_t::@140::@145 media_state_changed
int new_chapter
Definition: libvlc_events.h:287
struct libvlc_event_t::@140::@146 media_thumbnail_generated
libvlc_renderer_item_t * item
Definition: libvlc_events.h:415
struct libvlc_event_t::@140::@174 renderer_discoverer_item_deleted
int new_status
see libvlc_media_parsed_status_t
Definition: libvlc_events.h:261
struct libvlc_event_t::@140::@157 media_player_vout
struct libvlc_event_t::@140::@150 media_player_chapter_changed
int index
Definition: libvlc_events.h:300
struct libvlc_event_t::@140::@168 media_player_program_changed
Definition: libvlc_media_player.h:54