]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
control/event.c: Change the event API to be per-object driven. It is not yet in use.
[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  * 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 libvlc_meta_t {
72     libvlc_meta_Title,
73     libvlc_meta_Artist
74 } libvlc_meta_t;
75
76 /**@} */
77
78 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
79
80 /**@} */
81
82 /*****************************************************************************
83  * Media Instance
84  *****************************************************************************/
85 /** defgroup libvlc_media_instance MediaInstance
86  * \ingroup libvlc
87  * LibVLC Media Instance handling
88  * @{
89  */
90
91 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
92
93 /**@} */
94
95
96 /*****************************************************************************
97  * Playlist
98  *****************************************************************************/
99 /** defgroup libvlc_playlist Playlist
100  * \ingroup libvlc
101  * LibVLC Playlist handling
102  * @{
103  */
104
105 typedef struct libvlc_playlist_item_t
106 {
107     int i_id;
108     char * psz_uri;
109     char * psz_name;
110
111 } libvlc_playlist_item_t;
112
113 /**@} */
114
115
116 /*****************************************************************************
117  * Video
118  *****************************************************************************/
119 /** defgroup libvlc_video Video
120  * \ingroup libvlc
121  * LibVLC Video handling
122  * @{
123  */
124     
125 /**
126 * Downcast to this general type as placeholder for a platform specific one, such as:
127 *  Drawable on X11,
128 *  CGrafPort on MacOSX,
129 *  HWND on win32
130 */
131 typedef int libvlc_drawable_t;
132
133 /**
134 * Rectangle type for video geometry
135 */
136 typedef struct libvlc_rectangle_t
137 {
138     int top, left;
139     int bottom, right;
140 }
141 libvlc_rectangle_t;
142
143 /**@} */
144
145
146 /*****************************************************************************
147  * Message log handling
148  *****************************************************************************/
149
150 /** defgroup libvlc_log Log
151  * \ingroup libvlc
152  * LibVLC Message Logging
153  * @{
154  */
155
156 /** This structure is opaque. It represents a libvlc log instance */
157 typedef struct libvlc_log_t libvlc_log_t;
158
159 /** This structure is opaque. It represents a libvlc log iterator */
160 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
161
162 typedef struct libvlc_log_message_t
163 {
164     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
165     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
166     const char *psz_type;     /* module type */
167     const char *psz_name;     /* module name */
168     const char *psz_header;   /* optional header */
169     const char *psz_message;  /* message */
170 } libvlc_log_message_t;
171
172 /**@} */
173
174 /*****************************************************************************
175  * Callbacks handling
176  *****************************************************************************/
177
178 /** defgroup libvlc_callbacks Callbacks
179  * \ingroup libvlc
180  * LibVLC Event Callbacks
181  * @{
182  */
183     
184 /**
185  * Available events: (XXX: being reworked)
186  * - libvlc_VolumeChanged
187  * - libvlc_InputPositionChanged
188  */
189
190 typedef enum libvlc_event_type_t {
191     libvlc_VolumeChanged,
192     libvlc_InputPositionChanged,
193 } libvlc_event_type_t;
194
195 /**
196  * An Event
197  * \param type the even type
198  * \param p_obj the sender object
199  * \param u Event dependent content
200  */
201
202 typedef struct libvlc_event_t
203 {
204     libvlc_event_type_t type;
205         void * p_obj;
206     union
207     {
208         struct
209         {
210             int new_volume;
211         } volume_changed;
212         struct
213         {
214             vlc_int64_t new_position;
215         } input_position_changed;
216     } u;
217 } libvlc_event_t;
218
219 /**
220  * Event manager that belongs to a libvlc object, and from whom events can
221  * be received.
222  */
223
224 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
225
226 /**
227  * Callback function notification
228  * \param p_event the event triggering the callback
229  */
230
231 typedef void ( *libvlc_callback_t )( const libvlc_event_t * );
232
233 /**@} */
234
235 # ifdef __cplusplus
236 }
237 # endif
238
239 #endif