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