]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
control/media_descriptor.c: Basic unamed tag support which will soon move to core.
[vlc] / include / vlc / libvlc_structures.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API structures
3  *****************************************************************************
4  * Copyright (C) 1998-2007 the VideoLAN team
5  * $Id $
6  *
7  * Authors: Filippo Carone <littlejohn@videolan.org>
8  *
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.
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 General Public License for more details.
18  *
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  *****************************************************************************/
23
24 #ifndef _LIBVLC_STRUCTURES_H
25 #define _LIBVLC_STRUCTURES_H 1
26
27 #include <vlc/vlc.h>
28
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32
33 /** This structure is opaque. It represents a libvlc instance */
34 typedef struct libvlc_instance_t libvlc_instance_t;
35
36 /*****************************************************************************
37  * Exceptions
38  *****************************************************************************/
39
40 /** defgroup libvlc_exception Exceptions
41  * \ingroup libvlc
42  * LibVLC Exceptions handling
43  * @{
44  */
45
46 typedef struct libvlc_exception_t
47 {
48     int b_raised;
49     int i_code;
50     char *psz_message;
51 } libvlc_exception_t;
52
53 /**@} */
54
55 /*****************************************************************************
56  * Tag
57  *****************************************************************************/
58 /** defgroup libvlc_tag Tag
59  * \ingroup libvlc
60  * LibVLC Tag  support in media descriptor
61  * @{
62  */
63
64 typedef struct libvlc_tag_query_t libvlc_tag_query_t;
65 typedef char * libvlc_tag_t;
66
67 /**@} */
68
69 /*****************************************************************************
70  * Media Descriptor
71  *****************************************************************************/
72 /** defgroup libvlc_media_descriptor MediaDescriptor
73  * \ingroup libvlc
74  * LibVLC Media Descriptor handling
75  * @{
76  */
77
78 /* Meta Handling */
79 /** defgroup libvlc_meta Meta
80  * \ingroup libvlc_media_descriptor
81  * LibVLC Media Meta
82  * @{
83  */
84
85 typedef enum libvlc_meta_t {
86     libvlc_meta_Title,
87     libvlc_meta_Artist,
88     libvlc_meta_Genre,
89     libvlc_meta_Copyright,
90     libvlc_meta_Album,
91     libvlc_meta_TrackNumber,
92     libvlc_meta_Description,
93     libvlc_meta_Rating,
94     libvlc_meta_Date,
95     libvlc_meta_Setting,
96     libvlc_meta_URL,
97     libvlc_meta_Language,
98     libvlc_meta_NowPlaying,
99     libvlc_meta_Publisher,
100     libvlc_meta_EncodedBy,
101     libvlc_meta_ArtworkURL,
102     libvlc_meta_TrackID
103 } libvlc_meta_t;
104
105 /**@} */
106
107 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
108
109 /**@} */
110
111
112 /*****************************************************************************
113  * Media Instance
114  *****************************************************************************/
115 /** defgroup libvlc_media_instance MediaInstance
116  * \ingroup libvlc
117  * LibVLC Media Instance handling
118  * @{
119  */
120
121 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
122
123 /**@} */
124
125 /*****************************************************************************
126  * Media List
127  *****************************************************************************/
128 /** defgroup libvlc_media_list MediaList
129  * \ingroup libvlc
130  * LibVLC Media List handling
131  * @{
132  */
133
134 typedef struct libvlc_media_list_t libvlc_media_list_t;
135
136 /**@} */
137
138 /*****************************************************************************
139  * Media List Player
140  *****************************************************************************/
141 /** defgroup libvlc_media_list_player MediaListPlayer
142  * \ingroup libvlc
143  * LibVLC Media List Player handling
144  * @{
145  */
146
147 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
148
149 /**@} */
150
151 /*****************************************************************************
152  * Media Library
153  *****************************************************************************/
154 /** defgroup libvlc_media_library Media Library
155  * \ingroup libvlc
156  * LibVLC Media Library
157  * @{
158  */
159
160 typedef struct libvlc_media_library_t libvlc_media_library_t;
161
162 /**@} */
163
164 /*****************************************************************************
165  * Playlist
166  *****************************************************************************/
167 /** defgroup libvlc_playlist Playlist
168  * \ingroup libvlc
169  * LibVLC Playlist handling
170  * @{
171  */
172
173 typedef struct libvlc_playlist_item_t
174 {
175     int i_id;
176     char * psz_uri;
177     char * psz_name;
178
179 } libvlc_playlist_item_t;
180
181 /**@} */
182
183
184 /*****************************************************************************
185  * Video
186  *****************************************************************************/
187 /** defgroup libvlc_video Video
188  * \ingroup libvlc
189  * LibVLC Video handling
190  * @{
191  */
192     
193 /**
194 * Downcast to this general type as placeholder for a platform specific one, such as:
195 *  Drawable on X11,
196 *  CGrafPort on MacOSX,
197 *  HWND on win32
198 */
199 typedef int libvlc_drawable_t;
200
201 /**
202 * Rectangle type for video geometry
203 */
204 typedef struct libvlc_rectangle_t
205 {
206     int top, left;
207     int bottom, right;
208 }
209 libvlc_rectangle_t;
210
211 /**@} */
212
213
214 /*****************************************************************************
215  * Services/Media Discovery
216  *****************************************************************************/
217 /** defgroup libvlc_media_discoverer Media Discoverer
218  * \ingroup libvlc
219  * LibVLC Media Discoverer
220  * @{
221  */
222
223 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
224
225 /**@} */
226
227 /*****************************************************************************
228  * Message log handling
229  *****************************************************************************/
230
231 /** defgroup libvlc_log Log
232  * \ingroup libvlc
233  * LibVLC Message Logging
234  * @{
235  */
236
237 /** This structure is opaque. It represents a libvlc log instance */
238 typedef struct libvlc_log_t libvlc_log_t;
239
240 /** This structure is opaque. It represents a libvlc log iterator */
241 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
242
243 typedef struct libvlc_log_message_t
244 {
245     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
246     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
247     const char *psz_type;     /* module type */
248     const char *psz_name;     /* module name */
249     const char *psz_header;   /* optional header */
250     const char *psz_message;  /* message */
251 } libvlc_log_message_t;
252
253 /**@} */
254
255 /*****************************************************************************
256  * Callbacks handling
257  *****************************************************************************/
258
259 /** defgroup libvlc_callbacks Callbacks
260  * \ingroup libvlc
261  * LibVLC Event Callbacks
262  * @{
263  */
264     
265 /**
266  * Available events: (XXX: being reworked)
267  * - libvlc_MediaInstanceReachedEnd
268  */
269
270 typedef enum libvlc_event_type_t {
271     libvlc_MediaDescriptorMetaChanged,
272     libvlc_MediaDescriptorSubItemAdded,
273
274     libvlc_MediaInstanceReachedEnd,
275
276     libvlc_MediaListItemAdded,
277     libvlc_MediaListItemDeleted,
278     libvlc_MediaListItemChanged,
279
280 } libvlc_event_type_t;
281
282 /**
283  * An Event
284  * \param type the even type
285  * \param p_obj the sender object
286  * \param u Event dependent content
287  */
288
289 typedef struct libvlc_event_t
290 {
291     libvlc_event_type_t type;
292     void * p_obj;
293     union event_type_specific
294     {
295         /* media descriptor */
296         struct
297         {
298             libvlc_meta_t meta_type;
299         } media_descriptor_meta_changed;
300         struct
301         {
302             libvlc_media_descriptor_t * new_child;
303         } media_descriptor_subitem_added;
304
305         /* media list */
306         struct
307         {
308             libvlc_media_descriptor_t * item;
309             int index;
310         } media_list_item_added;
311         struct
312         {
313             libvlc_media_descriptor_t * item;
314             int index;
315         } media_list_item_deleted;
316         struct
317         {
318             libvlc_media_descriptor_t * item;
319             int index;
320         } media_list_item_changed;
321     } u;
322 } libvlc_event_t;
323
324 /**
325  * Event manager that belongs to a libvlc object, and from whom events can
326  * be received.
327  */
328
329 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
330
331 /**
332  * Callback function notification
333  * \param p_event the event triggering the callback
334  */
335
336 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
337
338 /**@} */
339
340 # ifdef __cplusplus
341 }
342 # endif
343
344 #endif