]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
Libvlc: Start the implementation of the libvlc playlist. Still in progress.
[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 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
145                                    libvlc_media_descriptor_t *p_meta_desc );
146
147 VLC_PUBLIC_API void libvlc_media_descriptor_release(
148                                    libvlc_media_descriptor_t *p_meta_desc );
149
150 /**
151  * Read the meta of the media descriptor.
152  * \param p_meta_desc the media descriptor to read
153  * \param p_meta_desc the meta to read
154  */
155 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
156                                    libvlc_media_descriptor_t *p_meta_desc,
157                                    libvlc_meta_t e_meta,
158                                    libvlc_exception_t *p_e );
159
160 /** @}*/
161
162 /*****************************************************************************
163  * Playlist
164  *****************************************************************************/
165 /** defgroup libvlc_playlist Playlist
166  * \ingroup libvlc
167  * LibVLC Playlist handling
168  * @{
169  */
170
171 /**
172  * Set loop variable
173  */
174 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
175                                           libvlc_exception_t * );
176
177 /**
178  * Start playing. You can give some additionnal playlist item options
179  * that will be added to the item before playing it.
180  * \param p_instance the instance
181  * \param i_id the item to play. If this is a negative number, the next
182  * item will be selected. Else, the item with the given ID will be played
183  * \param i_options the number of options to add to the item
184  * \param ppsz_options the options to add to the item
185  * \param p_exception an initialized exception
186  */
187 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
188                                           libvlc_exception_t * );
189
190 /**
191  * Pause a running playlist, resume if it was stopped
192  * \param p_instance the instance to pause
193  * \param p_exception an initialized exception
194  */
195 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
196
197 /**
198  * Checks if the playlist is running
199  * \param p_instance the instance
200  * \param p_exception an initialized exception
201  * \return 0 if the playlist is stopped or paused, 1 if it is running
202  */
203 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
204
205 /**
206  * Get the number of items in the playlist
207  * \param p_instance the instance
208  * \param p_exception an initialized exception
209  * \return the number of items
210  */
211 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
212
213 /**
214  * Lock the playlist instance
215  * \param p_instance the instance
216  */
217 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
218
219 /**
220  * Unlock the playlist instance
221  * \param p_instance the instance
222  */
223 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
224
225 /**
226  * Stop playing
227  * \param p_instance the instance to stop
228  * \param p_exception an initialized exception
229  */
230 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
231
232 /**
233  * Go to next playlist item (starts playback if it was stopped)
234  * \param p_instance the instance to use
235  * \param p_exception an initialized exception
236  */
237 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
238
239 /**
240  * Go to previous playlist item (starts playback if it was stopped)
241  * \param p_instance the instance to use
242  * \param p_exception an initialized exception
243  */
244 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
245
246 /**
247  * Remove all playlist items
248  * \param p_instance the instance
249  * \param p_exception an initialized exception
250  */
251 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
252
253 /**
254  * Add an item at the end of the playlist
255  * If you need more advanced options, \see libvlc_playlist_add_extended
256  * \param p_instance the instance
257  * \param psz_uri the URI to open, using VLC format
258  * \param psz_name a name that you might want to give or NULL
259  * \return the identifier of the new item
260  */
261 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
262                                         libvlc_exception_t * );
263
264 /**
265  * Add an item at the end of the playlist, with additional input options
266  * \param p_instance the instance
267  * \param psz_uri the URI to open, using VLC format
268  * \param psz_name a name that you might want to give or NULL
269  * \param i_options the number of options to add
270  * \param ppsz_options strings representing the options to add
271  * \param p_exception an initialized exception
272  * \return the identifier of the new item
273  */
274 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
275                                                  const char *, int, const char **,
276                                                  libvlc_exception_t * );
277
278 /**
279  * Delete the playlist item with the given ID.
280  * \param p_instance the instance
281  * \param i_id the id to remove
282  * \param p_exception an initialized exception
283  * \return
284  */
285 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
286                                                 libvlc_exception_t * );
287
288 /* Get the input that is currently being played by the playlist
289  * \param p_instance the instance to use
290  * \param p_exception an initialized excecption
291  * \return an input object
292  */
293 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
294                                 libvlc_instance_t *, libvlc_exception_t * );
295
296 /** @}*/
297
298 /*****************************************************************************
299  * Media Instance
300  *****************************************************************************/
301 /** defgroup libvlc_media_instance Media Instance
302  * \ingroup libvlc
303  * LibVLC Media Instance
304  * @{
305  */
306
307 /** Create an empty Media Instance object
308  * \param p_libvlc_instance the libvlc instance in which the Media Instance
309  * should be (not used for now).
310  */
311 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
312
313 /** Create a Media Instance object from a Media Descriptor
314  * \param p_md the media descriptor. Afterwards the p_md can safely be
315  * destroyed.
316  */
317 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
318
319 /** Release a media_instance after use
320  * \param p_mi the Media Instance to free
321  */
322 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
323 VLC_PUBLIC_API void libvlc_media_instance_retain( 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  */
337 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
338
339 /** Get the Event Manager from which the media instance send event.
340  * \param p_mi the Media Instance 
341  */
342 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
343
344 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
345 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
346 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
347
348 /// \bug This might go away ... to be replaced by a broader system
349 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
350 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
351 VLC_PUBLIC_API void        libvlc_media_instance_set_time       ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
352 VLC_PUBLIC_API float       libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
353 VLC_PUBLIC_API void        libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
354 VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
355 VLC_PUBLIC_API float       libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
356 VLC_PUBLIC_API void        libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
357 VLC_PUBLIC_API int         libvlc_media_instance_get_state      ( libvlc_media_instance_t *, libvlc_exception_t *);
358
359 /**
360  * Does this input have a video output ?
361  * \param p_input the input
362  * \param p_exception an initialized exception
363  */
364 VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
365 VLC_PUBLIC_API float       libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
366
367
368 /** @} */
369
370 /*****************************************************************************
371  * Tag Query
372  *****************************************************************************/
373 /** defgroup libvlc_tag_query Tag Query
374  * \ingroup libvlc
375  * LibVLC Tag query
376  * @{
377  */
378 VLC_PUBLIC_API libvlc_tag_query_t * 
379     libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
380
381 VLC_PUBLIC_API void 
382     libvlc_tag_query_release( libvlc_tag_query_t * );
383
384 VLC_PUBLIC_API void 
385     libvlc_tag_query_retain( libvlc_tag_query_t * );
386
387 VLC_PUBLIC_API vlc_bool_t 
388     libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
389                             libvlc_exception_t * );
390
391 /** @} */
392
393 /*****************************************************************************
394  * Media List
395  *****************************************************************************/
396 /** defgroup libvlc_media_list MediaList
397  * \ingroup libvlc
398  * LibVLC Media List
399  * @{
400  */
401 VLC_PUBLIC_API libvlc_media_list_t *
402     libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
403
404 VLC_PUBLIC_API void
405     libvlc_media_list_release( libvlc_media_list_t * );
406
407 VLC_PUBLIC_API void
408     libvlc_media_list_retain( libvlc_media_list_t * );
409
410 VLC_PUBLIC_API void
411     libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
412                                             libvlc_media_descriptor_t *,
413                                             libvlc_exception_t * );
414 VLC_PUBLIC_API void
415     libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
416                                                libvlc_media_descriptor_t *,
417                                                int,
418                                                libvlc_exception_t * );
419 VLC_PUBLIC_API void
420     libvlc_media_list_remove_index( libvlc_media_list_t *, int,
421                                     libvlc_exception_t * );
422
423 VLC_PUBLIC_API int
424     libvlc_media_list_count( libvlc_media_list_t * p_mlist,
425                              libvlc_exception_t * p_e );
426
427 VLC_PUBLIC_API libvlc_media_descriptor_t *
428     libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
429                                      libvlc_exception_t * );
430 VLC_PUBLIC_API int
431     libvlc_media_list_index_of_item( libvlc_media_list_t *,
432                                      libvlc_media_descriptor_t *,
433                                      libvlc_exception_t * );
434
435 VLC_PUBLIC_API void
436     libvlc_media_list_lock( libvlc_media_list_t * );
437 VLC_PUBLIC_API void
438     libvlc_media_list_unlock( libvlc_media_list_t * );
439
440 VLC_PUBLIC_API libvlc_event_manager_t *
441     libvlc_media_list_event_manager( libvlc_media_list_t *,
442                                     libvlc_exception_t * );
443
444 VLC_PUBLIC_API libvlc_media_list_t *
445     libvlc_media_list_dynamic_sublist( libvlc_media_list_t *,
446                                        libvlc_tag_query_t *,
447                                        libvlc_exception_t * );
448
449 /** @} */
450
451 /*****************************************************************************
452  * Media List Player
453  *****************************************************************************/
454 /** defgroup libvlc_media_list_player MediaListPlayer
455  * \ingroup libvlc
456  * LibVLC Media List Player
457  * @{
458  */
459 VLC_PUBLIC_API libvlc_media_list_player_t *
460     libvlc_media_list_player_new( libvlc_instance_t * p_instance,
461                                   libvlc_exception_t * p_e );
462 VLC_PUBLIC_API void
463     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
464
465 VLC_PUBLIC_API void
466     libvlc_media_list_player_set_media_instance(
467                                      libvlc_media_list_player_t * p_mlp,
468                                      libvlc_media_instance_t * p_mi,
469                                      libvlc_exception_t * p_e );
470
471 VLC_PUBLIC_API void
472     libvlc_media_list_player_set_media_list(
473                                      libvlc_media_list_player_t * p_mlp,
474                                      libvlc_media_list_t * p_mlist,
475                                      libvlc_exception_t * p_e );
476
477 VLC_PUBLIC_API void
478     libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
479                                    libvlc_exception_t * p_e );
480
481 VLC_PUBLIC_API void
482     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
483                                    libvlc_exception_t * p_e );
484 VLC_PUBLIC_API void
485     libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
486                                    libvlc_exception_t * p_e );
487
488 /** @} */
489
490 /** defgroup libvlc_video Video
491  * \ingroup libvlc
492  * LibVLC Video handling
493  * @{
494  */
495
496 /**
497  * Does this input have a video output ?
498  * \param p_input the input
499  * \param p_exception an initialized exception
500  */
501 VLC_PUBLIC_API vlc_bool_t  libvlc_input_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
502 VLC_PUBLIC_API float       libvlc_input_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
503
504 /**
505  * Toggle fullscreen status on video output
506  * \param p_input the input
507  * \param p_exception an initialized exception
508  */
509 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
510
511 /**
512  * Enable or disable fullscreen on a video output
513  * \param p_input the input
514  * \param b_fullscreen boolean for fullscreen status
515  * \param p_exception an initialized exception
516  */
517 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
518
519 /**
520  * Get current fullscreen status
521  * \param p_input the input
522  * \param p_exception an initialized exception
523  * \return the fullscreen status (boolean)
524  */
525 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
526
527 /**
528  * Get current video height
529  * \param p_input the input
530  * \param p_exception an initialized exception
531  * \return the video height
532  */
533 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
534
535 /**
536  * Get current video width
537  * \param p_input the input
538  * \param p_exception an initialized exception
539  * \return the video width
540  */
541 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
542
543 /**
544  * Get current video aspect ratio
545  * \param p_input the input
546  * \param p_exception an initialized exception
547  * \return the video aspect ratio
548  */
549 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
550
551 /**
552  * Set new video aspect ratio
553  * \param p_input the input
554  * \param psz_aspect new video aspect-ratio
555  * \param p_exception an initialized exception
556  */
557 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
558
559 /**
560  * Get current video subtitle
561  * \param p_input the input
562  * \param p_exception an initialized exception
563  * \return the video subtitle selected
564  */
565 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
566
567 /**
568  * Set new video subtitle
569  * \param p_input the input
570  * \param i_spu new video subtitle to select
571  * \param p_exception an initialized exception
572  */
573 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
574
575 /**
576  * Get current crop filter geometry
577  * \param p_input the input
578  * \param p_exception an initialized exception
579  * \return the crop filter geometry
580  */
581 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
582
583 /**
584  * Set new crop filter geometry
585  * \param p_input the input
586  * \param psz_geometry new crop filter geometry
587  * \param p_exception an initialized exception
588  */
589 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
590
591 /**
592  * Get current teletext page requested.
593  * \param p_input the input
594  * \param p_exception an initialized exception
595  * \return the current teletext page requested.
596  */
597 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
598
599 /**
600  * Set new teletext page to retrieve
601  * \param p_input the input
602  * \param i_page teletex page number requested
603  * \param p_exception an initialized exception
604  */
605 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
606
607 /**
608  * Take a snapshot of the current video window
609  * \param p_input the input
610  * \param psz_filepath the path where to save the screenshot to
611  * \param p_exception an initialized exception
612  */
613 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
614
615 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
616
617 /**
618  * Resize the current video output window
619  * \param p_instance libvlc instance
620  * \param width new width for video output window
621  * \param height new height for video output window
622  * \param p_exception an initialized exception
623  * \return the success status (boolean)
624  */
625 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
626
627 /**
628  * change the parent for the current the video output
629  * \param p_instance libvlc instance
630  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
631  * \param p_exception an initialized exception
632  * \return the success status (boolean)
633  */
634 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
635
636 /**
637  * Tell windowless video output to redraw rectangular area (MacOS X only)
638  * \param p_instance libvlc instance
639  * \param area coordinates within video drawable
640  * \param p_exception an initialized exception
641  */
642 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
643
644 /**
645  * Set the default video output parent
646  *  this settings will be used as default for all video outputs
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_exception an initialized exception
650  */
651 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
652
653 /**
654  * Set the default video output parent
655  *  this settings will be used as default for all video outputs
656  * \param p_instance libvlc instance
657  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
658  * \param p_exception an initialized exception
659  */
660 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
661
662 /**
663  * Set the default video output size
664  *  this settings will be used as default for all video outputs
665  * \param p_instance libvlc instance
666  * \param width new width for video drawable
667  * \param height new height for video drawable
668  * \param p_exception an initialized exception
669  */
670 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
671
672 /**
673  * Set the default video output viewport for a windowless video output (MacOS X only)
674  *  this settings will be used as default for all video outputs
675  * \param p_instance libvlc instance
676  * \param view coordinates within video drawable
677  * \param clip coordinates within video drawable
678  * \param p_exception an initialized exception
679  */
680 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
681
682 /** @} */
683
684 /**
685  * defgroup libvlc_vlm VLM
686  * \ingroup libvlc
687  * LibVLC VLM handling
688  * @{
689  */
690
691 /** defgroup libvlc_audio Audio
692  * \ingroup libvlc
693  * LibVLC Audio handling
694  * @{
695  */
696
697 /**
698  * Toggle mute status
699  * \param p_instance libvlc instance
700  * \param p_exception an initialized exception
701  * \return void
702  */
703 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
704
705 /**
706  * Get current mute status
707  * \param p_instance libvlc instance
708  * \param p_exception an initialized exception
709  * \return the mute status (boolean)
710  */
711 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
712
713 /**
714  * Set mute status
715  * \param p_instance libvlc instance
716  * \param status If status is VLC_TRUE then mute, otherwise unmute
717  * \param p_exception an initialized exception
718  * \return void
719  */
720 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
721
722 /**
723  * Get current audio level
724  * \param p_instance libvlc instance
725  * \param p_exception an initialized exception
726  * \return the audio level (int)
727  */
728 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
729
730 /**
731  * Set current audio level
732  * \param p_instance libvlc instance
733  * \param i_volume the volume (int)
734  * \param p_exception an initialized exception
735  */
736 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
737
738 /**
739 +  * Get current audio track
740 +  * \param p_input input instance
741 +  * \param p_exception an initialized exception
742 +  * \return the audio track (int)
743 +  */
744 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
745
746 /**
747  * Set current audio track
748  * \param p_input input instance
749  * \param i_track the track (int)
750  * \param p_exception an initialized exception
751  */
752 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
753
754 /**
755  * Get current audio channel
756  * \param p_instance input instance
757  * \param p_exception an initialized exception
758  * \return the audio channel (int)
759  */
760 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
761
762 /**
763  * Set current audio channel
764  * \param p_instance input instance
765  * \param i_channel the audio channel (int)
766  * \param p_exception an initialized exception
767  */
768 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
769
770 /** @} */
771
772
773 /**
774  * Add a broadcast, with one input
775  * \param p_instance the instance
776  * \param psz_name the name of the new broadcast
777  * \param psz_input the input MRL
778  * \param psz_output the output MRL (the parameter to the "sout" variable)
779  * \param i_options number of additional options
780  * \param ppsz_options additional options
781  * \param b_enabled boolean for enabling the new broadcast
782  * \param b_loop Should this broadcast be played in loop ?
783  * \param p_exception an initialized exception
784  */
785 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
786                                               int, char **, int, int, libvlc_exception_t * );
787
788 /**
789  * Delete a media (vod or broadcast)
790  * \param p_instance the instance
791  * \param psz_name the media to delete
792  * \param p_exception an initialized exception
793  */
794 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
795
796 /**
797  * Enable or disable a media (vod or broadcast)
798  * \param p_instance the instance
799  * \param psz_name the media to work on
800  * \param b_enabled the new status
801  * \param p_exception an initialized exception
802  */
803 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
804                                             libvlc_exception_t *);
805
806 /**
807  * Set the output for a media
808  * \param p_instance the instance
809  * \param psz_name the media to work on
810  * \param psz_output the output MRL (the parameter to the "sout" variable)
811  * \param p_exception an initialized exception
812  */
813 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
814                                            libvlc_exception_t *);
815
816 /**
817  * Set a media's input MRL. This will delete all existing inputs and
818  * add the specified one.
819  * \param p_instance the instance
820  * \param psz_name the media to work on
821  * \param psz_input the input MRL
822  * \param p_exception an initialized exception
823  */
824 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
825                                           libvlc_exception_t *);
826
827 /**
828  * Add a media's input MRL. This will add the specified one.
829  * \param p_instance the instance
830  * \param psz_name the media to work on
831  * \param psz_input the input MRL
832  * \param p_exception an initialized exception
833  */
834 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
835                                           libvlc_exception_t *p_exception );
836 /**
837  * Set output for a media
838  * \param p_instance the instance
839  * \param psz_name the media to work on
840  * \param b_loop the new status
841  * \param p_exception an initialized exception
842  */
843 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
844                                          libvlc_exception_t *);
845
846 /**
847  * Edit the parameters of a media. This will delete all existing inputs and
848  * add the specified one.
849  * \param p_instance the instance
850  * \param psz_name the name of the new broadcast
851  * \param psz_input the input MRL
852  * \param psz_output the output MRL (the parameter to the "sout" variable)
853  * \param i_options number of additional options
854  * \param ppsz_options additional options
855  * \param b_enabled boolean for enabling the new broadcast
856  * \param b_loop Should this broadcast be played in loop ?
857  * \param p_exception an initialized exception
858  */
859 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
860                                              int, char **, int, int, libvlc_exception_t * );
861
862 /**
863  * Plays the named broadcast.
864  * \param p_instance the instance
865  * \param psz_name the name of the broadcast
866  * \param p_exception an initialized exception
867  */
868 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
869
870 /**
871  * Stops the named broadcast.
872  * \param p_instance the instance
873  * \param psz_name the name of the broadcast
874  * \param p_exception an initialized exception
875  */ 
876 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
877
878 /**
879  * Pauses the named broadcast.
880  * \param p_instance the instance
881  * \param psz_name the name of the broadcast
882  * \param p_exception an initialized exception
883  */ 
884 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
885     
886 /**
887  * Seeks in the named broadcast.
888  * \param p_instance the instance
889  * \param psz_name the name of the broadcast
890  * \param f_percentage the percentage to seek to
891  * \param p_exception an initialized exception
892  */ 
893 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
894                                            float, libvlc_exception_t * );
895    
896 /**
897  * Return information of the named broadcast.
898  * \param p_instance the instance
899  * \param psz_name the name of the broadcast
900  * \param p_exception an initialized exception
901  */ 
902 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
903
904 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
905 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
906                         char *, int , libvlc_exception_t * );
907
908 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
909 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
910 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
911 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
912 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
913 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
914 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
915
916 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
917
918 /** @} */
919 /** @} */
920
921 /*****************************************************************************
922  * Message log handling
923  *****************************************************************************/
924
925 /** defgroup libvlc_log Log
926  * \ingroup libvlc
927  * LibVLC Message Logging
928  * @{
929  */
930
931 /**
932  * Returns the VLC messaging verbosity level
933  * \param p_instance libvlc instance
934  * \param exception an initialized exception pointer
935  */
936 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
937                                                   libvlc_exception_t *p_e );
938
939 /**
940  * Set the VLC messaging verbosity level
941  * \param p_log libvlc log instance
942  * \param exception an initialized exception pointer
943  */
944 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
945                                               libvlc_exception_t *p_e );
946
947 /**
948  * Open an instance to VLC message log 
949  * \param p_instance libvlc instance
950  * \param exception an initialized exception pointer
951  */
952 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
953
954 /**
955  * Close an instance of VLC message log 
956  * \param p_log libvlc log instance
957  * \param exception an initialized exception pointer
958  */
959 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
960
961 /**
962  * Returns the number of messages in log
963  * \param p_log libvlc log instance
964  * \param exception an initialized exception pointer
965  */
966 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
967
968 /**
969  * Clear all messages in log
970  *  the log should be cleared on a regular basis to avoid clogging
971  * \param p_log libvlc log instance
972  * \param exception an initialized exception pointer
973  */
974 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
975
976 /**
977  * Allocate and returns a new iterator to messages in log
978  * \param p_log libvlc log instance
979  * \param exception an initialized exception pointer
980  */
981 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
982
983 /**
984  * Releases a previoulsy allocated iterator
985  * \param p_log libvlc log iterator 
986  * \param exception an initialized exception pointer
987  */
988 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
989
990 /**
991  * Returns whether log iterator has more messages 
992  * \param p_log libvlc log iterator
993  * \param exception an initialized exception pointer
994  */
995 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
996
997 /**
998  * Returns next log message
999  *   the content of message must not be freed
1000  * \param p_log libvlc log iterator
1001  * \param exception an initialized exception pointer
1002  */
1003 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1004                                                                struct libvlc_log_message_t *buffer,
1005                                                                libvlc_exception_t *p_e );
1006
1007 /** @} */
1008
1009 /*****************************************************************************
1010  * Event handling
1011  *****************************************************************************/
1012
1013 /** defgroup libvlc_callbacks Callbacks
1014  * \ingroup libvlc
1015  * LibVLC Events
1016  * @{
1017  */
1018
1019 /**
1020  * Register for an event notification
1021  * \param p_event_manager the event manager to which you want to attach to
1022  * Generally it is obtained by vlc_my_object_event_manager() where my_object
1023  * Is the object you want to listen to.
1024  * \param i_event_type the desired event to which we want to listen
1025  * \param f_callback the function to call when i_event_type occurs
1026  * \param user_data user provided data to carry with the event
1027  * \param p_e an initialized exception pointer
1028  */
1029 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1030                                          libvlc_event_type_t i_event_type,
1031                                          libvlc_callback_t f_callback,
1032                                          void *user_data,
1033                                          libvlc_exception_t *p_e );
1034
1035 /**
1036  * Unregister an event notification
1037  * \param p_event_manager the event manager
1038  * \param i_event_type the desired event to which we want to unregister
1039  * \param f_callback the function to call when i_event_type occurs
1040  * \param p_e an initialized exception pointer
1041  */
1042 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1043                                          libvlc_event_type_t i_event_type,
1044                                          libvlc_callback_t f_callback,
1045                                          void *p_user_data,
1046                                          libvlc_exception_t *p_e );
1047
1048
1049 /**
1050  * Get an event type name 
1051  * \param i_event_type the desired event
1052  */
1053 #define libvlc_event_type_name(a) #a
1054
1055 /** @} */
1056
1057
1058 # ifdef __cplusplus
1059 }
1060 # endif
1061
1062 #endif /* <vlc/libvlc.h> */