]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
libvlc: add subtitle file (*.srt...) handling
[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_format 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
179  *****************************************************************************/
180 /** \defgroup libvlc_media libvlc_media
181  * \ingroup libvlc
182  * LibVLC Media
183  * @{
184  */
185
186 /**
187  * Create a media 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
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 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
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.
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 ppsz_options the options (as a string)
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.
243  *
244  * \param p_meta_desc the media to read
245  * \param e_meta_desc the meta to read
246  * \param p_e an initialized exception pointer
247  * \return the media'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 Player
286  *****************************************************************************/
287 /** \defgroup libvlc_media_player libvlc_media_player
288  * \ingroup libvlc
289  * LibVLC Media Player, object that let you play a media
290  * in a libvlc_drawable_t
291  * @{
292  */
293
294 /**
295  * Create an empty Media Player object
296  *
297  * \param p_libvlc_instance the libvlc instance in which the Media Player
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 Player object from a Media
305  *
306  * \param p_md the media. 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 Player 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 that will be used by the media_player. If any,
321  * previous md will be released.
322  *
323  * \param p_mi the Media Player
324  * \param p_md the Media. 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 used by the media_player.
332  *
333  * \param p_mi the Media Player
334  * \param p_e an initialized exception pointer
335  * \return the media associated with p_mi, or NULL if no
336  *         media 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 player send event.
342  *
343  * \param p_mi the Media Player
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 Player
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 Player
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 Player
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 player should render its video output
375  *
376  * \param p_mi the Media Player
377  * \param drawable the libvlc_drawable_t where the media player
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 player should render its video output
385  *
386  * \param p_mi the Media Player
387  * \param p_e an initialized exception pointer
388  * \return the libvlc_drawable_t where the media player
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 player have a video output?
411  *
412  * \param p_md the media player
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 player 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 player 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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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_mediaplayer the media player
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  * Set new video subtitle file.
521  *
522  * \param p_mediaplayer the media player
523  * \param psz_subtitle new video subtitle file
524  * \param p_e an initialized exception pointer
525  * \return the success status (boolean)
526  */
527 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
528
529 /**
530  * Get current crop filter geometry.
531  *
532  * \param p_mediaplayer the media player
533  * \param p_e an initialized exception pointer
534  * \return the crop filter geometry
535  */
536 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
537
538 /**
539  * Set new crop filter geometry.
540  *
541  * \param p_mediaplayer the media player
542  * \param psz_geometry new crop filter geometry
543  * \param p_e an initialized exception pointer
544  */
545 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
546
547 /**
548  * Toggle teletext transparent status on video output.
549  *
550  * \param p_mediaplayer the media player
551  * \param p_e an initialized exception pointer
552  */
553 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
554
555 /**
556  * Get current teletext page requested.
557  *
558  * \param p_mediaplayer the media player
559  * \param p_e an initialized exception pointer
560  * \return the current teletext page requested.
561  */
562 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
563
564 /**
565  * Set new teletext page to retrieve.
566  *
567  * \param p_mediaplayer the media player
568  * \param i_page teletex page number requested
569  * \param p_e an initialized exception pointer
570  */
571 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
572
573 /**
574  * Take a snapshot of the current video window.
575  *
576  * If i_width AND i_height is 0, original size is used.
577  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
578  *
579  * \param p_mediaplayer the media player
580  * \param psz_filepath the path where to save the screenshot to
581  * \param i_width the snapshot's width
582  * \param i_height the snapshot's height
583  * \param p_e an initialized exception pointer
584  */
585 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
586
587 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
588
589 /**
590  * Resize the current video output window.
591  *
592  * \param p_instance libvlc instance
593  * \param width new width for video output window
594  * \param height new height for video output window
595  * \param p_e an initialized exception pointer
596  * \return the success status (boolean)
597  */
598 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
599
600 /**
601  * Change the parent for the current the video output.
602  *
603  * \param p_instance libvlc instance
604  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
605  * \param p_e an initialized exception pointer
606  * \return the success status (boolean)
607  */
608 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
609
610 /**
611  * Tell windowless video output to redraw rectangular area (MacOS X only).
612  *
613  * \param p_instance libvlc instance
614  * \param area coordinates within video drawable
615  * \param p_e an initialized exception pointer
616  */
617 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
618
619 /**
620  * Set the default video output's parent.
621  *
622  * This setting will be used as default for all video outputs.
623  *
624  * \param p_instance libvlc instance
625  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
626  * \param p_e an initialized exception pointer
627  */
628 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
629
630 /**
631  * Set the default video output parent.
632  *
633  * This setting will be used as default for all video outputs.
634  *
635  * \param p_instance libvlc instance
636  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
637  * \param p_e an initialized exception pointer
638  */
639 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
640
641 /**
642  * Set the default video output size.
643  *
644  * This setting will be used as default for all video outputs.
645  *
646  * \param p_instance libvlc instance
647  * \param width new width for video drawable
648  * \param height new height for video drawable
649  * \param p_e an initialized exception pointer
650  */
651 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
652
653 /**
654  * Set the default video output viewport for a windowless video output
655  * (MacOS X only).
656  *
657  * This setting will be used as default for all video outputs.
658  *
659  * \param p_instance libvlc instance
660  * \param view coordinates within video drawable
661  * \param clip coordinates within video drawable
662  * \param p_e an initialized exception pointer
663  */
664 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
665
666 /** @} video */
667
668 /** \defgroup libvlc_audio libvlc_audio
669  * \ingroup libvlc_media_player
670  * LibVLC Audio handling
671  * @{
672  */
673
674 /**
675  * Toggle mute status.
676  *
677  * \param p_instance libvlc instance
678  * \param p_e an initialized exception pointer
679  */
680 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
681
682 /**
683  * Get current mute status.
684  *
685  * \param p_instance libvlc instance
686  * \param p_e an initialized exception pointer
687  * \return the mute status (boolean)
688  */
689 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
690
691 /**
692  * Set mute status.
693  *
694  * \param p_instance libvlc instance
695  * \param status If status is true then mute, otherwise unmute
696  * \param p_e an initialized exception pointer
697  */
698 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
699
700 /**
701  * Get current audio level.
702  *
703  * \param p_instance libvlc instance
704  * \param p_e an initialized exception pointer
705  * \return the audio level (int)
706  */
707 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
708
709 /**
710  * Set current audio level.
711  *
712  * \param p_instance libvlc instance
713  * \param i_volume the volume (int)
714  * \param p_e an initialized exception pointer
715  */
716 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
717
718 /**
719  * Get number of available audio tracks.
720  *
721  * \param p_mi media player
722  * \param p_e an initialized exception
723  * \return the number of available audio tracks (int)
724  */
725 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
726
727 /**
728  * Get current audio track.
729  *
730  * \param p_mi media player
731  * \param p_e an initialized exception pointer
732  * \return the audio track (int)
733  */
734 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
735
736 /**
737  * Set current audio track.
738  *
739  * \param p_mi media player
740  * \param i_track the track (int)
741  * \param p_e an initialized exception pointer
742  */
743 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
744
745 /**
746  * Get current audio channel.
747  *
748  * \param p_instance vlc instance
749  * \param p_e an initialized exception pointer
750  * \return the audio channel (int)
751  */
752 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
753
754 /**
755  * Set current audio channel.
756  *
757  * \param p_instance vlc instance
758  * \param i_channel the audio channel (int)
759  * \param p_e an initialized exception pointer
760  */
761 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
762
763 /** @} audio */
764
765 /** @} media_player */
766
767 /*****************************************************************************
768  * Event handling
769  *****************************************************************************/
770
771 /** \defgroup libvlc_event libvlc_event
772  * \ingroup libvlc_core
773  * LibVLC Events
774  * @{
775  */
776
777 /**
778  * Register for an event notification.
779  *
780  * \param p_event_manager the event manager to which you want to attach to.
781  *        Generally it is obtained by vlc_my_object_event_manager() where
782  *        my_object is the object you want to listen to.
783  * \param i_event_type the desired event to which we want to listen
784  * \param f_callback the function to call when i_event_type occurs
785  * \param user_data user provided data to carry with the event
786  * \param p_e an initialized exception pointer
787  */
788 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
789                                          libvlc_event_type_t i_event_type,
790                                          libvlc_callback_t f_callback,
791                                          void *user_data,
792                                          libvlc_exception_t *p_e );
793
794 /**
795  * Unregister an event notification.
796  *
797  * \param p_event_manager the event manager
798  * \param i_event_type the desired event to which we want to unregister
799  * \param f_callback the function to call when i_event_type occurs
800  * \param p_user_data user provided data to carry with the event
801  * \param p_e an initialized exception pointer
802  */
803 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
804                                          libvlc_event_type_t i_event_type,
805                                          libvlc_callback_t f_callback,
806                                          void *p_user_data,
807                                          libvlc_exception_t *p_e );
808
809 /**
810  * Get an event's type name.
811  *
812  * \param i_event_type the desired event
813  */
814 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
815
816 /** @} */
817
818 /*****************************************************************************
819  * Media Library
820  *****************************************************************************/
821 /** \defgroup libvlc_media_library libvlc_media_library
822  * \ingroup libvlc
823  * LibVLC Media Library
824  * @{
825  */
826 VLC_PUBLIC_API libvlc_media_library_t *
827     libvlc_media_library_new( libvlc_instance_t * p_inst,
828                               libvlc_exception_t * p_e );
829 VLC_PUBLIC_API void
830     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
831 VLC_PUBLIC_API void
832     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
833
834
835 VLC_PUBLIC_API void
836     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
837                                libvlc_exception_t * p_e );
838
839 VLC_PUBLIC_API void
840     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
841                                libvlc_exception_t * p_e );
842
843 VLC_PUBLIC_API libvlc_media_list_t *
844     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
845                                      libvlc_exception_t * p_e );
846
847
848 /** @} */
849
850
851 /*****************************************************************************
852  * Services/Media Discovery
853  *****************************************************************************/
854 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
855  * \ingroup libvlc
856  * LibVLC Media Discoverer
857  * @{
858  */
859
860 VLC_PUBLIC_API libvlc_media_discoverer_t *
861 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
862                                        const char * psz_name,
863                                        libvlc_exception_t * p_e );
864 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
865 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
866
867 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
868
869 VLC_PUBLIC_API libvlc_event_manager_t *
870         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
871
872 VLC_PUBLIC_API int
873         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
874
875 /**@} */
876
877
878 /*****************************************************************************
879  * Message log handling
880  *****************************************************************************/
881
882 /** \defgroup libvlc_log libvlc_log
883  * \ingroup libvlc_core
884  * LibVLC Message Logging
885  * @{
886  */
887
888 /**
889  * Return the VLC messaging verbosity level.
890  *
891  * \param p_instance libvlc instance
892  * \param p_e an initialized exception pointer
893  */
894 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
895                                                   libvlc_exception_t *p_e );
896
897 /**
898  * Set the VLC messaging verbosity level.
899  *
900  * \param p_instance libvlc log instance
901  * \param level log level
902  * \param p_e an initialized exception pointer
903  */
904 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
905                                               libvlc_exception_t *p_e );
906
907 /**
908  * Open a VLC message log instance.
909  *
910  * \param p_instance libvlc instance
911  * \param p_e an initialized exception pointer
912  */
913 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
914
915 /**
916  * Close a VLC message log instance.
917  *
918  * \param p_log libvlc log instance
919  * \param p_e an initialized exception pointer
920  */
921 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
922
923 /**
924  * Returns the number of messages in a log instance.
925  *
926  * \param p_log libvlc log instance
927  * \param p_e an initialized exception pointer
928  */
929 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
930
931 /**
932  * Clear a log instance.
933  *
934  * All messages in the log are removed. The log should be cleared on a
935  * regular basis to avoid clogging.
936  *
937  * \param p_log libvlc log instance
938  * \param p_e an initialized exception pointer
939  */
940 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
941
942 /**
943  * Allocate and returns a new iterator to messages in log.
944  *
945  * \param p_log libvlc log instance
946  * \param p_e an initialized exception pointer
947  */
948 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
949
950 /**
951  * Release a previoulsy allocated iterator.
952  *
953  * \param p_iter libvlc log iterator
954  * \param p_e an initialized exception pointer
955  */
956 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
957
958 /**
959  * Return whether log iterator has more messages.
960  *
961  * \param p_iter libvlc log iterator
962  * \param p_e an initialized exception pointer
963  */
964 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
965
966 /**
967  * Return the next log message.
968  *
969  * The message contents must not be freed
970  *
971  * \param p_iter libvlc log iterator
972  * \param p_buffer log buffer
973  * \param p_e an initialized exception pointer
974  */
975 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
976                                                                libvlc_log_message_t *p_buffer,
977                                                                libvlc_exception_t *p_e );
978
979 /** @} */
980
981 # ifdef __cplusplus
982 }
983 # endif
984
985 #endif /* <vlc/libvlc.h> */