]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
vlc/libvlc.h: Make media_descriptor_duplicate Public.
[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
65 libvlc_exception_raised( const libvlc_exception_t *p_exception );
66
67 /**
68  * Raise an exception
69  * \param p_exception the exception to raise
70  * \param psz_message the exception message
71  */
72 VLC_PUBLIC_API void
73 libvlc_exception_raise( libvlc_exception_t *p_exception,
74                         const char *psz_format, ... );
75
76 /**
77  * Clear an exception object so it can be reused.
78  * The exception object must be initialized
79  * \param p_exception the exception to clear
80  */
81 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
82
83 /**
84  * Get exception message
85  * \param p_exception the exception to query
86  * \return the exception message or NULL if not applicable (exception not raised
87  * for example)
88  */
89 VLC_PUBLIC_API const char *
90 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
91
92 /**@} */
93
94 /*****************************************************************************
95  * Core handling
96  *****************************************************************************/
97
98 /** defgroup libvlc_core Core
99  * \ingroup libvlc
100  * LibVLC Core
101  * @{
102  */
103
104 /**
105  * Create an initialized libvlc instance.
106  * \param argc the number of arguments
107  * \param argv command-line-type arguments
108  * \param exception an initialized exception pointer
109  */
110 VLC_PUBLIC_API libvlc_instance_t *
111 libvlc_new( int , const char *const *, libvlc_exception_t *);
112
113 /**
114  * Returns a libvlc instance identifier for legacy APIs. Use of this
115  * function is discouraged, you should convert your program to use the
116  * new API.
117  * \param p_instance the instance
118  */
119 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
120
121 /**
122  * Decrements the reference count of a libvlc instance, and destroys it
123  * if it reaches zero.
124  * \param p_instance the instance to destroy
125  */
126 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t *, libvlc_exception_t * );
127
128 /**
129  * Increments the reference count of a libvlc instance.
130  * The reference count is initially one when libvlc_new() returns.
131  */
132 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
133
134 /** @}*/
135
136 /*****************************************************************************
137  * Media descriptor
138  *****************************************************************************/
139 /** defgroup libvlc_media_descriptor Media Descriptor
140  * \ingroup libvlc
141  * LibVLC Media Descriptor
142  * @{
143  */
144
145 /**
146  * Create a media descriptor with the given mrl.
147  * \param p_instance the instance
148  * \param psz_mrl the mrl to read
149  */
150 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
151                                    libvlc_instance_t *p_instance,
152                                    const char * psz_mrl,
153                                    libvlc_exception_t *p_e );
154
155 /**
156  * Create a media descriptor as an empty node with the passed name.
157  * \param p_instance the instance
158  * \param psz_name the name of the node
159  */
160 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
161                                    libvlc_instance_t *p_instance,
162                                    const char * psz_name,
163                                    libvlc_exception_t *p_e );
164
165 /**
166  * Add an option to the media descriptor,
167  * This option will be used to determine how the media_instance will
168  * read the media_descriptor. This allow to use VLC advanced
169  * reading/streaming options in a per-media basis.
170  *
171  * The options are detailled in vlc --long-help, for instance "--sout-all"
172  * \param p_instance the instance
173  * \param psz_mrl the mrl to read
174  */
175 VLC_PUBLIC_API void libvlc_media_descriptor_add_option(
176                                    libvlc_media_descriptor_t * p_md,
177                                    const char * ppsz_options,
178                                    libvlc_exception_t * p_e );
179
180 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
181                                    libvlc_media_descriptor_t *p_meta_desc );
182
183 VLC_PUBLIC_API void libvlc_media_descriptor_release(
184                                    libvlc_media_descriptor_t *p_meta_desc );
185
186 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
187                                                        libvlc_exception_t * p_e );
188
189 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_duplicate( libvlc_media_descriptor_t * );
190
191 /**
192  * Read the meta of the media descriptor.
193  * \param p_meta_desc the media descriptor to read
194  * \param p_meta_desc the meta to read
195  */
196 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
197                                    libvlc_media_descriptor_t *p_meta_desc,
198                                    libvlc_meta_t e_meta,
199                                    libvlc_exception_t *p_e );
200
201 VLC_PUBLIC_API libvlc_state_t libvlc_media_descriptor_get_state(
202                                    libvlc_media_descriptor_t *p_meta_desc,
203                                    libvlc_exception_t *p_e );
204
205 /* Tags */
206 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
207                                                      const char * key,
208                                                      const libvlc_tag_t tag,
209                                                      libvlc_exception_t *p_e );
210
211 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
212                                                          const char * key,
213                                                          const libvlc_tag_t tag,
214                                                          libvlc_exception_t *p_e );
215
216 VLC_PUBLIC_API int
217     libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
218                                                 const char * key,
219                                                 libvlc_exception_t *p_e );
220
221 VLC_PUBLIC_API libvlc_tag_t
222     libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
223                                                   int i,
224                                                   const char * key,
225                                                   libvlc_exception_t *p_e );
226
227 VLC_PUBLIC_API libvlc_media_list_t *
228     libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
229                                       libvlc_exception_t *p_e );
230
231 VLC_PUBLIC_API libvlc_event_manager_t *
232     libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
233                                            libvlc_exception_t * p_e );
234
235 VLC_PUBLIC_API libvlc_time_t
236    libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
237                                          libvlc_exception_t * p_e );
238
239 VLC_PUBLIC_API vlc_bool_t
240    libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
241                                          libvlc_exception_t * p_e );
242
243 VLC_PUBLIC_API void
244     libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
245                                            void * p_new_user_data,
246                                            libvlc_exception_t * p_e);
247 VLC_PUBLIC_API void *
248     libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
249                                            libvlc_exception_t * p_e);
250
251 /** @}*/
252
253 /*****************************************************************************
254  * Playlist
255  *****************************************************************************/
256 /** defgroup libvlc_playlist Playlist
257  * \ingroup libvlc
258  * LibVLC Playlist handling
259  * @{
260  */
261
262 /**
263  * Set loop variable
264  */
265 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
266                                           libvlc_exception_t * );
267
268 /**
269  * Start playing. You can give some additionnal playlist item options
270  * that will be added to the item before playing it.
271  * \param p_instance the instance
272  * \param i_id the item to play. If this is a negative number, the next
273  * item will be selected. Else, the item with the given ID will be played
274  * \param i_options the number of options to add to the item
275  * \param ppsz_options the options to add to the item
276  * \param p_exception an initialized exception
277  */
278 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
279                                           libvlc_exception_t * );
280
281 /**
282  * Pause a running playlist, resume if it was stopped
283  * \param p_instance the instance to pause
284  * \param p_exception an initialized exception
285  */
286 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
287
288 /**
289  * Checks if the playlist is running
290  * \param p_instance the instance
291  * \param p_exception an initialized exception
292  * \return 0 if the playlist is stopped or paused, 1 if it is running
293  */
294 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
295
296 /**
297  * Get the number of items in the playlist
298  * \param p_instance the instance
299  * \param p_exception an initialized exception
300  * \return the number of items
301  */
302 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
303
304 /**
305  * Lock the playlist instance
306  * \param p_instance the instance
307  */
308 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
309
310 /**
311  * Unlock the playlist instance
312  * \param p_instance the instance
313  */
314 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
315
316 /**
317  * Stop playing
318  * \param p_instance the instance to stop
319  * \param p_exception an initialized exception
320  */
321 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
322
323 /**
324  * Go to next playlist item (starts playback if it was stopped)
325  * \param p_instance the instance to use
326  * \param p_exception an initialized exception
327  */
328 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
329
330 /**
331  * Go to previous playlist item (starts playback if it was stopped)
332  * \param p_instance the instance to use
333  * \param p_exception an initialized exception
334  */
335 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
336
337 /**
338  * Remove all playlist items
339  * \param p_instance the instance
340  * \param p_exception an initialized exception
341  */
342 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
343
344 /**
345  * Add an item at the end of the playlist
346  * If you need more advanced options, \see libvlc_playlist_add_extended
347  * \param p_instance the instance
348  * \param psz_uri the URI to open, using VLC format
349  * \param psz_name a name that you might want to give or NULL
350  * \return the identifier of the new item
351  */
352 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
353                                         libvlc_exception_t * );
354
355 /**
356  * Add an item at the end of the playlist, with additional input options
357  * \param p_instance the instance
358  * \param psz_uri the URI to open, using VLC format
359  * \param psz_name a name that you might want to give or NULL
360  * \param i_options the number of options to add
361  * \param ppsz_options strings representing the options to add
362  * \param p_exception an initialized exception
363  * \return the identifier of the new item
364  */
365 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
366                                                  const char *, int, const char **,
367                                                  libvlc_exception_t * );
368
369 /**
370  * Delete the playlist item with the given ID.
371  * \param p_instance the instance
372  * \param i_id the id to remove
373  * \param p_exception an initialized exception
374  * \return
375  */
376 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
377                                                 libvlc_exception_t * );
378
379 /** Get the input that is currently being played by the playlist
380  * \param p_instance the instance to use
381  * \param p_exception an initialized excecption
382  * \return an input object
383  */
384 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
385                                 libvlc_instance_t *, libvlc_exception_t * );
386
387 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_is_seekable(
388                                  libvlc_media_instance_t *p_mi,
389                                  libvlc_exception_t *p_e );
390
391 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_can_pause(
392                                  libvlc_media_instance_t *p_mi,
393                                  libvlc_exception_t *p_e );
394
395 /** @}*/
396
397 /*****************************************************************************
398  * Media Instance
399  *****************************************************************************/
400 /** defgroup libvlc_media_instance Media Instance
401  * \ingroup libvlc
402  * LibVLC Media Instance
403  * @{
404  */
405
406 /** Create an empty Media Instance object
407  * \param p_libvlc_instance the libvlc instance in which the Media Instance
408  * should be (not used for now).
409  */
410 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
411
412 /** Create a Media Instance object from a Media Descriptor
413  * \param p_md the media descriptor. Afterwards the p_md can safely be
414  * destroyed.
415  */
416 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
417
418 /** Release a media_instance after use
419  * \param p_mi the Media Instance to free
420  */
421 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
422 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
423
424 /** Set the media descriptor that will be used by the media_instance. If any,
425  * previous md will be released.
426  * \param p_mi the Media Instance
427  * \param p_md the Media Descriptor. Afterwards the p_md can safely be
428  * destroyed.
429  */
430 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
431
432 /** Get the media descriptor used by the media_instance (if any). A copy of
433  * the md is returned. NULL is returned if no media instance is associated.
434  * \param p_mi the Media Instance
435  */
436 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
437
438 /** Get the Event Manager from which the media instance send event.
439  * \param p_mi the Media Instance
440  */
441 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
442
443 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
444 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
445 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
446
447 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
448
449 /** \bug This might go away ... to be replaced by a broader system */
450 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
451 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
452 VLC_PUBLIC_API void          libvlc_media_instance_set_time       ( libvlc_media_instance_t *, libvlc_time_t, libvlc_exception_t *);
453 VLC_PUBLIC_API float         libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
454 VLC_PUBLIC_API void          libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
455 VLC_PUBLIC_API void          libvlc_media_instance_set_chapter    ( libvlc_media_instance_t *, int, libvlc_exception_t *);
456 VLC_PUBLIC_API int           libvlc_media_instance_get_chapter    (libvlc_media_instance_t *, libvlc_exception_t *);
457 VLC_PUBLIC_API int           libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
458 VLC_PUBLIC_API vlc_bool_t    libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
459 VLC_PUBLIC_API float         libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
460 VLC_PUBLIC_API void          libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
461 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state   ( libvlc_media_instance_t *, libvlc_exception_t *);
462
463 /**
464  * Does this input have a video output ?
465  * \param p_input the input
466  * \param p_exception an initialized exception
467  */
468 VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
469 VLC_PUBLIC_API float       libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
470
471
472 /** @} */
473
474 /*****************************************************************************
475  * Tag Query
476  *****************************************************************************/
477 /** defgroup libvlc_tag_query Tag Query
478  * \ingroup libvlc
479  * LibVLC Tag query
480  * @{
481  */
482 VLC_PUBLIC_API libvlc_tag_query_t *
483     libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
484
485 VLC_PUBLIC_API void
486     libvlc_tag_query_release( libvlc_tag_query_t * );
487
488 VLC_PUBLIC_API void
489     libvlc_tag_query_retain( libvlc_tag_query_t * );
490
491 VLC_PUBLIC_API void
492     libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
493                                             libvlc_tag_t tag,
494                                             char * psz_tag_key,
495                                             libvlc_exception_t * );
496
497 VLC_PUBLIC_API vlc_bool_t
498     libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
499                             libvlc_exception_t * );
500
501 /** @} */
502
503 /*****************************************************************************
504  * Media List
505  *****************************************************************************/
506 /** defgroup libvlc_media_list MediaList
507  * \ingroup libvlc
508  * LibVLC Media List
509  * @{
510  */
511 VLC_PUBLIC_API libvlc_media_list_t *
512     libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
513
514 VLC_PUBLIC_API void
515     libvlc_media_list_release( libvlc_media_list_t * );
516
517 VLC_PUBLIC_API void
518     libvlc_media_list_retain( libvlc_media_list_t * );
519
520 VLC_PUBLIC_API void
521     libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
522                                         const char * psz_uri,
523                                         libvlc_exception_t * p_e );
524
525 VLC_PUBLIC_API void
526     libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
527                                             libvlc_media_descriptor_t *,
528                                             libvlc_exception_t *);
529
530 VLC_PUBLIC_API libvlc_media_descriptor_t *
531     libvlc_media_list_media_descriptor( libvlc_media_list_t *,
532                                         libvlc_exception_t *);
533
534 VLC_PUBLIC_API void
535     libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
536                                             libvlc_media_descriptor_t *,
537                                             libvlc_exception_t * );
538 VLC_PUBLIC_API void
539     libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
540                                                libvlc_media_descriptor_t *,
541                                                int,
542                                                libvlc_exception_t * );
543 VLC_PUBLIC_API void
544     libvlc_media_list_remove_index( libvlc_media_list_t *, int,
545                                     libvlc_exception_t * );
546
547 VLC_PUBLIC_API int
548     libvlc_media_list_count( libvlc_media_list_t * p_mlist,
549                              libvlc_exception_t * p_e );
550
551 VLC_PUBLIC_API libvlc_media_descriptor_t *
552     libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
553                                      libvlc_exception_t * );
554 VLC_PUBLIC_API int
555     libvlc_media_list_index_of_item( libvlc_media_list_t *,
556                                      libvlc_media_descriptor_t *,
557                                      libvlc_exception_t * );
558
559 /* This indicates if this media list is read-only from a user point of view */
560 VLC_PUBLIC_API vlc_bool_t
561     libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist );
562
563 VLC_PUBLIC_API void
564     libvlc_media_list_lock( libvlc_media_list_t * );
565 VLC_PUBLIC_API void
566     libvlc_media_list_unlock( libvlc_media_list_t * );
567
568 VLC_PUBLIC_API libvlc_media_list_view_t *
569     libvlc_media_list_flat_view( libvlc_media_list_t *,
570                                  libvlc_exception_t * );
571
572 VLC_PUBLIC_API libvlc_media_list_view_t *
573     libvlc_media_list_hierarchical_view( libvlc_media_list_t *,
574                                          libvlc_exception_t * );
575
576 VLC_PUBLIC_API libvlc_media_list_view_t *
577     libvlc_media_list_hierarchical_node_view( libvlc_media_list_t *,
578                                               libvlc_exception_t * );
579
580 VLC_PUBLIC_API libvlc_event_manager_t *
581     libvlc_media_list_event_manager( libvlc_media_list_t *,
582                                      libvlc_exception_t * );
583 /** @} */
584
585
586 /*****************************************************************************
587  * Media List View
588  *****************************************************************************/
589 /** defgroup libvlc_media_list_view MediaListView
590  * \ingroup libvlc
591  * LibVLC Media List View
592  * @{ */
593
594 VLC_PUBLIC_API void
595     libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
596
597 VLC_PUBLIC_API void
598     libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
599
600 VLC_PUBLIC_API libvlc_event_manager_t *
601     libvlc_media_list_view_event_manager(  libvlc_media_list_view_t * p_mlv );
602
603 VLC_PUBLIC_API int
604     libvlc_media_list_view_count(  libvlc_media_list_view_t * p_mlv,
605                                    libvlc_exception_t * p_e );
606
607 VLC_PUBLIC_API libvlc_media_descriptor_t *
608     libvlc_media_list_view_item_at_index(  libvlc_media_list_view_t * p_mlv,
609                                            int index,
610                                            libvlc_exception_t * p_e );
611
612 VLC_PUBLIC_API libvlc_media_list_view_t *
613     libvlc_media_list_view_children_at_index(  libvlc_media_list_view_t * p_mlv,
614                                            int index,
615                                            libvlc_exception_t * p_e );
616
617
618 VLC_PUBLIC_API int
619     libvlc_media_list_view_index_of_item(  libvlc_media_list_view_t * p_mlv,
620                                            libvlc_media_descriptor_t * p_md,
621                                            libvlc_exception_t * p_e );
622
623 VLC_PUBLIC_API void
624     libvlc_media_list_view_insert_at_index(  libvlc_media_list_view_t * p_mlv,
625                                              libvlc_media_descriptor_t * p_md,
626                                              int index,
627                                              libvlc_exception_t * p_e );
628
629 VLC_PUBLIC_API void
630     libvlc_media_list_view_remove_at_index(  libvlc_media_list_view_t * p_mlv,
631                                              int index,
632                                              libvlc_exception_t * p_e );
633
634 VLC_PUBLIC_API void
635     libvlc_media_list_view_add_item(  libvlc_media_list_view_t * p_mlv,
636                                       libvlc_media_descriptor_t * p_md,
637                                       libvlc_exception_t * p_e );
638
639 VLC_PUBLIC_API libvlc_media_list_t *
640     libvlc_media_list_view_parent_media_list(  libvlc_media_list_view_t * p_mlv,
641                                                libvlc_exception_t * p_e );
642
643 /** @} */
644
645 /*****************************************************************************
646  * Dynamic Media List (Deprecated)
647  *****************************************************************************/
648 /** defgroup libvlc_media_list MediaList
649  * \ingroup libvlc
650  * LibVLC Media List
651  * @{ */
652
653 VLC_PUBLIC_API libvlc_dynamic_media_list_t *
654     libvlc_dynamic_media_list_new(  libvlc_media_list_t * p_mlist,
655                                     libvlc_tag_query_t * p_query,
656                                     libvlc_tag_t tag,
657                                     libvlc_exception_t * p_e );
658 VLC_PUBLIC_API void
659     libvlc_dynamic_media_list_release( libvlc_dynamic_media_list_t * p_dmlist );
660
661 VLC_PUBLIC_API void
662     libvlc_dynamic_media_list_retain( libvlc_dynamic_media_list_t * p_dmlist );
663
664 libvlc_media_list_t *
665     libvlc_dynamic_media_list_media_list( libvlc_dynamic_media_list_t * p_dmlist,
666                                           libvlc_exception_t * p_e );
667
668 /** @} */
669
670 /*****************************************************************************
671  * Media Library
672  *****************************************************************************/
673 /** defgroup libvlc_media_library Media Library
674  * \ingroup libvlc
675  * LibVLC Media Library
676  * @{
677  */
678 VLC_PUBLIC_API libvlc_media_library_t *
679     libvlc_media_library_new( libvlc_instance_t * p_inst,
680                               libvlc_exception_t * p_e );
681 VLC_PUBLIC_API void
682     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
683 VLC_PUBLIC_API void
684     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
685
686
687 VLC_PUBLIC_API void
688     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
689                                libvlc_exception_t * p_e );
690
691 VLC_PUBLIC_API void
692     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
693                                libvlc_exception_t * p_e );
694
695 VLC_PUBLIC_API libvlc_media_list_t *
696     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
697                                      libvlc_exception_t * p_e );
698
699
700 /** @} */
701
702 /*****************************************************************************
703  * Media List Player
704  *****************************************************************************/
705 /** defgroup libvlc_media_list_player MediaListPlayer
706  * \ingroup libvlc
707  * LibVLC Media List Player
708  * @{
709  */
710 VLC_PUBLIC_API libvlc_media_list_player_t *
711     libvlc_media_list_player_new( libvlc_instance_t * p_instance,
712                                   libvlc_exception_t * p_e );
713 VLC_PUBLIC_API void
714     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
715
716 VLC_PUBLIC_API void
717     libvlc_media_list_player_set_media_instance(
718                                      libvlc_media_list_player_t * p_mlp,
719                                      libvlc_media_instance_t * p_mi,
720                                      libvlc_exception_t * p_e );
721
722 VLC_PUBLIC_API void
723     libvlc_media_list_player_set_media_list(
724                                      libvlc_media_list_player_t * p_mlp,
725                                      libvlc_media_list_t * p_mlist,
726                                      libvlc_exception_t * p_e );
727
728 VLC_PUBLIC_API void
729     libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
730                                    libvlc_exception_t * p_e );
731
732 VLC_PUBLIC_API void
733     libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
734                                    libvlc_exception_t * p_e );
735
736 VLC_PUBLIC_API vlc_bool_t
737     libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
738                                          libvlc_exception_t * p_e );
739
740 VLC_PUBLIC_API libvlc_state_t
741     libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
742                                         libvlc_exception_t * p_e );
743
744 VLC_PUBLIC_API void
745     libvlc_media_list_player_play_item_at_index(
746                                    libvlc_media_list_player_t * p_mlp,
747                                    int i_index,
748                                    libvlc_exception_t * p_e );
749
750 VLC_PUBLIC_API void
751     libvlc_media_list_player_play_item(
752                                    libvlc_media_list_player_t * p_mlp,
753                                    libvlc_media_descriptor_t * p_md,
754                                    libvlc_exception_t * p_e );
755
756 VLC_PUBLIC_API void
757     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
758                                    libvlc_exception_t * p_e );
759 VLC_PUBLIC_API void
760     libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
761                                    libvlc_exception_t * p_e );
762
763 /** @} */
764
765 /** defgroup libvlc_video Video
766  * \ingroup libvlc
767  * LibVLC Video handling
768  * @{
769  */
770
771 /**
772  * Toggle fullscreen status on video output
773  * \param p_input the input
774  * \param p_exception an initialized exception
775  */
776 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
777
778 /**
779  * Enable or disable fullscreen on a video output
780  * \param p_input the input
781  * \param b_fullscreen boolean for fullscreen status
782  * \param p_exception an initialized exception
783  */
784 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
785
786 /**
787  * Get current fullscreen status
788  * \param p_input the input
789  * \param p_exception an initialized exception
790  * \return the fullscreen status (boolean)
791  */
792 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
793
794 /**
795  * Get current video height
796  * \param p_input the input
797  * \param p_exception an initialized exception
798  * \return the video height
799  */
800 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
801
802 /**
803  * Get current video width
804  * \param p_input the input
805  * \param p_exception an initialized exception
806  * \return the video width
807  */
808 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
809
810 /**
811  * Get current video aspect ratio
812  * \param p_input the input
813  * \param p_exception an initialized exception
814  * \return the video aspect ratio
815  */
816 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
817
818 /**
819  * Set new video aspect ratio
820  * \param p_input the input
821  * \param psz_aspect new video aspect-ratio
822  * \param p_exception an initialized exception
823  */
824 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
825
826 /**
827  * Get current video subtitle
828  * \param p_input the input
829  * \param p_exception an initialized exception
830  * \return the video subtitle selected
831  */
832 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
833
834 /**
835  * Set new video subtitle
836  * \param p_input the input
837  * \param i_spu new video subtitle to select
838  * \param p_exception an initialized exception
839  */
840 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
841
842 /**
843  * Get current crop filter geometry
844  * \param p_input the input
845  * \param p_exception an initialized exception
846  * \return the crop filter geometry
847  */
848 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
849
850 /**
851  * Set new crop filter geometry
852  * \param p_input the input
853  * \param psz_geometry new crop filter geometry
854  * \param p_exception an initialized exception
855  */
856 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
857
858 /**
859  * Toggle teletext transparent status on video output
860  * \param p_input the input
861  * \param p_exception an initialized exception
862  */
863 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
864
865 /**
866  * Get current teletext page requested.
867  * \param p_input the input
868  * \param p_exception an initialized exception
869  * \return the current teletext page requested.
870  */
871 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
872
873 /**
874  * Set new teletext page to retrieve
875  * \param p_input the input
876  * \param i_page teletex page number requested
877  * \param p_exception an initialized exception
878  */
879 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
880
881 /**
882  * Take a snapshot of the current video window
883  * If i_width AND i_height is 0, original size is used
884  * if i_width XOR i_height is 0, original aspect-ratio is preserved
885  * \param p_input the input
886  * \param psz_filepath the path where to save the screenshot to
887  * \param i_width the snapshot's width
888  * \param i_height the snapshot's height
889  * \param p_exception an initialized exception
890  */
891 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
892
893 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
894
895 /**
896  * Resize the current video output window
897  * \param p_instance libvlc instance
898  * \param width new width for video output window
899  * \param height new height for video output window
900  * \param p_exception an initialized exception
901  * \return the success status (boolean)
902  */
903 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
904
905 /**
906  * change the parent for the current the video output
907  * \param p_instance libvlc instance
908  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
909  * \param p_exception an initialized exception
910  * \return the success status (boolean)
911  */
912 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
913
914 /**
915  * Tell windowless video output to redraw rectangular area (MacOS X only)
916  * \param p_instance libvlc instance
917  * \param area coordinates within video drawable
918  * \param p_exception an initialized exception
919  */
920 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
921
922 /**
923  * Set the default video output parent
924  *  this settings will be used as default for all video outputs
925  * \param p_instance libvlc instance
926  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
927  * \param p_exception an initialized exception
928  */
929 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
930
931 /**
932  * Set the default video output parent
933  *  this settings will be used as default for all video outputs
934  * \param p_instance libvlc instance
935  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
936  * \param p_exception an initialized exception
937  */
938 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
939
940 /**
941  * Set the default video output size
942  *  this settings will be used as default for all video outputs
943  * \param p_instance libvlc instance
944  * \param width new width for video drawable
945  * \param height new height for video drawable
946  * \param p_exception an initialized exception
947  */
948 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
949
950 /**
951  * Set the default video output viewport for a windowless video output (MacOS X only)
952  *  this settings will be used as default for all video outputs
953  * \param p_instance libvlc instance
954  * \param view coordinates within video drawable
955  * \param clip coordinates within video drawable
956  * \param p_exception an initialized exception
957  */
958 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
959
960 /** @} */
961
962 /** defgroup libvlc_audio Audio
963  * \ingroup libvlc
964  * LibVLC Audio handling
965  * @{
966  */
967
968 /**
969  * Toggle mute status
970  * \param p_instance libvlc instance
971  * \param p_exception an initialized exception
972  * \return void
973  */
974 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
975
976 /**
977  * Get current mute status
978  * \param p_instance libvlc instance
979  * \param p_exception an initialized exception
980  * \return the mute status (boolean)
981  */
982 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
983
984 /**
985  * Set mute status
986  * \param p_instance libvlc instance
987  * \param status If status is VLC_TRUE then mute, otherwise unmute
988  * \param p_exception an initialized exception
989  * \return void
990  */
991 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
992
993 /**
994  * Get current audio level
995  * \param p_instance libvlc instance
996  * \param p_exception an initialized exception
997  * \return the audio level (int)
998  */
999 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
1000
1001 /**
1002  * Set current audio level
1003  * \param p_instance libvlc instance
1004  * \param i_volume the volume (int)
1005  * \param p_exception an initialized exception
1006  */
1007 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1008
1009 /**
1010  * Get number of available audio tracks
1011  * \param p_mi media instance
1012  * \param p_e an initialized exception
1013  * \return the number of available audio tracks (int)
1014  */
1015 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *,  libvlc_exception_t * );
1016
1017 /**
1018 +  * Get current audio track
1019 +  * \param p_input input instance
1020 +  * \param p_exception an initialized exception
1021 +  * \return the audio track (int)
1022 +  */
1023 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
1024
1025 /**
1026  * Set current audio track
1027  * \param p_input input instance
1028  * \param i_track the track (int)
1029  * \param p_exception an initialized exception
1030  */
1031 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
1032
1033 /**
1034  * Get current audio channel
1035  * \param p_instance input instance
1036  * \param p_exception an initialized exception
1037  * \return the audio channel (int)
1038  */
1039 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1040
1041 /**
1042  * Set current audio channel
1043  * \param p_instance input instance
1044  * \param i_channel the audio channel (int)
1045  * \param p_exception an initialized exception
1046  */
1047 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
1048
1049 /** @} */
1050
1051 /*****************************************************************************
1052  * Services/Media Discovery
1053  *****************************************************************************/
1054 /** defgroup libvlc_media_discoverer Media Discoverer
1055  * \ingroup libvlc
1056  * LibVLC Media Discoverer
1057  * @{
1058  */
1059
1060 VLC_PUBLIC_API libvlc_media_discoverer_t *
1061 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1062                                        const char * psz_name,
1063                                        libvlc_exception_t * p_e );
1064 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1065 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1066
1067 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1068
1069 VLC_PUBLIC_API libvlc_event_manager_t *
1070         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1071
1072 VLC_PUBLIC_API vlc_bool_t
1073         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1074
1075 /**@} */
1076
1077 /*****************************************************************************
1078  * VLM
1079  *****************************************************************************/
1080 /** defgroup libvlc_vlm VLM
1081  * \ingroup libvlc
1082  * LibVLC VLM
1083  * @{
1084  */
1085
1086 /**
1087  * Add a broadcast, with one input
1088  * \param p_instance the instance
1089  * \param psz_name the name of the new broadcast
1090  * \param psz_input the input MRL
1091  * \param psz_output the output MRL (the parameter to the "sout" variable)
1092  * \param i_options number of additional options
1093  * \param ppsz_options additional options
1094  * \param b_enabled boolean for enabling the new broadcast
1095  * \param b_loop Should this broadcast be played in loop ?
1096  * \param p_exception an initialized exception
1097  */
1098 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
1099                                               int, char **, int, int, libvlc_exception_t * );
1100
1101 /**
1102  * Delete a media (vod or broadcast)
1103  * \param p_instance the instance
1104  * \param psz_name the media to delete
1105  * \param p_exception an initialized exception
1106  */
1107 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1108
1109 /**
1110  * Enable or disable a media (vod or broadcast)
1111  * \param p_instance the instance
1112  * \param psz_name the media to work on
1113  * \param b_enabled the new status
1114  * \param p_exception an initialized exception
1115  */
1116 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
1117                                             libvlc_exception_t *);
1118
1119 /**
1120  * Set the output for a media
1121  * \param p_instance the instance
1122  * \param psz_name the media to work on
1123  * \param psz_output the output MRL (the parameter to the "sout" variable)
1124  * \param p_exception an initialized exception
1125  */
1126 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1127                                            libvlc_exception_t *);
1128
1129 /**
1130  * Set a media's input MRL. This will delete all existing inputs and
1131  * add the specified one.
1132  * \param p_instance the instance
1133  * \param psz_name the media to work on
1134  * \param psz_input the input MRL
1135  * \param p_exception an initialized exception
1136  */
1137 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1138                                           libvlc_exception_t *);
1139
1140 /**
1141  * Add a media's input MRL. This will add the specified one.
1142  * \param p_instance the instance
1143  * \param psz_name the media to work on
1144  * \param psz_input the input MRL
1145  * \param p_exception an initialized exception
1146  */
1147 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1148                                           libvlc_exception_t *p_exception );
1149 /**
1150  * Set output for a media
1151  * \param p_instance the instance
1152  * \param psz_name the media to work on
1153  * \param b_loop the new status
1154  * \param p_exception an initialized exception
1155  */
1156 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1157                                          libvlc_exception_t *);
1158
1159 /**
1160  * Edit the parameters of a media. This will delete all existing inputs and
1161  * add the specified one.
1162  * \param p_instance the instance
1163  * \param psz_name the name of the new broadcast
1164  * \param psz_input the input MRL
1165  * \param psz_output the output MRL (the parameter to the "sout" variable)
1166  * \param i_options number of additional options
1167  * \param ppsz_options additional options
1168  * \param b_enabled boolean for enabling the new broadcast
1169  * \param b_loop Should this broadcast be played in loop ?
1170  * \param p_exception an initialized exception
1171  */
1172 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1173                                              int, char **, int, int, libvlc_exception_t * );
1174
1175 /**
1176  * Plays the named broadcast.
1177  * \param p_instance the instance
1178  * \param psz_name the name of the broadcast
1179  * \param p_exception an initialized exception
1180  */
1181 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1182
1183 /**
1184  * Stops the named broadcast.
1185  * \param p_instance the instance
1186  * \param psz_name the name of the broadcast
1187  * \param p_exception an initialized exception
1188  */
1189 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1190
1191 /**
1192  * Pauses the named broadcast.
1193  * \param p_instance the instance
1194  * \param psz_name the name of the broadcast
1195  * \param p_exception an initialized exception
1196  */
1197 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1198
1199 /**
1200  * Seeks in the named broadcast.
1201  * \param p_instance the instance
1202  * \param psz_name the name of the broadcast
1203  * \param f_percentage the percentage to seek to
1204  * \param p_exception an initialized exception
1205  */
1206 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1207                                            float, libvlc_exception_t * );
1208
1209 /**
1210  * Return information of the named broadcast.
1211  * \param p_instance the instance
1212  * \param psz_name the name of the broadcast
1213  * \param p_exception an initialized exception
1214  */
1215 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1216
1217 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1218 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1219                         char *, int , libvlc_exception_t * );
1220
1221 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1222 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1223 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1224 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1225 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1226 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1227 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1228
1229 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1230
1231 /** @} */
1232
1233 /*****************************************************************************
1234  * Message log handling
1235  *****************************************************************************/
1236
1237 /** defgroup libvlc_log Log
1238  * \ingroup libvlc
1239  * LibVLC Message Logging
1240  * @{
1241  */
1242
1243 /**
1244  * Returns the VLC messaging verbosity level
1245  * \param p_instance libvlc instance
1246  * \param exception an initialized exception pointer
1247  */
1248 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1249                                                   libvlc_exception_t *p_e );
1250
1251 /**
1252  * Set the VLC messaging verbosity level
1253  * \param p_log libvlc log instance
1254  * \param exception an initialized exception pointer
1255  */
1256 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1257                                               libvlc_exception_t *p_e );
1258
1259 /**
1260  * Open an instance to VLC message log
1261  * \param p_instance libvlc instance
1262  * \param exception an initialized exception pointer
1263  */
1264 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1265
1266 /**
1267  * Close an instance of VLC message log
1268  * \param p_log libvlc log instance
1269  * \param exception an initialized exception pointer
1270  */
1271 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1272
1273 /**
1274  * Returns the number of messages in log
1275  * \param p_log libvlc log instance
1276  * \param exception an initialized exception pointer
1277  */
1278 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1279
1280 /**
1281  * Clear all messages in log
1282  *  the log should be cleared on a regular basis to avoid clogging
1283  * \param p_log libvlc log instance
1284  * \param exception an initialized exception pointer
1285  */
1286 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1287
1288 /**
1289  * Allocate and returns a new iterator to messages in log
1290  * \param p_log libvlc log instance
1291  * \param exception an initialized exception pointer
1292  */
1293 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1294
1295 /**
1296  * Releases a previoulsy allocated iterator
1297  * \param p_log libvlc log iterator
1298  * \param exception an initialized exception pointer
1299  */
1300 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1301
1302 /**
1303  * Returns whether log iterator has more messages
1304  * \param p_log libvlc log iterator
1305  * \param exception an initialized exception pointer
1306  */
1307 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1308
1309 /**
1310  * Returns next log message
1311  *   the content of message must not be freed
1312  * \param p_log libvlc log iterator
1313  * \param exception an initialized exception pointer
1314  */
1315 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1316                                                                struct libvlc_log_message_t *buffer,
1317                                                                libvlc_exception_t *p_e );
1318
1319 /** @} */
1320
1321 /*****************************************************************************
1322  * Event handling
1323  *****************************************************************************/
1324
1325 /** defgroup libvlc_callbacks Callbacks
1326  * \ingroup libvlc
1327  * LibVLC Events
1328  * @{
1329  */
1330
1331 /**
1332  * Register for an event notification
1333  * \param p_event_manager the event manager to which you want to attach to
1334  * Generally it is obtained by vlc_my_object_event_manager() where my_object
1335  * Is the object you want to listen to.
1336  * \param i_event_type the desired event to which we want to listen
1337  * \param f_callback the function to call when i_event_type occurs
1338  * \param user_data user provided data to carry with the event
1339  * \param p_e an initialized exception pointer
1340  */
1341 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1342                                          libvlc_event_type_t i_event_type,
1343                                          libvlc_callback_t f_callback,
1344                                          void *user_data,
1345                                          libvlc_exception_t *p_e );
1346
1347 /**
1348  * Unregister an event notification
1349  * \param p_event_manager the event manager
1350  * \param i_event_type the desired event to which we want to unregister
1351  * \param f_callback the function to call when i_event_type occurs
1352  * \param p_e an initialized exception pointer
1353  */
1354 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1355                                          libvlc_event_type_t i_event_type,
1356                                          libvlc_callback_t f_callback,
1357                                          void *p_user_data,
1358                                          libvlc_exception_t *p_e );
1359
1360 /**
1361  * Get an event type name
1362  * \param i_event_type the desired event
1363  */
1364 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1365
1366 /** @} */
1367
1368
1369 # ifdef __cplusplus
1370 }
1371 # endif
1372
1373 #endif /* <vlc/libvlc.h> */