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