]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
libvlc: Put libvlc_exception in libvlc_core for doxygen doc.
[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_core
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  * Retrieve libvlc version.
150  *
151  * Example: "0.9.0-git Grishenko"
152  *
153  * \return a string containing the libvlc version
154  */
155 VLC_PUBLIC_API const char * libvlc_get_version();
156
157 /**
158  * Retrieve libvlc compiler version.
159  *
160  * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
161  *
162  * \return a string containing the libvlc compiler version
163  */
164 VLC_PUBLIC_API const char * libvlc_get_compiler();
165
166 /**
167  * Retrieve libvlc changeset.
168  *
169  * Example: "aa9bce0bc4"
170  *
171  * \return a string containing the libvlc changeset
172  */
173 VLC_PUBLIC_API const char * libvlc_get_changeset();
174
175 /** @}*/
176
177 /*****************************************************************************
178  * Media descriptor
179  *****************************************************************************/
180 /** \defgroup libvlc_media libvlc_media
181  * \ingroup libvlc
182  * LibVLC Media Descriptor
183  * @{
184  */
185
186 /**
187  * Create a media descriptor with the given MRL.
188  *
189  * \param p_instance the instance
190  * \param psz_mrl the MRL to read
191  * \param p_e an initialized exception pointer
192  * \return the newly created media descriptor
193  */
194 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
195                                    libvlc_instance_t *p_instance,
196                                    const char * psz_mrl,
197                                    libvlc_exception_t *p_e );
198
199 /**
200  * Create a media descriptor as an empty node with the passed name.
201  *
202  * \param p_instance the instance
203  * \param psz_name the name of the node
204  * \param p_e an initialized exception pointer
205  * \return the new empty media descriptor
206  */
207 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
208                                    libvlc_instance_t *p_instance,
209                                    const char * psz_name,
210                                    libvlc_exception_t *p_e );
211
212 /**
213  * Add an option to the media descriptor.
214  *
215  * This option will be used to determine how the media_player will
216  * read the media. This allows to use VLC's advanced
217  * reading/streaming options on a per-media basis.
218  *
219  * The options are detailed in vlc --long-help, for instance "--sout-all"
220  *
221  * \param p_instance the instance
222  * \param psz_mrl the MRL to read
223  * \param p_e an initialized exception pointer
224  */
225 VLC_PUBLIC_API void libvlc_media_add_option(
226                                    libvlc_media_t * p_md,
227                                    const char * ppsz_options,
228                                    libvlc_exception_t * p_e );
229
230 VLC_PUBLIC_API void libvlc_media_retain(
231                                    libvlc_media_t *p_meta_desc );
232
233 VLC_PUBLIC_API void libvlc_media_release(
234                                    libvlc_media_t *p_meta_desc );
235
236 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
237                                                        libvlc_exception_t * p_e );
238
239 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
240
241 /**
242  * Read the meta of the media descriptor.
243  *
244  * \param p_meta_desc the media descriptor to read
245  * \param p_meta_desc the meta to read
246  * \param p_e an initialized exception pointer
247  * \return the media descriptor's meta
248  */
249 VLC_PUBLIC_API char * libvlc_media_get_meta(
250                                    libvlc_media_t *p_meta_desc,
251                                    libvlc_meta_t e_meta,
252                                    libvlc_exception_t *p_e );
253
254 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
255                                    libvlc_media_t *p_meta_desc,
256                                    libvlc_exception_t *p_e );
257
258 VLC_PUBLIC_API libvlc_media_list_t *
259     libvlc_media_subitems( libvlc_media_t *p_md,
260                                       libvlc_exception_t *p_e );
261
262 VLC_PUBLIC_API libvlc_event_manager_t *
263     libvlc_media_event_manager( libvlc_media_t * p_md,
264                                            libvlc_exception_t * p_e );
265
266 VLC_PUBLIC_API libvlc_time_t
267    libvlc_media_get_duration( libvlc_media_t * p_md,
268                                          libvlc_exception_t * p_e );
269
270 VLC_PUBLIC_API int
271    libvlc_media_is_preparsed( libvlc_media_t * p_md,
272                                          libvlc_exception_t * p_e );
273
274 VLC_PUBLIC_API void
275     libvlc_media_set_user_data( libvlc_media_t * p_md,
276                                            void * p_new_user_data,
277                                            libvlc_exception_t * p_e);
278 VLC_PUBLIC_API void *
279     libvlc_media_get_user_data( libvlc_media_t * p_md,
280                                            libvlc_exception_t * p_e);
281
282 /** @}*/
283
284 /*****************************************************************************
285  * Media Instance
286  *****************************************************************************/
287 /** \defgroup libvlc_media_player libvlc_media_player
288  * \ingroup libvlc
289  * LibVLC Media Instance, object that let you play a media descriptor
290  * in a libvlc_drawable_t
291  * @{
292  */
293
294 /** 
295  * Create an empty Media Instance object
296  *
297  * \param p_libvlc_instance the libvlc instance in which the Media Instance
298  *        should be created.
299  * \param p_e an initialized exception pointer
300  */
301 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
302
303 /**
304  * Create a Media Instance object from a Media Descriptor
305  *
306  * \param p_md the media descriptor. Afterwards the p_md can be safely
307  *        destroyed.
308  * \param p_e an initialized exception pointer
309  */
310 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
311
312 /**
313  * Release a media_player after use
314  *
315  * \param p_mi the Media Instance to free
316  */
317 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
318 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
319
320 /** Set the media descriptor that will be used by the media_player. If any,
321  * previous md will be released.
322  *
323  * \param p_mi the Media Instance
324  * \param p_md the Media Descriptor. Afterwards the p_md can be safely
325  *        destroyed.
326  * \param p_e an initialized exception pointer
327  */
328 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
329
330 /**
331  * Get the media descriptor used by the media_player. 
332  *
333  * \param p_mi the Media Instance
334  * \param p_e an initialized exception pointer
335  * \return the media descriptor associated with p_mi, or NULL if no
336  *         media descriptor is associated
337  */
338 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
339
340 /**
341  * Get the Event Manager from which the media instance send event.
342  *
343  * \param p_mi the Media Instance
344  * \param p_e an initialized exception pointer
345  * \return the event manager associated with p_mi
346  */
347 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
348
349 /**
350  * Play 
351  *
352  * \param p_mi the Media Instance
353  * \param p_e an initialized exception pointer
354  */
355 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
356
357 /**
358  * Pause 
359  *
360  * \param p_mi the Media Instance
361  * \param p_e an initialized exception pointer
362  */
363 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
364
365 /**
366  * Stop 
367  *
368  * \param p_mi the Media Instance
369  * \param p_e an initialized exception pointer
370  */
371 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
372
373 /**
374  * Set the drawable where the media instance should render its video output
375  *
376  * \param p_mi the Media Instance
377  * \param drawable the libvlc_drawable_t where the media instance
378  *        should render its video
379  * \param p_e an initialized exception pointer
380  */
381 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
382
383 /**
384  * Get the drawable where the media instance should render its video output
385  *
386  * \param p_mi the Media Instance
387  * \param p_e an initialized exception pointer
388  * \return the libvlc_drawable_t where the media instance
389  *         should render its video
390  */
391 VLC_PUBLIC_API libvlc_drawable_t
392                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
393
394 /** \bug This might go away ... to be replaced by a broader system */
395 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
396 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
397 VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
398 VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
399 VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
400 VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
401 VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
402 VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
403 VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
404 VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
405 VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
406 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
407 VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
408
409 /**
410  * Does this media instance have a video output?
411  *
412  * \param p_md the media instance
413  * \param p_e an initialized exception pointer
414  */
415 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
416
417 /**
418  * Is this media instance seekable?
419  *
420  * \param p_input the input
421  * \param p_e an initialized exception pointer
422  */
423 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
424
425 /**
426  * Can this media instance be paused?
427  *
428  * \param p_input the input
429  * \param p_e an initialized exception pointer
430  */
431 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
432
433 /** \defgroup libvlc_video libvlc_video
434  * \ingroup libvlc_media_player
435  * LibVLC Video handling
436  * @{
437  */
438
439 /**
440  * Toggle fullscreen status on video output.
441  *
442  * \param p_input the input
443  * \param p_e an initialized exception pointer
444  */
445 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
446
447 /**
448  * Enable or disable fullscreen on a video output.
449  *
450  * \param p_input the input
451  * \param b_fullscreen boolean for fullscreen status
452  * \param p_e an initialized exception pointer
453  */
454 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
455
456 /**
457  * Get current fullscreen status.
458  *
459  * \param p_input the input
460  * \param p_e an initialized exception pointer
461  * \return the fullscreen status (boolean)
462  */
463 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
464
465 /**
466  * Get current video height.
467  *
468  * \param p_input the input
469  * \param p_e an initialized exception pointer
470  * \return the video height
471  */
472 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
473
474 /**
475  * Get current video width.
476  *
477  * \param p_input the input
478  * \param p_e an initialized exception pointer
479  * \return the video width
480  */
481 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
482
483 /**
484  * Get current video aspect ratio.
485  *
486  * \param p_input the input
487  * \param p_e an initialized exception pointer
488  * \return the video aspect ratio
489  */
490 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
491
492 /**
493  * Set new video aspect ratio.
494  *
495  * \param p_input the input
496  * \param psz_aspect new video aspect-ratio
497  * \param p_e an initialized exception pointer
498  */
499 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
500
501 /**
502  * Get current video subtitle.
503  *
504  * \param p_input the input
505  * \param p_e an initialized exception pointer
506  * \return the video subtitle selected
507  */
508 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
509
510 /**
511  * Set new video subtitle.
512  *
513  * \param p_input the input
514  * \param i_spu new video subtitle to select
515  * \param p_e an initialized exception pointer
516  */
517 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
518
519 /**
520  * Get current crop filter geometry.
521  *
522  * \param p_input the input
523  * \param p_e an initialized exception pointer
524  * \return the crop filter geometry
525  */
526 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
527
528 /**
529  * Set new crop filter geometry.
530  *
531  * \param p_input the input
532  * \param psz_geometry new crop filter geometry
533  * \param p_e an initialized exception pointer
534  */
535 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
536
537 /**
538  * Toggle teletext transparent status on video output.
539  *
540  * \param p_input the input
541  * \param p_e an initialized exception pointer
542  */
543 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
544
545 /**
546  * Get current teletext page requested.
547  *
548  * \param p_input the input
549  * \param p_e an initialized exception pointer
550  * \return the current teletext page requested.
551  */
552 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
553
554 /**
555  * Set new teletext page to retrieve.
556  *
557  * \param p_input the input
558  * \param i_page teletex page number requested
559  * \param p_e an initialized exception pointer
560  */
561 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
562
563 /**
564  * Take a snapshot of the current video window.
565  *
566  * If i_width AND i_height is 0, original size is used.
567  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
568  *
569  * \param p_input the input
570  * \param psz_filepath the path where to save the screenshot to
571  * \param i_width the snapshot's width
572  * \param i_height the snapshot's height
573  * \param p_e an initialized exception pointer
574  */
575 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
576
577 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
578
579 /**
580  * Resize the current video output window.
581  *
582  * \param p_instance libvlc instance
583  * \param width new width for video output window
584  * \param height new height for video output window
585  * \param p_e an initialized exception pointer
586  * \return the success status (boolean)
587  */
588 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
589
590 /**
591  * Change the parent for the current the video output.
592  *
593  * \param p_instance libvlc instance
594  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
595  * \param p_e an initialized exception pointer
596  * \return the success status (boolean)
597  */
598 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
599
600 /**
601  * Tell windowless video output to redraw rectangular area (MacOS X only).
602  *
603  * \param p_instance libvlc instance
604  * \param area coordinates within video drawable
605  * \param p_e an initialized exception pointer
606  */
607 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
608
609 /**
610  * Set the default video output's parent.
611  *
612  * This setting will be used as default for all video outputs.
613  *
614  * \param p_instance libvlc instance
615  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
616  * \param p_e an initialized exception pointer
617  */
618 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
619
620 /**
621  * Set the default video output parent.
622  *
623  * This setting will be used as default for all video outputs.
624  *
625  * \param p_instance libvlc instance
626  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
627  * \param p_e an initialized exception pointer
628  */
629 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
630
631 /**
632  * Set the default video output size.
633  *
634  * This setting will be used as default for all video outputs.
635  *
636  * \param p_instance libvlc instance
637  * \param width new width for video drawable
638  * \param height new height for video drawable
639  * \param p_e an initialized exception pointer
640  */
641 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
642
643 /**
644  * Set the default video output viewport for a windowless video output
645  * (MacOS X only).
646  *
647  * This setting will be used as default for all video outputs.
648  *
649  * \param p_instance libvlc instance
650  * \param view coordinates within video drawable
651  * \param clip coordinates within video drawable
652  * \param p_e an initialized exception pointer
653  */
654 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
655
656 /** @} video */
657
658 /** \defgroup libvlc_audio libvlc_audio
659  * \ingroup libvlc_media_player
660  * LibVLC Audio handling
661  * @{
662  */
663
664 /**
665  * Toggle mute status.
666  *
667  * \param p_instance libvlc instance
668  * \param p_e an initialized exception pointer
669  */
670 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
671
672 /**
673  * Get current mute status.
674  *
675  * \param p_instance libvlc instance
676  * \param p_e an initialized exception pointer
677  * \return the mute status (boolean)
678  */
679 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
680
681 /**
682  * Set mute status.
683  *
684  * \param p_instance libvlc instance
685  * \param status If status is VLC_TRUE then mute, otherwise unmute
686  * \param p_e an initialized exception pointer
687  */
688 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
689
690 /**
691  * Get current audio level.
692  *
693  * \param p_instance libvlc instance
694  * \param p_e an initialized exception pointer
695  * \return the audio level (int)
696  */
697 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
698
699 /**
700  * Set current audio level.
701  *
702  * \param p_instance libvlc instance
703  * \param i_volume the volume (int)
704  * \param p_e an initialized exception pointer
705  */
706 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
707
708 /**
709  * Get number of available audio tracks.
710  *
711  * \param p_mi media instance
712  * \param p_e an initialized exception
713  * \return the number of available audio tracks (int)
714  */
715 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
716
717 /**
718  * Get current audio track.
719  *
720  * \param p_input input instance
721  * \param p_e an initialized exception pointer
722  * \return the audio track (int)
723  */
724 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
725
726 /**
727  * Set current audio track.
728  *
729  * \param p_input input instance
730  * \param i_track the track (int)
731  * \param p_e an initialized exception pointer
732  */
733 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
734
735 /**
736  * Get current audio channel.
737  *
738  * \param p_instance input instance
739  * \param p_e an initialized exception pointer
740  * \return the audio channel (int)
741  */
742 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
743
744 /**
745  * Set current audio channel.
746  *
747  * \param p_instance input instance
748  * \param i_channel the audio channel (int)
749  * \param p_e an initialized exception pointer
750  */
751 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
752
753 /** @} audio */
754
755 /** @} media_player */
756
757 /*****************************************************************************
758  * Event handling
759  *****************************************************************************/
760
761 /** \defgroup libvlc_event libvlc_event
762  * \ingroup libvlc_core
763  * LibVLC Events
764  * @{
765  */
766
767 /**
768  * Register for an event notification.
769  *
770  * \param p_event_manager the event manager to which you want to attach to.
771  *        Generally it is obtained by vlc_my_object_event_manager() where
772  *        my_object is the object you want to listen to.
773  * \param i_event_type the desired event to which we want to listen
774  * \param f_callback the function to call when i_event_type occurs
775  * \param user_data user provided data to carry with the event
776  * \param p_e an initialized exception pointer
777  */
778 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
779                                          libvlc_event_type_t i_event_type,
780                                          libvlc_callback_t f_callback,
781                                          void *user_data,
782                                          libvlc_exception_t *p_e );
783
784 /**
785  * Unregister an event notification.
786  *
787  * \param p_event_manager the event manager
788  * \param i_event_type the desired event to which we want to unregister
789  * \param f_callback the function to call when i_event_type occurs
790  * \param p_e an initialized exception pointer
791  */
792 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
793                                          libvlc_event_type_t i_event_type,
794                                          libvlc_callback_t f_callback,
795                                          void *p_user_data,
796                                          libvlc_exception_t *p_e );
797
798 /**
799  * Get an event's type name.
800  *
801  * \param i_event_type the desired event
802  */
803 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
804
805 /** @} */
806
807 /*****************************************************************************
808  * Media Library
809  *****************************************************************************/
810 /** \defgroup libvlc_media_library libvlc_media_library
811  * \ingroup libvlc
812  * LibVLC Media Library
813  * @{
814  */
815 VLC_PUBLIC_API libvlc_media_library_t *
816     libvlc_media_library_new( libvlc_instance_t * p_inst,
817                               libvlc_exception_t * p_e );
818 VLC_PUBLIC_API void
819     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
820 VLC_PUBLIC_API void
821     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
822
823
824 VLC_PUBLIC_API void
825     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
826                                libvlc_exception_t * p_e );
827
828 VLC_PUBLIC_API void
829     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
830                                libvlc_exception_t * p_e );
831
832 VLC_PUBLIC_API libvlc_media_list_t *
833     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
834                                      libvlc_exception_t * p_e );
835
836
837 /** @} */
838
839
840 /*****************************************************************************
841  * Services/Media Discovery
842  *****************************************************************************/
843 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
844  * \ingroup libvlc
845  * LibVLC Media Discoverer
846  * @{
847  */
848
849 VLC_PUBLIC_API libvlc_media_discoverer_t *
850 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
851                                        const char * psz_name,
852                                        libvlc_exception_t * p_e );
853 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
854 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
855
856 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
857
858 VLC_PUBLIC_API libvlc_event_manager_t *
859         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
860
861 VLC_PUBLIC_API int
862         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
863
864 /**@} */
865
866
867 /*****************************************************************************
868  * Message log handling
869  *****************************************************************************/
870
871 /** \defgroup libvlc_log libvlc_log
872  * \ingroup libvlc_core
873  * LibVLC Message Logging
874  * @{
875  */
876
877 /**
878  * Return the VLC messaging verbosity level.
879  *
880  * \param p_instance libvlc instance
881  * \param exception an initialized exception pointer
882  */
883 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
884                                                   libvlc_exception_t *p_e );
885
886 /**
887  * Set the VLC messaging verbosity level.
888  *
889  * \param p_log libvlc log instance
890  * \param exception an initialized exception pointer
891  */
892 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
893                                               libvlc_exception_t *p_e );
894
895 /**
896  * Open a VLC message log instance.
897  *
898  * \param p_instance libvlc instance
899  * \param exception an initialized exception pointer
900  */
901 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
902
903 /**
904  * Close a VLC message log instance.
905  *
906  * \param p_log libvlc log instance
907  * \param exception an initialized exception pointer
908  */
909 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
910
911 /**
912  * Returns the number of messages in a log instance.
913  *
914  * \param p_log libvlc log instance
915  * \param exception an initialized exception pointer
916  */
917 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
918
919 /**
920  * Clear a log instance.
921  *
922  * All messages in the log are removed. The log should be cleared on a
923  * regular basis to avoid clogging.
924  *
925  * \param p_log libvlc log instance
926  * \param exception an initialized exception pointer
927  */
928 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
929
930 /**
931  * Allocate and returns a new iterator to messages in log.
932  *
933  * \param p_log libvlc log instance
934  * \param exception an initialized exception pointer
935  */
936 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
937
938 /**
939  * Release a previoulsy allocated iterator.
940  *
941  * \param p_log libvlc log iterator
942  * \param exception an initialized exception pointer
943  */
944 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
945
946 /**
947  * Return whether log iterator has more messages.
948  *
949  * \param p_log libvlc log iterator
950  * \param exception an initialized exception pointer
951  */
952 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
953
954 /**
955  * Return the next log message.
956  *
957  * The message contents must not be freed
958  *
959  * \param p_log libvlc log iterator
960  * \param exception an initialized exception pointer
961  */
962 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
963                                                                struct libvlc_log_message_t *buffer,
964                                                                libvlc_exception_t *p_e );
965
966 /** @} */
967
968 # ifdef __cplusplus
969 }
970 # endif
971
972 #endif /* <vlc/libvlc.h> */