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