1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API structures
3 *****************************************************************************
4 * Copyright (C) 1998-2007 the VideoLAN team
7 * Authors: Filippo Carone <littlejohn@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
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 General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _LIBVLC_STRUCTURES_H
25 #define _LIBVLC_STRUCTURES_H 1
33 /** This structure is opaque. It represents a libvlc instance */
34 typedef struct libvlc_instance_t libvlc_instance_t;
36 /*****************************************************************************
38 *****************************************************************************/
40 /** defgroup libvlc_exception Exceptions
42 * LibVLC Exceptions handling
46 typedef struct libvlc_exception_t
55 /*****************************************************************************
57 *****************************************************************************/
58 /** defgroup libvlc_tag Tag
60 * LibVLC Tag support in media descriptor
64 typedef struct libvlc_tag_query_t libvlc_tag_query_t;
65 typedef char * libvlc_tag_t;
69 /*****************************************************************************
71 *****************************************************************************/
72 /** defgroup libvlc_time Time
74 * LibVLC Time support in libvlc
78 typedef vlc_int64_t libvlc_time_t;
82 /*****************************************************************************
84 *****************************************************************************/
85 /** defgroup libvlc_media_descriptor MediaDescriptor
87 * LibVLC Media Descriptor handling
92 /** defgroup libvlc_meta Meta
93 * \ingroup libvlc_media_descriptor
98 typedef enum libvlc_meta_t {
102 libvlc_meta_Copyright,
104 libvlc_meta_TrackNumber,
105 libvlc_meta_Description,
110 libvlc_meta_Language,
111 libvlc_meta_NowPlaying,
112 libvlc_meta_Publisher,
113 libvlc_meta_EncodedBy,
114 libvlc_meta_ArtworkURL,
120 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
125 /*****************************************************************************
127 *****************************************************************************/
128 /** defgroup libvlc_media_instance MediaInstance
130 * LibVLC Media Instance handling
134 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
136 typedef enum libvlc_state_t
138 libvlc_NothingSpecial,
150 /*****************************************************************************
152 *****************************************************************************/
153 /** defgroup libvlc_media_list MediaList
155 * LibVLC Media List handling
159 typedef struct libvlc_media_list_t libvlc_media_list_t;
160 typedef struct libvlc_media_list_view_t libvlc_media_list_view_t;
164 /*****************************************************************************
166 *****************************************************************************/
167 /** defgroup libvlc_media_list MediaList
169 * LibVLC Dynamic Media list: Media list with content synchronized with
174 typedef struct libvlc_dynamic_media_list_t libvlc_dynamic_media_list_t;
178 /*****************************************************************************
180 *****************************************************************************/
181 /** defgroup libvlc_media_list_player MediaListPlayer
183 * LibVLC Media List Player handling
187 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
191 /*****************************************************************************
193 *****************************************************************************/
194 /** defgroup libvlc_media_library Media Library
196 * LibVLC Media Library
200 typedef struct libvlc_media_library_t libvlc_media_library_t;
204 /*****************************************************************************
206 *****************************************************************************/
207 /** defgroup libvlc_playlist Playlist
209 * LibVLC Playlist handling
213 typedef struct libvlc_playlist_item_t
219 } libvlc_playlist_item_t;
224 /*****************************************************************************
226 *****************************************************************************/
227 /** defgroup libvlc_video Video
229 * LibVLC Video handling
234 * Downcast to this general type as placeholder for a platform specific one, such as:
236 * CGrafPort on MacOSX,
239 typedef int libvlc_drawable_t;
242 * Rectangle type for video geometry
244 typedef struct libvlc_rectangle_t
254 /*****************************************************************************
255 * Services/Media Discovery
256 *****************************************************************************/
257 /** defgroup libvlc_media_discoverer Media Discoverer
259 * LibVLC Media Discoverer
263 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
267 /*****************************************************************************
268 * Message log handling
269 *****************************************************************************/
271 /** defgroup libvlc_log Log
273 * LibVLC Message Logging
277 /** This structure is opaque. It represents a libvlc log instance */
278 typedef struct libvlc_log_t libvlc_log_t;
280 /** This structure is opaque. It represents a libvlc log iterator */
281 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
283 typedef struct libvlc_log_message_t
285 unsigned sizeof_msg; /* sizeof() of message structure, must be filled in by user */
286 int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
287 const char *psz_type; /* module type */
288 const char *psz_name; /* module name */
289 const char *psz_header; /* optional header */
290 const char *psz_message; /* message */
291 } libvlc_log_message_t;
295 /*****************************************************************************
297 *****************************************************************************/
299 /** defgroup libvlc_callbacks Callbacks
301 * LibVLC Event Callbacks
306 * Available events: (XXX: being reworked)
307 * - libvlc_MediaInstanceReachedEnd
310 typedef enum libvlc_event_type_t {
311 libvlc_MediaDescriptorMetaChanged,
312 libvlc_MediaDescriptorSubItemAdded,
313 libvlc_MediaDescriptorDurationChanged,
314 libvlc_MediaDescriptorPreparsedChanged,
315 libvlc_MediaDescriptorFreed,
316 libvlc_MediaDescriptorStateChanged,
318 libvlc_MediaInstancePlayed,
319 libvlc_MediaInstancePaused,
320 libvlc_MediaInstanceReachedEnd,
321 libvlc_MediaInstanceEncounteredError,
322 libvlc_MediaInstanceTimeChanged,
323 libvlc_MediaInstancePositionChanged,
324 libvlc_MediaInstanceSeekableChanged,
325 libvlc_MediaInstancePausableChanged,
327 libvlc_MediaListItemAdded,
328 libvlc_MediaListWillAddItem,
329 libvlc_MediaListItemDeleted,
330 libvlc_MediaListWillDeleteItem,
332 libvlc_MediaListViewItemAdded,
333 libvlc_MediaListViewWillAddItem,
334 libvlc_MediaListViewItemDeleted,
335 libvlc_MediaListViewWillDeleteItem,
337 libvlc_MediaListPlayerPlayed,
338 libvlc_MediaListPlayerNextItemSet,
339 libvlc_MediaListPlayerStopped,
341 libvlc_MediaDiscovererStarted,
342 libvlc_MediaDiscovererEnded
344 } libvlc_event_type_t;
348 * \param type the even type
349 * \param p_obj the sender object
350 * \param u Event dependent content
353 typedef struct libvlc_event_t
355 libvlc_event_type_t type;
357 union event_type_specific
359 /* media descriptor */
362 libvlc_meta_t meta_type;
363 } media_descriptor_meta_changed;
366 libvlc_media_descriptor_t * new_child;
367 } media_descriptor_subitem_added;
370 vlc_int64_t new_duration;
371 } media_descriptor_duration_changed;
375 } media_descriptor_preparsed_changed;
378 libvlc_media_descriptor_t * md;
379 } media_descriptor_freed;
382 libvlc_state_t new_state;
383 } media_descriptor_state_changed;
389 } media_instance_position_changed;
392 libvlc_time_t new_time;
393 } media_instance_time_changed;
396 libvlc_time_t new_seekable;
397 } media_instance_seekable_changed;
400 libvlc_time_t new_pausable;
401 } media_instance_pausable_changed;
406 libvlc_media_descriptor_t * item;
408 } media_list_item_added;
411 libvlc_media_descriptor_t * item;
413 } media_list_will_add_item;
416 libvlc_media_descriptor_t * item;
418 } media_list_item_deleted;
421 libvlc_media_descriptor_t * item;
423 } media_list_will_delete_item;
425 /* media list view */
428 libvlc_media_descriptor_t * item;
430 } media_list_view_item_added;
433 libvlc_media_descriptor_t * item;
435 } media_list_view_will_add_item;
438 libvlc_media_descriptor_t * item;
440 } media_list_view_item_deleted;
443 libvlc_media_descriptor_t * item;
445 } media_list_view_will_delete_item;
447 /* media discoverer */
451 } media_media_discoverer_started;
455 } media_media_discoverer_ended;
461 * Event manager that belongs to a libvlc object, and from whom events can
465 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
468 * Callback function notification
469 * \param p_event the event triggering the callback
472 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );