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