]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
Libvlc add a media descriptor object.
[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
47 {
48     int b_raised;
49     int i_code;
50     char *psz_message;
51 } libvlc_exception_t;
52
53 /**@} */
54
55 /*****************************************************************************
56  * Media Descriptor
57  *****************************************************************************/
58 /** defgroup libvlc_media_descriptor MediaDescriptor
59  * \ingroup libvlc
60  * LibVLC Media Descriptor handling
61  * @{
62  */
63
64 /* Meta Handling */
65 /** defgroup libvlc_meta Meta
66  * \ingroup libvlc_media_descriptor
67  * LibVLC Media Meta
68  * @{
69  */
70
71 typedef enum {
72     libvlc_meta_Title,
73     libvlc_meta_Artist
74 } libvlc_meta_t;
75
76 /**@} */
77
78
79 typedef struct {
80     bool                b_preparsed;
81     input_item_t      * p_input_item;
82     libvlc_instance_t * p_libvlc_instance;
83 } libvlc_media_descriptor_t;
84
85 /**@} */
86
87
88 /*****************************************************************************
89  * Playlist
90  *****************************************************************************/
91 /** defgroup libvlc_playlist Playlist
92  * \ingroup libvlc
93  * LibVLC Playlist handling
94  * @{
95  */
96
97 typedef struct {
98     int i_id;
99     char * psz_uri;
100     char * psz_name;
101
102 } libvlc_playlist_item_t;
103
104 /**@} */
105
106
107 /*****************************************************************************
108  * Video
109  *****************************************************************************/
110 /** defgroup libvlc_video Video
111  * \ingroup libvlc
112  * LibVLC Video handling
113  * @{
114  */
115     
116 /**
117 * Downcast to this general type as placeholder for a platform specific one, such as:
118 *  Drawable on X11,
119 *  CGrafPort on MacOSX,
120 *  HWND on win32
121 */
122 typedef int libvlc_drawable_t;
123
124 /**
125 * Rectangle type for video geometry
126 */
127 typedef struct
128 {
129     int top, left;
130     int bottom, right;
131 }
132 libvlc_rectangle_t;
133
134 /**@} */
135
136
137 /*****************************************************************************
138  * Message log handling
139  *****************************************************************************/
140
141 /** defgroup libvlc_log Log
142  * \ingroup libvlc
143  * LibVLC Message Logging
144  * @{
145  */
146
147 /** This structure is opaque. It represents a libvlc log instance */
148 typedef struct libvlc_log_t libvlc_log_t;
149
150 /** This structure is opaque. It represents a libvlc log iterator */
151 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
152
153 typedef struct libvlc_log_message_t
154 {
155     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
156     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
157     const char *psz_type;     /* module type */
158     const char *psz_name;     /* module name */
159     const char *psz_header;   /* optional header */
160     const char *psz_message;  /* message */
161 } libvlc_log_message_t;
162
163 /**@} */
164
165 /*****************************************************************************
166  * Callbacks handling
167  *****************************************************************************/
168
169 /** defgroup libvlc_callbacks Callbacks
170  * \ingroup libvlc
171  * LibVLC Event Callbacks
172  * @{
173  */
174     
175 /**
176  * Available events:
177  * - libvlc_VolumeChanged
178  * - libvlc_InputPositionChanged
179  */
180
181 typedef enum {
182     libvlc_VolumeChanged,
183     libvlc_InputPositionChanged,
184 } libvlc_event_type_t;
185
186 typedef struct 
187 {
188     libvlc_event_type_t type;
189     union
190     {
191         struct
192         {
193             int new_volume;
194         } volume_changed;
195         struct
196         {
197             vlc_int64_t new_position;
198         } input_position_changed;
199     } u;
200 } libvlc_event_t;
201
202 /**
203  * Callback function notification
204  * \param p_instance the libvlc instance
205  * \param p_event the event triggering the callback
206  * \param p_user_data user provided data
207  */
208
209 typedef void ( *libvlc_callback_t )( struct libvlc_instance_t *, libvlc_event_t *, void * );
210
211 /**@} */
212
213 # ifdef __cplusplus
214 }
215 # endif
216
217 #endif