]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
Libvlc: Start the implementation of the libvlc playlist. Still in progress.
[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_t;
88
89 /**@} */
90
91 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
92
93 /**@} */
94
95
96 /*****************************************************************************
97  * Media Instance
98  *****************************************************************************/
99 /** defgroup libvlc_media_instance MediaInstance
100  * \ingroup libvlc
101  * LibVLC Media Instance handling
102  * @{
103  */
104
105 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
106
107 /**@} */
108
109 /*****************************************************************************
110  * Media List
111  *****************************************************************************/
112 /** defgroup libvlc_media_list MediaList
113  * \ingroup libvlc
114  * LibVLC Media List handling
115  * @{
116  */
117
118 typedef struct libvlc_media_list_t libvlc_media_list_t;
119
120 /**@} */
121
122 /*****************************************************************************
123  * Media List Player
124  *****************************************************************************/
125 /** defgroup libvlc_media_list_player MediaListPlayer
126  * \ingroup libvlc
127  * LibVLC Media List Player handling
128  * @{
129  */
130
131 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
132
133 /**@} */
134
135 /*****************************************************************************
136  * Playlist
137  *****************************************************************************/
138 /** defgroup libvlc_playlist Playlist
139  * \ingroup libvlc
140  * LibVLC Playlist handling
141  * @{
142  */
143
144 typedef struct libvlc_playlist_item_t
145 {
146     int i_id;
147     char * psz_uri;
148     char * psz_name;
149
150 } libvlc_playlist_item_t;
151
152 /**@} */
153
154
155 /*****************************************************************************
156  * Video
157  *****************************************************************************/
158 /** defgroup libvlc_video Video
159  * \ingroup libvlc
160  * LibVLC Video handling
161  * @{
162  */
163     
164 /**
165 * Downcast to this general type as placeholder for a platform specific one, such as:
166 *  Drawable on X11,
167 *  CGrafPort on MacOSX,
168 *  HWND on win32
169 */
170 typedef int libvlc_drawable_t;
171
172 /**
173 * Rectangle type for video geometry
174 */
175 typedef struct libvlc_rectangle_t
176 {
177     int top, left;
178     int bottom, right;
179 }
180 libvlc_rectangle_t;
181
182 /**@} */
183
184
185 /*****************************************************************************
186  * Message log handling
187  *****************************************************************************/
188
189 /** defgroup libvlc_log Log
190  * \ingroup libvlc
191  * LibVLC Message Logging
192  * @{
193  */
194
195 /** This structure is opaque. It represents a libvlc log instance */
196 typedef struct libvlc_log_t libvlc_log_t;
197
198 /** This structure is opaque. It represents a libvlc log iterator */
199 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
200
201 typedef struct libvlc_log_message_t
202 {
203     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
204     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
205     const char *psz_type;     /* module type */
206     const char *psz_name;     /* module name */
207     const char *psz_header;   /* optional header */
208     const char *psz_message;  /* message */
209 } libvlc_log_message_t;
210
211 /**@} */
212
213 /*****************************************************************************
214  * Callbacks handling
215  *****************************************************************************/
216
217 /** defgroup libvlc_callbacks Callbacks
218  * \ingroup libvlc
219  * LibVLC Event Callbacks
220  * @{
221  */
222     
223 /**
224  * Available events: (XXX: being reworked)
225  * - libvlc_MediaInstanceReachedEnd
226  */
227
228 typedef enum libvlc_event_type_t {
229     libvlc_MediaInstanceReachedEnd,
230     libvlc_MediaListItemAdded,
231     libvlc_MediaListItemDeleted,
232     libvlc_MediaListItemChanged,
233 } libvlc_event_type_t;
234
235 /**
236  * An Event
237  * \param type the even type
238  * \param p_obj the sender object
239  * \param u Event dependent content
240  */
241
242 typedef struct libvlc_event_t
243 {
244     libvlc_event_type_t type;
245     void * p_obj;
246     union event_type_specific
247     {
248         struct
249         {
250             libvlc_media_descriptor_t * item;
251             int index;
252         } media_list_item_added;
253         struct
254         {
255             libvlc_media_descriptor_t * item;
256             int index;
257         } media_list_item_deleted;
258         struct
259         {
260             libvlc_media_descriptor_t * item;
261             int index;
262         } media_list_item_changed;
263     } u;
264 } libvlc_event_t;
265
266 /**
267  * Event manager that belongs to a libvlc object, and from whom events can
268  * be received.
269  */
270
271 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
272
273 /**
274  * Callback function notification
275  * \param p_event the event triggering the callback
276  */
277
278 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
279
280 /**@} */
281
282 # ifdef __cplusplus
283 }
284 # endif
285
286 #endif