]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
- added controlled symbol export support for win32. Now, all visible symbols in libvl...
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 /**
26  * \defgroup libvlc Libvlc
27  * This is libvlc, the base library of the VLC program.
28  *
29  * @{
30  */
31
32
33 #ifndef _LIBVLC_H
34 #define _LIBVLC_H 1
35
36 #include <vlc/vlc.h>
37
38 # ifdef __cplusplus
39 extern "C" {
40 # endif
41
42 /*****************************************************************************
43  * Exception handling
44  *****************************************************************************/
45 /** defgroup libvlc_exception Exceptions
46  * \ingroup libvlc
47  * LibVLC Exceptions handling
48  * @{
49  */
50
51 struct libvlc_exception_t
52 {
53     int b_raised;
54     int i_code;
55     char *psz_message;
56 };
57 typedef struct libvlc_exception_t libvlc_exception_t;
58
59 /**
60  * Initialize an exception structure. This can be called several times to reuse
61  * an exception structure.
62  * \param p_exception the exception to initialize
63  */
64 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
65
66 /**
67  * Has an exception been raised ?
68  * \param p_exception the exception to query
69  * \return 0 if no exception raised, 1 else
70  */
71 VLC_PUBLIC_API int libvlc_exception_raised( libvlc_exception_t *p_exception );
72
73 /**
74  * Raise an exception
75  * \param p_exception the exception to raise
76  * \param psz_message the exception message
77  */
78 VLC_PUBLIC_API void libvlc_exception_raise( libvlc_exception_t *p_exception, const char *psz_format, ... );
79
80 /**
81  * Clear an exception object so it can be reused.
82  * The exception object must be initialized
83  * \param p_exception the exception to clear
84  */
85 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
86
87 /**
88  * Get exception message
89  * \param p_exception the exception to query
90  * \return the exception message or NULL if not applicable (exception not raised
91  * for example)
92  */
93 VLC_PUBLIC_API char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
94
95 /**@} */
96
97 /*****************************************************************************
98  * Core handling
99  *****************************************************************************/
100
101 /** defgroup libvlc_core Core
102  * \ingroup libvlc
103  * LibVLC Core
104  * @{
105  */
106
107 /** This structure is opaque. It represents a libvlc instance */
108 typedef struct libvlc_instance_t libvlc_instance_t;
109
110 /**
111  * Create an initialized libvlc instance
112  * \param argc the number of arguments
113  * \param argv command-line-type arguments
114  * \param exception an initialized exception pointer
115  */
116 VLC_PUBLIC_API libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
117
118 /**
119  * Returns a libvlc instance identifier for legacy APIs. Use of this
120  * function is discouraged, you should convert your program to use the
121  * new API.
122  * \param p_instance the instance
123  */
124 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
125
126 /**
127  * Destroy a libvlc instance.
128  * \param p_instance the instance to destroy
129  */
130 VLC_PUBLIC_API void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
131
132 /** @}*/
133
134 /*****************************************************************************
135  * Playlist
136  *****************************************************************************/
137 /** defgroup libvlc_playlist Playlist
138  * \ingroup libvlc
139  * LibVLC Playlist handling
140  * @{
141  */
142
143 /**
144  * Set loop variable
145  */
146 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
147                                           libvlc_exception_t * );
148
149 /**
150  * Start playing. You can give some additionnal playlist item options
151  * that will be added to the item before playing it.
152  * \param p_instance the instance
153  * \param i_id the item to play. If this is a negative number, the next
154  * item will be selected. Else, the item with the given ID will be played
155  * \param i_options the number of options to add to the item
156  * \param ppsz_options the options to add to the item
157  * \param p_exception an initialized exception
158  */
159 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
160                                           libvlc_exception_t * );
161
162 /**
163  * Pause a running playlist, resume if it was stopped
164  * \param p_instance the instance to pause
165  * \param p_exception an initialized exception
166  */
167 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
168
169 /**
170  * Checks if the playlist is running
171  * \param p_instance the instance
172  * \param p_exception an initialized exception
173  * \return 0 if the playlist is stopped or paused, 1 if it is running
174  */
175 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
176
177 /**
178  * Get the number of items in the playlist
179  * \param p_instance the instance
180  * \param p_exception an initialized exception
181  * \return the number of items
182  */
183 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
184
185 /**
186  * Stop playing
187  * \param p_instance the instance to stop
188  * \param p_exception an initialized exception
189  */
190 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
191
192 /**
193  * Go to next playlist item (starts playback if it was stopped)
194  * \param p_instance the instance to use
195  * \param p_exception an initialized exception
196  */
197 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
198
199 /**
200  * Go to previous playlist item (starts playback if it was stopped)
201  * \param p_instance the instance to use
202  * \param p_exception an initialized exception
203  */
204 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
205
206 /**
207  * Remove all playlist items
208  * \param p_instance the instance
209  * \param p_exception an initialized exception
210  */
211 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
212
213 /**
214  * Add an item at the end of the playlist
215  * If you need more advanced options, \see libvlc_playlist_add_extended
216  * \param p_instance the instance
217  * \param psz_uri the URI to open, using VLC format
218  * \param psz_name a name that you might want to give or NULL
219  * \return the identifier of the new item
220  */
221 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
222                                         libvlc_exception_t * );
223
224 /**
225  * Add an item at the end of the playlist, with additional input options
226  * \param p_instance the instance
227  * \param psz_uri the URI to open, using VLC format
228  * \param psz_name a name that you might want to give or NULL
229  * \param i_options the number of options to add
230  * \param ppsz_options strings representing the options to add
231  * \param p_exception an initialized exception
232  * \return the identifier of the new item
233  */
234 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
235                                                  const char *, int, const char **,
236                                                  libvlc_exception_t * );
237
238 /**
239  * Delete the playlist item with the given ID.
240  * \param p_instance the instance
241  * \param i_id the id to remove
242  * \param p_exception an initialized exception
243  * \return
244  */
245 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
246                                                 libvlc_exception_t * );
247
248 typedef struct libvlc_input_t libvlc_input_t;
249
250 /* Get the input that is currently being played by the playlist
251  * \param p_instance the instance to use
252  * \param p_exception an initialized excecption
253  * \return an input object
254  */
255 VLC_PUBLIC_API libvlc_input_t *libvlc_playlist_get_input( libvlc_instance_t *,
256                                                           libvlc_exception_t * );
257
258 /** @}*/
259
260 /*****************************************************************************
261  * Input
262  *****************************************************************************/
263 /** defgroup libvlc_input Input
264  * \ingroup libvlc
265  * LibVLC Input handling
266  * @{
267  */
268
269 /** Free an input object
270  * \param p_input the input to free
271  */
272 VLC_PUBLIC_API void libvlc_input_free( libvlc_input_t * );
273
274 /// \bug This might go away ... to be replaced by a broader system
275 VLC_PUBLIC_API vlc_int64_t libvlc_input_get_length     ( libvlc_input_t *, libvlc_exception_t *);
276 VLC_PUBLIC_API vlc_int64_t libvlc_input_get_time       ( libvlc_input_t *, libvlc_exception_t *);
277 VLC_PUBLIC_API void        libvlc_input_set_time       ( libvlc_input_t *, vlc_int64_t, libvlc_exception_t *);
278 VLC_PUBLIC_API float       libvlc_input_get_position   ( libvlc_input_t *, libvlc_exception_t *);
279 VLC_PUBLIC_API void        libvlc_input_set_position   ( libvlc_input_t *, float, libvlc_exception_t *);
280 VLC_PUBLIC_API vlc_bool_t  libvlc_input_will_play      ( libvlc_input_t *, libvlc_exception_t *);
281 VLC_PUBLIC_API float       libvlc_input_get_rate       ( libvlc_input_t *, libvlc_exception_t *);
282 VLC_PUBLIC_API void        libvlc_input_set_rate       ( libvlc_input_t *, float, libvlc_exception_t *);
283 VLC_PUBLIC_API int         libvlc_input_get_state      ( libvlc_input_t *, libvlc_exception_t *);
284
285 /** @} */
286
287 /** defgroup libvlc_video Video
288  * \ingroup libvlc
289  * LibVLC Video handling
290  * @{
291  */
292
293 /**
294 * Downcast to this general type as placeholder for a platform specific one, such as:
295 *  Drawable on X11,
296 *  CGrafPort on MacOSX,
297 *  HWND on win32
298 */
299 typedef int libvlc_drawable_t;
300
301 /**
302 * Rectangle type for video geometry
303 */
304 typedef struct
305 {
306     int top, left;
307     int bottom, right;
308 }
309 libvlc_rectangle_t;
310
311 /**
312  * Does this input have a video output ?
313  * \param p_input the input
314  * \param p_exception an initialized exception
315  */
316 VLC_PUBLIC_API vlc_bool_t  libvlc_input_has_vout( libvlc_input_t *, libvlc_exception_t *);
317 VLC_PUBLIC_API float       libvlc_input_get_fps( libvlc_input_t *, libvlc_exception_t *);
318
319 /**
320  * Toggle fullscreen status on video output
321  * \param p_input the input
322  * \param p_exception an initialized exception
323  */
324 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_input_t *, libvlc_exception_t * );
325
326 /**
327  * Enable or disable fullscreen on a video output
328  * \param p_input the input
329  * \param b_fullscreen boolean for fullscreen status
330  * \param p_exception an initialized exception
331  */
332 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * );
333
334 /**
335  * Get current fullscreen status
336  * \param p_input the input
337  * \param p_exception an initialized exception
338  * \return the fullscreen status (boolean)
339  */
340 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
341
342 /**
343  * Get current video height
344  * \param p_input the input
345  * \param p_exception an initialized exception
346  * \return the video height
347  */
348 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * );
349
350 /**
351  * Get current video width
352  * \param p_input the input
353  * \param p_exception an initialized exception
354  * \return the video width
355  */
356 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * );
357
358 /**
359  * Get current video aspect ratio
360  * \param p_input the input
361  * \param p_exception an initialized exception
362  * \return the video aspect ratio
363  */
364 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_input_t *, libvlc_exception_t * );
365
366 /**
367  * Set new video aspect ratio
368  * \param p_input the input
369  * \param psz_aspect new video aspect-ratio
370  * \param p_exception an initialized exception
371  */
372 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_input_t *, char *, libvlc_exception_t * );
373
374 /**
375  * Get current crop filter geometry
376  * \param p_input the input
377  * \param p_exception an initialized exception
378  * \return the crop filter geometry
379  */
380 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_input_t *, libvlc_exception_t * );
381
382 /**
383  * Set new crop filter geometry
384  * \param p_input the input
385  * \param psz_geometry new crop filter geometry
386  * \param p_exception an initialized exception
387  */
388 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_input_t *, char *, libvlc_exception_t * );
389
390 /**
391  * Take a snapshot of the current video window
392  * \param p_input the input
393  * \param psz_filepath the path where to save the screenshot to
394  * \param p_exception an initialized exception
395  */
396 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
397
398 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_input_t *, libvlc_exception_t *);
399
400 /**
401  * Resize the current video output window
402  * \param p_instance libvlc instance
403  * \param width new width for video output window
404  * \param height new height for video output window
405  * \param p_exception an initialized exception
406  * \return the success status (boolean)
407  */
408 VLC_PUBLIC_API void libvlc_video_resize( libvlc_input_t *, int, int, libvlc_exception_t *);
409
410 /**
411  * change the parent for the current the video output
412  * \param p_instance libvlc instance
413  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
414  * \param p_exception an initialized exception
415  * \return the success status (boolean)
416  */
417 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_input_t *, libvlc_drawable_t, libvlc_exception_t * );
418
419 /**
420  * Set the default video output parent
421  *  this settings will be used as default for all video outputs
422  * \param p_instance libvlc instance
423  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
424  * \param p_exception an initialized exception
425  */
426 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
427
428 /**
429  * Set the default video output size
430  *  this settings will be used as default for all video outputs
431  * \param p_instance libvlc instance
432  * \param width new width for video drawable
433  * \param height new height for video drawable
434  * \param p_exception an initialized exception
435  */
436 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
437
438 /**
439  * Set the default video output viewport for a windowless video output (MacOS X only)
440  *  this settings will be used as default for all video outputs
441  * \param p_instance libvlc instance
442  * \param view coordinates within video drawable
443  * \param clip coordinates within video drawable
444  * \param p_exception an initialized exception
445  */
446 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
447
448
449 /** @} */
450
451 /**
452  * defgroup libvlc_vlm VLM
453  * \ingroup libvlc
454  * LibVLC VLM handling
455  * @{
456  */
457
458 /** defgroup libvlc_audio Audio
459  * \ingroup libvlc
460  * LibVLC Audio handling
461  * @{
462  */
463
464 /**
465  * Toggle mute status
466  * \param p_instance libvlc instance
467  * \param p_exception an initialized exception
468  * \return void
469  */
470 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
471
472 /**
473  * Get current mute status
474  * \param p_instance libvlc instance
475  * \param p_exception an initialized exception
476  * \return the mute status (boolean)
477  */
478 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
479
480 /**
481  * Set mute status
482  * \param p_instance libvlc instance
483  * \param status If status is VLC_TRUE then mute, otherwise unmute
484  * \param p_exception an initialized exception
485  * \return void
486  */
487 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
488
489 /**
490  * Get current audio level
491  * \param p_instance libvlc instance
492  * \param p_exception an initialized exception
493  * \return the audio level (int)
494  */
495 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
496
497 /**
498  * Set current audio level
499  * \param p_instance libvlc instance
500  * \param i_volume the volume (int)
501  * \param p_exception an initialized exception
502  */
503 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
504
505 /**
506 +  * Get current audio track
507 +  * \param p_input input instance
508 +  * \param p_exception an initialized exception
509 +  * \return the audio track (int)
510 +  */
511 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_input_t *, libvlc_exception_t * );
512
513 /**
514  * Set current audio track
515  * \param p_input input instance
516  * \param i_track the track (int)
517  * \param p_exception an initialized exception
518  */
519 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_input_t *, int, libvlc_exception_t * );
520
521 /**
522  * Get current audio channel
523  * \param p_instance input instance
524  * \param p_exception an initialized exception
525  * \return the audio channel (int)
526  */
527 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
528
529 /**
530  * Set current audio channel
531  * \param p_instance input instance
532  * \param i_channel the audio channel (int)
533  * \param p_exception an initialized exception
534  */
535 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
536
537 /** @} */
538
539
540 /**
541  * Add a broadcast, with one input
542  * \param p_instance the instance
543  * \param psz_name the name of the new broadcast
544  * \param psz_input the input MRL
545  * \param psz_output the output MRL (the parameter to the "sout" variable)
546  * \param i_options number of additional options
547  * \param ppsz_options additional options
548  * \param b_enabled boolean for enabling the new broadcast
549  * \param b_loop Should this broadcast be played in loop ?
550  * \param p_exception an initialized exception
551  */
552 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
553                                               int, char **, int, int, libvlc_exception_t * );
554
555 /**
556  * Delete a media (vod or broadcast)
557  * \param p_instance the instance
558  * \param psz_name the media to delete
559  * \param p_exception an initialized exception
560  */
561 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
562
563 /**
564  * Enable or disable a media (vod or broadcast)
565  * \param p_instance the instance
566  * \param psz_name the media to work on
567  * \param b_enabled the new status
568  * \param p_exception an initialized exception
569  */
570 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
571                                             libvlc_exception_t *);
572
573 /**
574  * Set the output for a media
575  * \param p_instance the instance
576  * \param psz_name the media to work on
577  * \param psz_output the output MRL (the parameter to the "sout" variable)
578  * \param p_exception an initialized exception
579  */
580 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
581                                            libvlc_exception_t *);
582
583 /**
584  * Set a media's input MRL. This will delete all existing inputs and
585  * add the specified one.
586  * \param p_instance the instance
587  * \param psz_name the media to work on
588  * \param psz_input the input MRL
589  * \param p_exception an initialized exception
590  */
591 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
592                                           libvlc_exception_t *);
593
594 /**
595  * Set output for a media
596  * \param p_instance the instance
597  * \param psz_name the media to work on
598  * \param b_loop the new status
599  * \param p_exception an initialized exception
600  */
601 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
602                                          libvlc_exception_t *);
603
604 /**
605  * Edit the parameters of a media. This will delete all existing inputs and
606  * add the specified one.
607  * \param p_instance the instance
608  * \param psz_name the name of the new broadcast
609  * \param psz_input the input MRL
610  * \param psz_output the output MRL (the parameter to the "sout" variable)
611  * \param i_options number of additional options
612  * \param ppsz_options additional options
613  * \param b_enabled boolean for enabling the new broadcast
614  * \param b_loop Should this broadcast be played in loop ?
615  * \param p_exception an initialized exception
616  */
617 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
618                                              int, char **, int, int, libvlc_exception_t * );
619
620 /**
621  * Plays the named broadcast.
622  * \param p_instance the instance
623  * \param psz_name the name of the broadcast
624  * \param p_exception an initialized exception
625  */
626 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
627
628 /**
629  * Stops the named broadcast.
630  * \param p_instance the instance
631  * \param psz_name the name of the broadcast
632  * \param p_exception an initialized exception
633  */ 
634 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
635
636 /**
637  * Pauses the named broadcast.
638  * \param p_instance the instance
639  * \param psz_name the name of the broadcast
640  * \param p_exception an initialized exception
641  */ 
642 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
643     
644 /**
645  * Seeks in the named broadcast.
646  * \param p_instance the instance
647  * \param psz_name the name of the broadcast
648  * \param f_percentage the percentage to seek to
649  * \param p_exception an initialized exception
650  */ 
651 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
652                                            float, libvlc_exception_t * );
653    
654 /**
655  * Return information of the named broadcast.
656  * \param p_instance the instance
657  * \param psz_name the name of the broadcast
658  * \param p_exception an initialized exception
659  */ 
660 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
661
662 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
663 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
664                         char *, int , libvlc_exception_t * );
665
666 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
667 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
668 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
669 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
670 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
671 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
672 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
673
674 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
675
676 /** @} */
677 /** @} */
678
679 /*****************************************************************************
680  * Message log handling
681  *****************************************************************************/
682
683 /** defgroup libvlc_log Log
684  * \ingroup libvlc
685  * LibVLC Message Logging
686  * @{
687  */
688
689 /** This structure is opaque. It represents a libvlc log instance */
690 typedef struct libvlc_log_t libvlc_log_t;
691
692 /** This structure is opaque. It represents a libvlc log iterator */
693 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
694
695 typedef struct libvlc_log_message_t
696 {
697     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
698     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
699     const char *psz_type;     /* module type */
700     const char *psz_name;     /* module name */
701     const char *psz_header;   /* optional header */
702     const char *psz_message;  /* message */
703 } libvlc_log_message_t;
704
705 /**
706  * Returns the VLC messaging verbosity level
707  * \param p_instance libvlc instance
708  * \param exception an initialized exception pointer
709  */
710 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
711                                                   libvlc_exception_t *p_e );
712
713 /**
714  * Set the VLC messaging verbosity level
715  * \param p_log libvlc log instance
716  * \param exception an initialized exception pointer
717  */
718 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
719                                               libvlc_exception_t *p_e );
720
721 /**
722  * Open an instance to VLC message log 
723  * \param p_instance libvlc instance
724  * \param exception an initialized exception pointer
725  */
726 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
727
728 /**
729  * Close an instance of VLC message log 
730  * \param p_log libvlc log instance
731  * \param exception an initialized exception pointer
732  */
733 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
734
735 /**
736  * Returns the number of messages in log
737  * \param p_log libvlc log instance
738  * \param exception an initialized exception pointer
739  */
740 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
741
742 /**
743  * Clear all messages in log
744  *  the log should be cleared on a regular basis to avoid clogging
745  * \param p_log libvlc log instance
746  * \param exception an initialized exception pointer
747  */
748 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
749
750 /**
751  * Allocate and returns a new iterator to messages in log
752  * \param p_log libvlc log instance
753  * \param exception an initialized exception pointer
754  */
755 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
756
757 /**
758  * Releases a previoulsy allocated iterator
759  * \param p_log libvlc log iterator 
760  * \param exception an initialized exception pointer
761  */
762 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
763
764 /**
765  * Returns whether log iterator has more messages 
766  * \param p_log libvlc log iterator
767  * \param exception an initialized exception pointer
768  */
769 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
770
771 /**
772  * Returns next log message
773  *   the content of message must not be freed
774  * \param p_log libvlc log iterator
775  * \param exception an initialized exception pointer
776  */
777 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
778                                                                struct libvlc_log_message_t *buffer,
779                                                                libvlc_exception_t *p_e );
780
781 /** @} */
782
783 # ifdef __cplusplus
784 }
785 # endif
786
787 #endif /* <vlc/libvlc.h> */