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