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