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_media_descriptor MediaDescriptor
74 * LibVLC Media Descriptor handling
79 /** defgroup libvlc_meta Meta
80 * \ingroup libvlc_media_descriptor
85 typedef enum libvlc_meta_t {
89 libvlc_meta_Copyright,
91 libvlc_meta_TrackNumber,
92 libvlc_meta_Description,
98 libvlc_meta_NowPlaying,
99 libvlc_meta_Publisher,
100 libvlc_meta_EncodedBy,
101 libvlc_meta_ArtworkURL,
107 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
112 /*****************************************************************************
114 *****************************************************************************/
115 /** defgroup libvlc_media_instance MediaInstance
117 * LibVLC Media Instance handling
121 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
123 typedef enum libvlc_state_t
125 libvlc_NothingSpecial,
137 /*****************************************************************************
139 *****************************************************************************/
140 /** defgroup libvlc_media_list MediaList
142 * LibVLC Media List handling
146 typedef struct libvlc_media_list_t libvlc_media_list_t;
147 typedef struct libvlc_media_list_view_t libvlc_media_list_view_t;
151 /*****************************************************************************
153 *****************************************************************************/
154 /** defgroup libvlc_media_list MediaList
156 * LibVLC Dynamic Media list: Media list with content synchronized with
161 typedef struct libvlc_dynamic_media_list_t libvlc_dynamic_media_list_t;
165 /*****************************************************************************
167 *****************************************************************************/
168 /** defgroup libvlc_media_list_player MediaListPlayer
170 * LibVLC Media List Player handling
174 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
178 /*****************************************************************************
180 *****************************************************************************/
181 /** defgroup libvlc_media_library Media Library
183 * LibVLC Media Library
187 typedef struct libvlc_media_library_t libvlc_media_library_t;
191 /*****************************************************************************
193 *****************************************************************************/
194 /** defgroup libvlc_playlist Playlist
196 * LibVLC Playlist handling
200 typedef struct libvlc_playlist_item_t
206 } libvlc_playlist_item_t;
211 /*****************************************************************************
213 *****************************************************************************/
214 /** defgroup libvlc_video Video
216 * LibVLC Video handling
221 * Downcast to this general type as placeholder for a platform specific one, such as:
223 * CGrafPort on MacOSX,
226 typedef int libvlc_drawable_t;
229 * Rectangle type for video geometry
231 typedef struct libvlc_rectangle_t
241 /*****************************************************************************
242 * Services/Media Discovery
243 *****************************************************************************/
244 /** defgroup libvlc_media_discoverer Media Discoverer
246 * LibVLC Media Discoverer
250 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
254 /*****************************************************************************
255 * Message log handling
256 *****************************************************************************/
258 /** defgroup libvlc_log Log
260 * LibVLC Message Logging
264 /** This structure is opaque. It represents a libvlc log instance */
265 typedef struct libvlc_log_t libvlc_log_t;
267 /** This structure is opaque. It represents a libvlc log iterator */
268 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
270 typedef struct libvlc_log_message_t
272 unsigned sizeof_msg; /* sizeof() of message structure, must be filled in by user */
273 int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
274 const char *psz_type; /* module type */
275 const char *psz_name; /* module name */
276 const char *psz_header; /* optional header */
277 const char *psz_message; /* message */
278 } libvlc_log_message_t;
282 /*****************************************************************************
284 *****************************************************************************/
286 /** defgroup libvlc_callbacks Callbacks
288 * LibVLC Event Callbacks
293 * Available events: (XXX: being reworked)
294 * - libvlc_MediaInstanceReachedEnd
297 typedef enum libvlc_event_type_t {
298 libvlc_MediaDescriptorMetaChanged,
299 libvlc_MediaDescriptorSubItemAdded,
300 libvlc_MediaDescriptorDurationChanged,
301 libvlc_MediaDescriptorPreparsedChanged,
302 libvlc_MediaDescriptorFreed,
303 libvlc_MediaDescriptorStateChanged,
305 libvlc_MediaInstancePlayed,
306 libvlc_MediaInstancePaused,
307 libvlc_MediaInstanceReachedEnd,
308 libvlc_MediaInstanceTimeChanged,
309 libvlc_MediaInstancePositionChanged,
311 libvlc_MediaListItemAdded,
312 libvlc_MediaListWillAddItem,
313 libvlc_MediaListItemDeleted,
314 libvlc_MediaListWillDeleteItem,
316 libvlc_MediaListViewItemAdded,
317 libvlc_MediaListViewWillAddItem,
318 libvlc_MediaListViewItemDeleted,
319 libvlc_MediaListViewWillDeleteItem,
321 libvlc_MediaListPlayerPlayed,
322 libvlc_MediaListPlayerNextItemSet,
323 libvlc_MediaListPlayerStopped,
325 libvlc_MediaDiscovererStarted,
326 libvlc_MediaDiscovererEnded
328 } libvlc_event_type_t;
332 * \param type the even type
333 * \param p_obj the sender object
334 * \param u Event dependent content
337 typedef struct libvlc_event_t
339 libvlc_event_type_t type;
341 union event_type_specific
343 /* media descriptor */
346 libvlc_meta_t meta_type;
347 } media_descriptor_meta_changed;
350 libvlc_media_descriptor_t * new_child;
351 } media_descriptor_subitem_added;
354 vlc_int64_t new_duration;
355 } media_descriptor_duration_changed;
359 } media_descriptor_preparsed_changed;
362 libvlc_media_descriptor_t * md;
363 } media_descriptor_freed;
366 libvlc_state_t new_state;
367 } media_descriptor_state_changed;
373 } media_instance_position_changed;
377 } media_instance_time_changed;
382 libvlc_media_descriptor_t * item;
384 } media_list_item_added;
387 libvlc_media_descriptor_t * item;
389 } media_list_will_add_item;
392 libvlc_media_descriptor_t * item;
394 } media_list_item_deleted;
397 libvlc_media_descriptor_t * item;
399 } media_list_will_delete_item;
401 /* media list view */
404 libvlc_media_descriptor_t * item;
406 } media_list_view_item_added;
409 libvlc_media_descriptor_t * item;
411 } media_list_view_will_add_item;
414 libvlc_media_descriptor_t * item;
416 } media_list_view_item_deleted;
419 libvlc_media_descriptor_t * item;
421 } media_list_view_will_delete_item;
423 /* media discoverer */
427 } media_media_discoverer_started;
431 } media_media_discoverer_ended;
437 * Event manager that belongs to a libvlc object, and from whom events can
441 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
444 * Callback function notification
445 * \param p_event the event triggering the callback
448 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );