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