]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
76427ad3cf9aa8ec98d4ef487534459746fea31e
[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 /*****************************************************************************
214  * Video
215  *****************************************************************************/
216 /** \defgroup libvlc_video libvlc_video
217  * \ingroup libvlc_media_player
218  * LibVLC Video handling
219  * @{
220  */
221  
222 /**
223 * Downcast to this general type as placeholder for a platform specific one, such as:
224 *  Drawable on X11,
225 *  CGrafPort on MacOSX,
226 *  HWND on win32
227 */
228 typedef int libvlc_drawable_t;
229
230 /**
231 * Rectangle type for video geometry
232 */
233 typedef struct libvlc_rectangle_t
234 {
235     int top, left;
236     int bottom, right;
237 }
238 libvlc_rectangle_t;
239
240 /**@} */
241
242
243 /*****************************************************************************
244  * Services/Media Discovery
245  *****************************************************************************/
246 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
247  * \ingroup libvlc
248  * LibVLC Media Discoverer
249  * @{
250  */
251
252 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
253
254 /**@} */
255
256 /*****************************************************************************
257  * Message log handling
258  *****************************************************************************/
259
260 /** \defgroup libvlc_log libvlc_log
261  * \ingroup libvlc_core
262  * LibVLC Message Logging
263  * @{
264  */
265
266 /** This structure is opaque. It represents a libvlc log instance */
267 typedef struct libvlc_log_t libvlc_log_t;
268
269 /** This structure is opaque. It represents a libvlc log iterator */
270 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
271
272 typedef struct libvlc_log_message_t
273 {
274     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
275     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
276     const char *psz_type;     /* module type */
277     const char *psz_name;     /* module name */
278     const char *psz_header;   /* optional header */
279     const char *psz_message;  /* message */
280 } libvlc_log_message_t;
281
282 /**@} */
283
284 # ifdef __cplusplus
285 }
286 # endif
287
288 #endif