]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
libvlc: description and count of tracks, titles, chapters and subtitles
[vlc] / include / vlc / libvlc_structures.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API structures
3  *****************************************************************************
4  * Copyright (C) 1998-2008 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 /**
28  * \file
29  * This file defines libvlc_* new external API structures
30  */
31
32 #include <stdint.h>
33
34 # ifdef __cplusplus
35 extern "C" {
36 # endif
37
38 /** This structure is opaque. It represents a libvlc instance */
39 typedef struct libvlc_instance_t libvlc_instance_t;
40
41 /*****************************************************************************
42  * Exceptions
43  *****************************************************************************/
44
45 /** \defgroup libvlc_exception libvlc_exception
46  * \ingroup libvlc_core
47  * LibVLC Exceptions handling
48  * @{
49  */
50
51 typedef struct libvlc_exception_t
52 {
53     int b_raised;
54     int i_code;
55     char *psz_message;
56 } libvlc_exception_t;
57
58 /**@} */
59
60 /*****************************************************************************
61  * Time
62  *****************************************************************************/
63 /** \defgroup libvlc_time libvlc_time
64  * \ingroup libvlc_core
65  * LibVLC Time support in libvlc
66  * @{
67  */
68
69 typedef int64_t libvlc_time_t;
70
71 /**@} */
72
73 /*****************************************************************************
74  * Media Descriptor
75  *****************************************************************************/
76 /** \defgroup libvlc_media libvlc_media
77  * \ingroup libvlc
78  * LibVLC Media Descriptor handling
79  * @{
80  */
81
82 /* Meta Handling */
83 /** defgroup libvlc_meta libvlc_meta
84  * \ingroup libvlc_media
85  * LibVLC Media Meta
86  * @{
87  */
88
89 typedef enum libvlc_meta_t {
90     libvlc_meta_Title,
91     libvlc_meta_Artist,
92     libvlc_meta_Genre,
93     libvlc_meta_Copyright,
94     libvlc_meta_Album,
95     libvlc_meta_TrackNumber,
96     libvlc_meta_Description,
97     libvlc_meta_Rating,
98     libvlc_meta_Date,
99     libvlc_meta_Setting,
100     libvlc_meta_URL,
101     libvlc_meta_Language,
102     libvlc_meta_NowPlaying,
103     libvlc_meta_Publisher,
104     libvlc_meta_EncodedBy,
105     libvlc_meta_ArtworkURL,
106     libvlc_meta_TrackID
107 } libvlc_meta_t;
108
109 /**@} */
110
111 typedef struct libvlc_media_t libvlc_media_t;
112
113 /**@} */
114
115
116 /*****************************************************************************
117  * Media Instance
118  *****************************************************************************/
119 /** \defgroup libvlc_media_player libvlc_media_player
120  * \ingroup libvlc
121  * LibVLC Media Instance handling
122  * @{
123  */
124
125 typedef struct libvlc_media_player_t libvlc_media_player_t;
126
127 /**
128  * Note the order of libvlc_state_t enum must match exactly the order of
129  * @see mediacontrol_PlayerStatus and @see input_state_e enums.
130  *
131  * Expected states by web plugins are:
132  * IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
133  * STOPPING=5, FORWARD=6, BACKWARD=7, ENDED=8, ERROR=9
134  */
135 typedef enum libvlc_state_t
136 {
137     libvlc_NothingSpecial=0,
138     libvlc_Opening,
139     libvlc_Buffering,
140     libvlc_Playing,
141     libvlc_Paused,
142     libvlc_Stopped,
143     libvlc_Forward,
144     libvlc_Backward,
145     libvlc_Ended,
146     libvlc_Error
147 } libvlc_state_t;
148
149 /**@} */
150
151 /*****************************************************************************
152  * Media List
153  *****************************************************************************/
154 /** \defgroup libvlc_media_list libvlc_media_list
155  * \ingroup libvlc
156  * LibVLC Media List handling
157  * @{
158  */
159
160 typedef struct libvlc_media_list_t libvlc_media_list_t;
161 typedef struct libvlc_media_list_view_t libvlc_media_list_view_t;
162
163
164 /*****************************************************************************
165  * Media List Player
166  *****************************************************************************/
167 /** \defgroup libvlc_media_list_player libvlc_media_list_player
168  * \ingroup libvlc_media_list
169  * LibVLC Media List Player handling
170  * @{
171  */
172
173 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
174
175 /**@} libvlc_media_list_player */
176
177 /**@} libvlc_media_list */
178
179 /*****************************************************************************
180  * Media Library
181  *****************************************************************************/
182 /** \defgroup libvlc_media_library libvlc_media_library
183  * \ingroup libvlc
184  * LibVLC Media Library
185  * @{
186  */
187
188 typedef struct libvlc_media_library_t libvlc_media_library_t;
189
190 /**@} */
191
192 /*****************************************************************************
193  * Playlist
194  *****************************************************************************/
195 /** \defgroup libvlc_playlist libvlc_playlist (Deprecated)
196  * \ingroup libvlc
197  * LibVLC Playlist handling (Deprecated)
198  * @deprecated Use media_list
199  * @{
200  */
201
202 typedef struct libvlc_playlist_item_t
203 {
204     int i_id;
205     char * psz_uri;
206     char * psz_name;
207
208 } libvlc_playlist_item_t;
209
210 /**@} */
211
212 /*****************************************************************************
213  * Media Player
214  *****************************************************************************/
215 /** \defgroup libvlc_media_player libvlc_media_player
216  * \ingroup libvlc
217  * LibVLC Media Player, object that let you play a media
218  * in a libvlc_drawable_t
219  * @{
220  */
221
222 /**
223  * Description for video, audio tracks and subtitles. It contains
224  * id, name (description string) and pointer to next record.
225  */
226 typedef struct libvlc_track_description_t
227 {
228     int   i_id;
229     char *psz_name;
230     struct libvlc_track_description_t *p_next;
231
232 } libvlc_track_description_t;
233
234 /**@} */
235
236
237 /*****************************************************************************
238  * Video
239  *****************************************************************************/
240 /** \defgroup libvlc_video libvlc_video
241  * \ingroup libvlc_media_player
242  * LibVLC Video handling
243  * @{
244  */
245
246 /**
247 * Downcast to this general type as placeholder for a platform specific one, such as:
248 *  Drawable on X11,
249 *  CGrafPort on MacOSX,
250 *  HWND on win32
251 */
252 typedef int libvlc_drawable_t;
253
254 /**
255 * Rectangle type for video geometry
256 */
257 typedef struct libvlc_rectangle_t
258 {
259     int top, left;
260     int bottom, right;
261 }
262 libvlc_rectangle_t;
263
264 /**@} */
265
266
267 /*****************************************************************************
268  * Services/Media Discovery
269  *****************************************************************************/
270 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
271  * \ingroup libvlc
272  * LibVLC Media Discoverer
273  * @{
274  */
275
276 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
277
278 /**@} */
279
280 /*****************************************************************************
281  * Message log handling
282  *****************************************************************************/
283
284 /** \defgroup libvlc_log libvlc_log
285  * \ingroup libvlc_core
286  * LibVLC Message Logging
287  * @{
288  */
289
290 /** This structure is opaque. It represents a libvlc log instance */
291 typedef struct libvlc_log_t libvlc_log_t;
292
293 /** This structure is opaque. It represents a libvlc log iterator */
294 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
295
296 typedef struct libvlc_log_message_t
297 {
298     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
299     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
300     const char *psz_type;     /* module type */
301     const char *psz_name;     /* module name */
302     const char *psz_header;   /* optional header */
303     const char *psz_message;  /* message */
304 } libvlc_log_message_t;
305
306 /**@} */
307
308 # ifdef __cplusplus
309 }
310 # endif
311
312 #endif