]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
Separate libvlccore and libvlc headers
[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 #if defined (WIN32) && defined (DLL_EXPORT)
28 # define VLC_PUBLIC_API __declspec(dllexport)
29 #else
30 # define VLC_PUBLIC_API
31 #endif
32
33 #ifdef __LIBVLC__
34 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
35 #   define VLC_DEPRECATED_API VLC_PUBLIC_API
36 #elif defined(__GNUC__) && \
37       (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
38 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
39 #else
40 # define VLC_DEPRECATED_API VLC_PUBLIC_API
41 #endif
42
43 #if (defined( WIN32 ) || defined( UNDER_CE )) && !defined( __MINGW32__ )
44 typedef signed __int64 vlc_int64_t;
45 # else
46 typedef signed long long vlc_int64_t;
47 #endif
48
49 # ifdef __cplusplus
50 extern "C" {
51 # endif
52
53 /** This structure is opaque. It represents a libvlc instance */
54 typedef struct libvlc_instance_t libvlc_instance_t;
55
56 /*****************************************************************************
57  * Exceptions
58  *****************************************************************************/
59
60 /** \defgroup libvlc_exception libvlc_exception
61  * \ingroup libvlc_core
62  * LibVLC Exceptions handling
63  * @{
64  */
65
66 typedef struct libvlc_exception_t
67 {
68     int b_raised;
69     int i_code;
70     char *psz_message;
71 } libvlc_exception_t;
72
73 /**@} */
74
75 /*****************************************************************************
76  * Time
77  *****************************************************************************/
78 /** \defgroup libvlc_time libvlc_time
79  * \ingroup libvlc_core
80  * LibVLC Time support in libvlc
81  * @{
82  */
83
84 typedef vlc_int64_t libvlc_time_t;
85
86 /**@} */
87
88 /*****************************************************************************
89  * Media Descriptor
90  *****************************************************************************/
91 /** \defgroup libvlc_media libvlc_media
92  * \ingroup libvlc
93  * LibVLC Media Descriptor handling
94  * @{
95  */
96
97 /* Meta Handling */
98 /** defgroup libvlc_meta libvlc_meta
99  * \ingroup libvlc_media
100  * LibVLC Media Meta
101  * @{
102  */
103
104 typedef enum libvlc_meta_t {
105     libvlc_meta_Title,
106     libvlc_meta_Artist,
107     libvlc_meta_Genre,
108     libvlc_meta_Copyright,
109     libvlc_meta_Album,
110     libvlc_meta_TrackNumber,
111     libvlc_meta_Description,
112     libvlc_meta_Rating,
113     libvlc_meta_Date,
114     libvlc_meta_Setting,
115     libvlc_meta_URL,
116     libvlc_meta_Language,
117     libvlc_meta_NowPlaying,
118     libvlc_meta_Publisher,
119     libvlc_meta_EncodedBy,
120     libvlc_meta_ArtworkURL,
121     libvlc_meta_TrackID
122 } libvlc_meta_t;
123
124 /**@} */
125
126 typedef struct libvlc_media_t libvlc_media_t;
127
128 /**@} */
129
130
131 /*****************************************************************************
132  * Media Instance
133  *****************************************************************************/
134 /** \defgroup libvlc_media_player libvlc_media_player
135  * \ingroup libvlc
136  * LibVLC Media Instance handling
137  * @{
138  */
139
140 typedef struct libvlc_media_player_t libvlc_media_player_t;
141
142 typedef enum libvlc_state_t
143 {
144     libvlc_NothingSpecial,
145     libvlc_Stopped,
146     libvlc_Opening,
147     libvlc_Buffering,
148     libvlc_Ended,
149     libvlc_Error,
150     libvlc_Playing,
151     libvlc_Paused
152 } libvlc_state_t;
153
154 /**@} */
155
156 /*****************************************************************************
157  * Media List
158  *****************************************************************************/
159 /** \defgroup libvlc_media_list libvlc_media_list
160  * \ingroup libvlc
161  * LibVLC Media List handling
162  * @{
163  */
164
165 typedef struct libvlc_media_list_t libvlc_media_list_t;
166 typedef struct libvlc_media_list_view_t libvlc_media_list_view_t;
167
168
169 /*****************************************************************************
170  * Media List Player
171  *****************************************************************************/
172 /** \defgroup libvlc_media_list_player libvlc_media_list_player
173  * \ingroup libvlc_media_list
174  * LibVLC Media List Player handling
175  * @{
176  */
177
178 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
179
180 /**@} libvlc_media_list_player */
181
182 /**@} libvlc_media_list */
183
184 /*****************************************************************************
185  * Media Library
186  *****************************************************************************/
187 /** \defgroup libvlc_media_library libvlc_media_library
188  * \ingroup libvlc
189  * LibVLC Media Library
190  * @{
191  */
192
193 typedef struct libvlc_media_library_t libvlc_media_library_t;
194
195 /**@} */
196
197 /*****************************************************************************
198  * Playlist
199  *****************************************************************************/
200 /** \defgroup libvlc_playlist libvlc_playlist (Deprecated)
201  * \ingroup libvlc
202  * LibVLC Playlist handling (Deprecated)
203  * @deprecated Use media_list
204  * @{
205  */
206
207 typedef struct libvlc_playlist_item_t
208 {
209     int i_id;
210     char * psz_uri;
211     char * psz_name;
212
213 } libvlc_playlist_item_t;
214
215 /**@} */
216
217
218 /*****************************************************************************
219  * Video
220  *****************************************************************************/
221 /** \defgroup libvlc_video libvlc_video
222  * \ingroup libvlc_media_player
223  * LibVLC Video handling
224  * @{
225  */
226  
227 /**
228 * Downcast to this general type as placeholder for a platform specific one, such as:
229 *  Drawable on X11,
230 *  CGrafPort on MacOSX,
231 *  HWND on win32
232 */
233 typedef int libvlc_drawable_t;
234
235 /**
236 * Rectangle type for video geometry
237 */
238 typedef struct libvlc_rectangle_t
239 {
240     int top, left;
241     int bottom, right;
242 }
243 libvlc_rectangle_t;
244
245 /**@} */
246
247
248 /*****************************************************************************
249  * Services/Media Discovery
250  *****************************************************************************/
251 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
252  * \ingroup libvlc
253  * LibVLC Media Discoverer
254  * @{
255  */
256
257 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
258
259 /**@} */
260
261 /*****************************************************************************
262  * Message log handling
263  *****************************************************************************/
264
265 /** \defgroup libvlc_log libvlc_log
266  * \ingroup libvlc_core
267  * LibVLC Message Logging
268  * @{
269  */
270
271 /** This structure is opaque. It represents a libvlc log instance */
272 typedef struct libvlc_log_t libvlc_log_t;
273
274 /** This structure is opaque. It represents a libvlc log iterator */
275 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
276
277 typedef struct libvlc_log_message_t
278 {
279     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
280     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
281     const char *psz_type;     /* module type */
282     const char *psz_name;     /* module name */
283     const char *psz_header;   /* optional header */
284     const char *psz_message;  /* message */
285 } libvlc_log_message_t;
286
287 /**@} */
288
289 # ifdef __cplusplus
290 }
291 # endif
292
293 #endif