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