]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
libvlc: rename libvlc_media_descriptor to libvlc_media and libvlc_media_instance...
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9  *          Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 /**
27  * \defgroup libvlc libvlc
28  * This is libvlc, the base library of the VLC program.
29  *
30  * @{
31  */
32
33
34 #ifndef _LIBVLC_H
35 #define _LIBVLC_H 1
36
37 #include <vlc/vlc.h>
38
39 # ifdef __cplusplus
40 extern "C" {
41 # endif
42
43 /*****************************************************************************
44  * Exception handling
45  *****************************************************************************/
46 /** \defgroup libvlc_exception libvlc_exception
47  * \ingroup libvlc
48  * LibVLC Exceptions handling
49  * @{
50  */
51
52 /**
53  * Initialize an exception structure. This can be called several times to
54  * reuse an exception structure.
55  *
56  * \param p_exception the exception to initialize
57  */
58 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
59
60 /**
61  * Has an exception been raised?
62  *
63  * \param p_exception the exception to query
64  * \return 0 if the exception was raised, 1 otherwise
65  */
66 VLC_PUBLIC_API int
67 libvlc_exception_raised( const libvlc_exception_t *p_exception );
68
69 /**
70  * Raise an exception using a user-provided message.
71  *
72  * \param p_exception the exception to raise
73  * \param psz_message the exception message format string
74  * \param ... the format string arguments
75  */
76 VLC_PUBLIC_API void
77 libvlc_exception_raise( libvlc_exception_t *p_exception,
78                         const char *psz_format, ... );
79
80 /**
81  * Clear an exception object so it can be reused.
82  * The exception object must have be initialized.
83  *
84  * \param p_exception the exception to clear
85  */
86 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
87
88 /**
89  * Get an exception's message.
90  *
91  * \param p_exception the exception to query
92  * \return the exception message or NULL if not applicable (exception not
93  *         raised, for example)
94  */
95 VLC_PUBLIC_API const char *
96 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
97
98 /**@} */
99
100 /*****************************************************************************
101  * Core handling
102  *****************************************************************************/
103
104 /** \defgroup libvlc_core libvlc_core
105  * \ingroup libvlc
106  * LibVLC Core
107  * @{
108  */
109
110 /**
111  * Create and initialize a libvlc instance.
112  *
113  * \param argc the number of arguments
114  * \param argv command-line-type arguments. argv[0] must be the path of the
115  *        calling program.
116  * \param p_e an initialized exception pointer
117  * \return the libvlc instance
118  */
119 VLC_PUBLIC_API libvlc_instance_t *
120 libvlc_new( int , const char *const *, libvlc_exception_t *);
121
122 /**
123  * Return a libvlc instance identifier for legacy APIs. Use of this
124  * function is discouraged, you should convert your program to use the
125  * new API.
126  *
127  * \param p_instance the instance
128  * \return the instance identifier
129  */
130 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
131
132 /**
133  * Decrement the reference count of a libvlc instance, and destroy it
134  * if it reaches zero.
135  *
136  * \param p_instance the instance to destroy
137  */
138 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
139
140 /**
141  * Increments the reference count of a libvlc instance.
142  * The initial reference count is 1 after libvlc_new() returns.
143  *
144  * \param p_instance the instance to reference
145  */
146 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
147
148 /** @}*/
149
150 /*****************************************************************************
151  * Media descriptor
152  *****************************************************************************/
153 /** \defgroup libvlc_media libvlc_media
154  * \ingroup libvlc
155  * LibVLC Media Descriptor
156  * @{
157  */
158
159 /**
160  * Create a media descriptor with the given MRL.
161  *
162  * \param p_instance the instance
163  * \param psz_mrl the MRL to read
164  * \param p_e an initialized exception pointer
165  * \return the newly created media descriptor
166  */
167 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
168                                    libvlc_instance_t *p_instance,
169                                    const char * psz_mrl,
170                                    libvlc_exception_t *p_e );
171
172 /**
173  * Create a media descriptor as an empty node with the passed name.
174  *
175  * \param p_instance the instance
176  * \param psz_name the name of the node
177  * \param p_e an initialized exception pointer
178  * \return the new empty media descriptor
179  */
180 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
181                                    libvlc_instance_t *p_instance,
182                                    const char * psz_name,
183                                    libvlc_exception_t *p_e );
184
185 /**
186  * Add an option to the media descriptor.
187  *
188  * This option will be used to determine how the media_player will
189  * read the media. This allows to use VLC's advanced
190  * reading/streaming options on a per-media basis.
191  *
192  * The options are detailed in vlc --long-help, for instance "--sout-all"
193  *
194  * \param p_instance the instance
195  * \param psz_mrl the MRL to read
196  * \param p_e an initialized exception pointer
197  */
198 VLC_PUBLIC_API void libvlc_media_add_option(
199                                    libvlc_media_t * p_md,
200                                    const char * ppsz_options,
201                                    libvlc_exception_t * p_e );
202
203 VLC_PUBLIC_API void libvlc_media_retain(
204                                    libvlc_media_t *p_meta_desc );
205
206 VLC_PUBLIC_API void libvlc_media_release(
207                                    libvlc_media_t *p_meta_desc );
208
209 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
210                                                        libvlc_exception_t * p_e );
211
212 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
213
214 /**
215  * Read the meta of the media descriptor.
216  *
217  * \param p_meta_desc the media descriptor to read
218  * \param p_meta_desc the meta to read
219  * \param p_e an initialized exception pointer
220  * \return the media descriptor's meta
221  */
222 VLC_PUBLIC_API char * libvlc_media_get_meta(
223                                    libvlc_media_t *p_meta_desc,
224                                    libvlc_meta_t e_meta,
225                                    libvlc_exception_t *p_e );
226
227 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
228                                    libvlc_media_t *p_meta_desc,
229                                    libvlc_exception_t *p_e );
230
231 VLC_PUBLIC_API libvlc_media_list_t *
232     libvlc_media_subitems( libvlc_media_t *p_md,
233                                       libvlc_exception_t *p_e );
234
235 VLC_PUBLIC_API libvlc_event_manager_t *
236     libvlc_media_event_manager( libvlc_media_t * p_md,
237                                            libvlc_exception_t * p_e );
238
239 VLC_PUBLIC_API libvlc_time_t
240    libvlc_media_get_duration( libvlc_media_t * p_md,
241                                          libvlc_exception_t * p_e );
242
243 VLC_PUBLIC_API int
244    libvlc_media_is_preparsed( libvlc_media_t * p_md,
245                                          libvlc_exception_t * p_e );
246
247 VLC_PUBLIC_API void
248     libvlc_media_set_user_data( libvlc_media_t * p_md,
249                                            void * p_new_user_data,
250                                            libvlc_exception_t * p_e);
251 VLC_PUBLIC_API void *
252     libvlc_media_get_user_data( libvlc_media_t * p_md,
253                                            libvlc_exception_t * p_e);
254
255 /** @}*/
256
257 /*****************************************************************************
258  * Media Instance
259  *****************************************************************************/
260 /** \defgroup libvlc_media_player libvlc_media_player
261  * \ingroup libvlc
262  * LibVLC Media Instance, object that let you play a media descriptor
263  * in a libvlc_drawable_t
264  * @{
265  */
266
267 /** 
268  * Create an empty Media Instance object
269  *
270  * \param p_libvlc_instance the libvlc instance in which the Media Instance
271  *        should be created.
272  * \param p_e an initialized exception pointer
273  */
274 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
275
276 /**
277  * Create a Media Instance object from a Media Descriptor
278  *
279  * \param p_md the media descriptor. Afterwards the p_md can be safely
280  *        destroyed.
281  * \param p_e an initialized exception pointer
282  */
283 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
284
285 /**
286  * Release a media_player after use
287  *
288  * \param p_mi the Media Instance to free
289  */
290 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
291 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
292
293 /** Set the media descriptor that will be used by the media_player. If any,
294  * previous md will be released.
295  *
296  * \param p_mi the Media Instance
297  * \param p_md the Media Descriptor. Afterwards the p_md can be safely
298  *        destroyed.
299  * \param p_e an initialized exception pointer
300  */
301 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
302
303 /**
304  * Get the media descriptor used by the media_player. 
305  *
306  * \param p_mi the Media Instance
307  * \param p_e an initialized exception pointer
308  * \return the media descriptor associated with p_mi, or NULL if no
309  *         media descriptor is associated
310  */
311 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
312
313 /**
314  * Get the Event Manager from which the media instance send event.
315  *
316  * \param p_mi the Media Instance
317  * \param p_e an initialized exception pointer
318  * \return the event manager associated with p_mi
319  */
320 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
321
322 /**
323  * Play 
324  *
325  * \param p_mi the Media Instance
326  * \param p_e an initialized exception pointer
327  */
328 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
329
330 /**
331  * Pause 
332  *
333  * \param p_mi the Media Instance
334  * \param p_e an initialized exception pointer
335  */
336 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
337
338 /**
339  * Stop 
340  *
341  * \param p_mi the Media Instance
342  * \param p_e an initialized exception pointer
343  */
344 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
345
346 /**
347  * Set the drawable where the media instance should render its video output
348  *
349  * \param p_mi the Media Instance
350  * \param drawable the libvlc_drawable_t where the media instance
351  *        should render its video
352  * \param p_e an initialized exception pointer
353  */
354 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
355
356 /**
357  * Get the drawable where the media instance should render its video output
358  *
359  * \param p_mi the Media Instance
360  * \param p_e an initialized exception pointer
361  * \return the libvlc_drawable_t where the media instance
362  *         should render its video
363  */
364 VLC_PUBLIC_API libvlc_drawable_t
365                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
366
367 /** \bug This might go away ... to be replaced by a broader system */
368 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
369 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
370 VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
371 VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
372 VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
373 VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
374 VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
375 VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
376 VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
377 VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
378 VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
379 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
380 VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
381
382 /**
383  * Does this media instance have a video output?
384  *
385  * \param p_md the media instance
386  * \param p_e an initialized exception pointer
387  */
388 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
389
390 /**
391  * Is this media instance seekable?
392  *
393  * \param p_input the input
394  * \param p_e an initialized exception pointer
395  */
396 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
397
398 /**
399  * Can this media instance be paused?
400  *
401  * \param p_input the input
402  * \param p_e an initialized exception pointer
403  */
404 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
405
406 /** \defgroup libvlc_video libvlc_video
407  * \ingroup libvlc_media_player
408  * LibVLC Video handling
409  * @{
410  */
411
412 /**
413  * Toggle fullscreen status on video output.
414  *
415  * \param p_input the input
416  * \param p_e an initialized exception pointer
417  */
418 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
419
420 /**
421  * Enable or disable fullscreen on a video output.
422  *
423  * \param p_input the input
424  * \param b_fullscreen boolean for fullscreen status
425  * \param p_e an initialized exception pointer
426  */
427 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
428
429 /**
430  * Get current fullscreen status.
431  *
432  * \param p_input the input
433  * \param p_e an initialized exception pointer
434  * \return the fullscreen status (boolean)
435  */
436 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
437
438 /**
439  * Get current video height.
440  *
441  * \param p_input the input
442  * \param p_e an initialized exception pointer
443  * \return the video height
444  */
445 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
446
447 /**
448  * Get current video width.
449  *
450  * \param p_input the input
451  * \param p_e an initialized exception pointer
452  * \return the video width
453  */
454 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
455
456 /**
457  * Get current video aspect ratio.
458  *
459  * \param p_input the input
460  * \param p_e an initialized exception pointer
461  * \return the video aspect ratio
462  */
463 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
464
465 /**
466  * Set new video aspect ratio.
467  *
468  * \param p_input the input
469  * \param psz_aspect new video aspect-ratio
470  * \param p_e an initialized exception pointer
471  */
472 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
473
474 /**
475  * Get current video subtitle.
476  *
477  * \param p_input the input
478  * \param p_e an initialized exception pointer
479  * \return the video subtitle selected
480  */
481 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
482
483 /**
484  * Set new video subtitle.
485  *
486  * \param p_input the input
487  * \param i_spu new video subtitle to select
488  * \param p_e an initialized exception pointer
489  */
490 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
491
492 /**
493  * Get current crop filter geometry.
494  *
495  * \param p_input the input
496  * \param p_e an initialized exception pointer
497  * \return the crop filter geometry
498  */
499 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
500
501 /**
502  * Set new crop filter geometry.
503  *
504  * \param p_input the input
505  * \param psz_geometry new crop filter geometry
506  * \param p_e an initialized exception pointer
507  */
508 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
509
510 /**
511  * Toggle teletext transparent status on video output.
512  *
513  * \param p_input the input
514  * \param p_e an initialized exception pointer
515  */
516 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
517
518 /**
519  * Get current teletext page requested.
520  *
521  * \param p_input the input
522  * \param p_e an initialized exception pointer
523  * \return the current teletext page requested.
524  */
525 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
526
527 /**
528  * Set new teletext page to retrieve.
529  *
530  * \param p_input the input
531  * \param i_page teletex page number requested
532  * \param p_e an initialized exception pointer
533  */
534 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
535
536 /**
537  * Take a snapshot of the current video window.
538  *
539  * If i_width AND i_height is 0, original size is used.
540  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
541  *
542  * \param p_input the input
543  * \param psz_filepath the path where to save the screenshot to
544  * \param i_width the snapshot's width
545  * \param i_height the snapshot's height
546  * \param p_e an initialized exception pointer
547  */
548 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
549
550 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
551
552 /**
553  * Resize the current video output window.
554  *
555  * \param p_instance libvlc instance
556  * \param width new width for video output window
557  * \param height new height for video output window
558  * \param p_e an initialized exception pointer
559  * \return the success status (boolean)
560  */
561 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
562
563 /**
564  * Change the parent for the current the video output.
565  *
566  * \param p_instance libvlc instance
567  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
568  * \param p_e an initialized exception pointer
569  * \return the success status (boolean)
570  */
571 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
572
573 /**
574  * Tell windowless video output to redraw rectangular area (MacOS X only).
575  *
576  * \param p_instance libvlc instance
577  * \param area coordinates within video drawable
578  * \param p_e an initialized exception pointer
579  */
580 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
581
582 /**
583  * Set the default video output's parent.
584  *
585  * This setting will be used as default for all video outputs.
586  *
587  * \param p_instance libvlc instance
588  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
589  * \param p_e an initialized exception pointer
590  */
591 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
592
593 /**
594  * Set the default video output parent.
595  *
596  * This setting will be used as default for all video outputs.
597  *
598  * \param p_instance libvlc instance
599  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
600  * \param p_e an initialized exception pointer
601  */
602 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
603
604 /**
605  * Set the default video output size.
606  *
607  * This setting will be used as default for all video outputs.
608  *
609  * \param p_instance libvlc instance
610  * \param width new width for video drawable
611  * \param height new height for video drawable
612  * \param p_e an initialized exception pointer
613  */
614 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
615
616 /**
617  * Set the default video output viewport for a windowless video output
618  * (MacOS X only).
619  *
620  * This setting will be used as default for all video outputs.
621  *
622  * \param p_instance libvlc instance
623  * \param view coordinates within video drawable
624  * \param clip coordinates within video drawable
625  * \param p_e an initialized exception pointer
626  */
627 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
628
629 /** @} video */
630
631 /** \defgroup libvlc_audio libvlc_audio
632  * \ingroup libvlc_media_player
633  * LibVLC Audio handling
634  * @{
635  */
636
637 /**
638  * Toggle mute status.
639  *
640  * \param p_instance libvlc instance
641  * \param p_e an initialized exception pointer
642  */
643 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
644
645 /**
646  * Get current mute status.
647  *
648  * \param p_instance libvlc instance
649  * \param p_e an initialized exception pointer
650  * \return the mute status (boolean)
651  */
652 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
653
654 /**
655  * Set mute status.
656  *
657  * \param p_instance libvlc instance
658  * \param status If status is VLC_TRUE then mute, otherwise unmute
659  * \param p_e an initialized exception pointer
660  */
661 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
662
663 /**
664  * Get current audio level.
665  *
666  * \param p_instance libvlc instance
667  * \param p_e an initialized exception pointer
668  * \return the audio level (int)
669  */
670 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
671
672 /**
673  * Set current audio level.
674  *
675  * \param p_instance libvlc instance
676  * \param i_volume the volume (int)
677  * \param p_e an initialized exception pointer
678  */
679 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
680
681 /**
682  * Get number of available audio tracks.
683  *
684  * \param p_mi media instance
685  * \param p_e an initialized exception
686  * \return the number of available audio tracks (int)
687  */
688 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
689
690 /**
691  * Get current audio track.
692  *
693  * \param p_input input instance
694  * \param p_e an initialized exception pointer
695  * \return the audio track (int)
696  */
697 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
698
699 /**
700  * Set current audio track.
701  *
702  * \param p_input input instance
703  * \param i_track the track (int)
704  * \param p_e an initialized exception pointer
705  */
706 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
707
708 /**
709  * Get current audio channel.
710  *
711  * \param p_instance input instance
712  * \param p_e an initialized exception pointer
713  * \return the audio channel (int)
714  */
715 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
716
717 /**
718  * Set current audio channel.
719  *
720  * \param p_instance input instance
721  * \param i_channel the audio channel (int)
722  * \param p_e an initialized exception pointer
723  */
724 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
725
726 /** @} audio */
727
728 /** @} media_player */
729
730 /*****************************************************************************
731  * Event handling
732  *****************************************************************************/
733
734 /** \defgroup libvlc_event libvlc_event
735  * \ingroup libvlc
736  * LibVLC Events
737  * @{
738  */
739
740 /**
741  * Register for an event notification.
742  *
743  * \param p_event_manager the event manager to which you want to attach to.
744  *        Generally it is obtained by vlc_my_object_event_manager() where
745  *        my_object is the object you want to listen to.
746  * \param i_event_type the desired event to which we want to listen
747  * \param f_callback the function to call when i_event_type occurs
748  * \param user_data user provided data to carry with the event
749  * \param p_e an initialized exception pointer
750  */
751 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
752                                          libvlc_event_type_t i_event_type,
753                                          libvlc_callback_t f_callback,
754                                          void *user_data,
755                                          libvlc_exception_t *p_e );
756
757 /**
758  * Unregister an event notification.
759  *
760  * \param p_event_manager the event manager
761  * \param i_event_type the desired event to which we want to unregister
762  * \param f_callback the function to call when i_event_type occurs
763  * \param p_e an initialized exception pointer
764  */
765 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
766                                          libvlc_event_type_t i_event_type,
767                                          libvlc_callback_t f_callback,
768                                          void *p_user_data,
769                                          libvlc_exception_t *p_e );
770
771 /**
772  * Get an event's type name.
773  *
774  * \param i_event_type the desired event
775  */
776 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
777
778 /** @} */
779
780 /*****************************************************************************
781  * Media Library
782  *****************************************************************************/
783 /** \defgroup libvlc_media_library libvlc_media_library
784  * \ingroup libvlc
785  * LibVLC Media Library
786  * @{
787  */
788 VLC_PUBLIC_API libvlc_media_library_t *
789     libvlc_media_library_new( libvlc_instance_t * p_inst,
790                               libvlc_exception_t * p_e );
791 VLC_PUBLIC_API void
792     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
793 VLC_PUBLIC_API void
794     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
795
796
797 VLC_PUBLIC_API void
798     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
799                                libvlc_exception_t * p_e );
800
801 VLC_PUBLIC_API void
802     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
803                                libvlc_exception_t * p_e );
804
805 VLC_PUBLIC_API libvlc_media_list_t *
806     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
807                                      libvlc_exception_t * p_e );
808
809
810 /** @} */
811
812
813 /*****************************************************************************
814  * Services/Media Discovery
815  *****************************************************************************/
816 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
817  * \ingroup libvlc
818  * LibVLC Media Discoverer
819  * @{
820  */
821
822 VLC_PUBLIC_API libvlc_media_discoverer_t *
823 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
824                                        const char * psz_name,
825                                        libvlc_exception_t * p_e );
826 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
827 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
828
829 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
830
831 VLC_PUBLIC_API libvlc_event_manager_t *
832         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
833
834 VLC_PUBLIC_API int
835         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
836
837 /**@} */
838
839
840 /*****************************************************************************
841  * Message log handling
842  *****************************************************************************/
843
844 /** \defgroup libvlc_log libvlc_log
845  * \ingroup libvlc
846  * LibVLC Message Logging
847  * @{
848  */
849
850 /**
851  * Return the VLC messaging verbosity level.
852  *
853  * \param p_instance libvlc instance
854  * \param exception an initialized exception pointer
855  */
856 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
857                                                   libvlc_exception_t *p_e );
858
859 /**
860  * Set the VLC messaging verbosity level.
861  *
862  * \param p_log libvlc log instance
863  * \param exception an initialized exception pointer
864  */
865 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
866                                               libvlc_exception_t *p_e );
867
868 /**
869  * Open a VLC message log instance.
870  *
871  * \param p_instance libvlc instance
872  * \param exception an initialized exception pointer
873  */
874 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
875
876 /**
877  * Close a VLC message log instance.
878  *
879  * \param p_log libvlc log instance
880  * \param exception an initialized exception pointer
881  */
882 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
883
884 /**
885  * Returns the number of messages in a log instance.
886  *
887  * \param p_log libvlc log instance
888  * \param exception an initialized exception pointer
889  */
890 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
891
892 /**
893  * Clear a log instance.
894  *
895  * All messages in the log are removed. The log should be cleared on a
896  * regular basis to avoid clogging.
897  *
898  * \param p_log libvlc log instance
899  * \param exception an initialized exception pointer
900  */
901 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
902
903 /**
904  * Allocate and returns a new iterator to messages in log.
905  *
906  * \param p_log libvlc log instance
907  * \param exception an initialized exception pointer
908  */
909 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
910
911 /**
912  * Release a previoulsy allocated iterator.
913  *
914  * \param p_log libvlc log iterator
915  * \param exception an initialized exception pointer
916  */
917 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
918
919 /**
920  * Return whether log iterator has more messages.
921  *
922  * \param p_log libvlc log iterator
923  * \param exception an initialized exception pointer
924  */
925 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
926
927 /**
928  * Return the next log message.
929  *
930  * The message contents must not be freed
931  *
932  * \param p_log libvlc log iterator
933  * \param exception an initialized exception pointer
934  */
935 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
936                                                                struct libvlc_log_message_t *buffer,
937                                                                libvlc_exception_t *p_e );
938
939 /** @} */
940
941 # ifdef __cplusplus
942 }
943 # endif
944
945 #endif /* <vlc/libvlc.h> */