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 $
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
25 * \defgroup libvlc Libvlc
26 * This is libvlc, the base library of the VLC program.
41 /*****************************************************************************
43 *****************************************************************************/
44 /** defgroup libvlc_exception Exceptions
46 * LibVLC Exceptions handling
50 struct libvlc_exception_t
55 typedef struct libvlc_exception_t libvlc_exception_t;
58 * Initialize an exception structure. This can be called several times to reuse
59 * an exception structure.
60 * \param p_exception the exception to initialize
62 void libvlc_exception_init( libvlc_exception_t *p_exception );
65 * Has an exception been raised ?
66 * \param p_exception the exception to query
67 * \return 0 if no exception raised, 1 else
69 int libvlc_exception_raised( libvlc_exception_t *p_exception );
73 * \param p_exception the exception to raise
74 * \param psz_message the exception message
76 void libvlc_exception_raise( libvlc_exception_t *p_exception, char *psz_format, ... );
79 * Clear an exception object so it can be reused.
80 * The exception object must be initialized
81 * \param p_exception the exception to clear
83 void libvlc_exception_clear( libvlc_exception_t * );
86 * Get exception message
87 * \param p_exception the exception to query
88 * \return the exception message or NULL if not applicable (exception not raised
91 char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
95 /*****************************************************************************
97 *****************************************************************************/
99 /** defgroup libvlc_core Core
105 /** This structure is opaque. It represents a libvlc instance */
106 typedef struct libvlc_instance_t libvlc_instance_t;
109 * Create an initialized libvlc instance
110 * \param argc the number of arguments
111 * \param argv command-line-type arguments
112 * \param exception an initialized exception pointer
114 libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
117 * Destroy a libvlc instance
118 * \param p_instance the instance to destroy
120 void libvlc_destroy( libvlc_instance_t *);
124 /*****************************************************************************
126 *****************************************************************************/
127 /** defgroup libvlc_playlist Playlist
129 * LibVLC Playlist handling
134 * Start playing. You can give some additionnal playlist item options
135 * that will be added to the item before playing it.
136 * \param p_instance the instance
137 * \param i_id the item to play. If this is a negative number, the next
138 * item will be selected. Else, the item with the given ID will be played
139 * \param i_options the number of options to add to the item
140 * \param ppsz_options the options to add to the item
141 * \param p_exception an initialized exception
143 void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
144 libvlc_exception_t * );
147 * Pause a running playlist, resume if it was stopped
148 * \param p_instance the instance to pause
149 * \param p_exception an initialized exception
151 void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
154 * Checks if the playlist is running
155 * \param p_instance the instance
156 * \param p_exception an initialized exception
157 * \return 0 if the playlist is stopped or paused, 1 if it is running
159 int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
162 * Get the number of items in the playlist
163 * \param p_instance the instance
164 * \param p_exception an initialized exception
165 * \return the number of items
167 int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
171 * \param p_instance the instance to stop
172 * \param p_exception an initialized exception
174 void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
177 * Go to next playlist item (starts playback if it was stopped)
178 * \param p_instance the instance to use
179 * \param p_exception an initialized exception
181 void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
184 * Go to previous playlist item (starts playback if it was stopped)
185 * \param p_instance the instance to use
186 * \param p_exception an initialized exception
188 void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
191 * Remove all playlist items
192 * \param p_instance the instance
193 * \param p_exception an initialized exception
195 void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
198 * Go to next playlist item
199 * \param p_instance the instance
200 * \param p_exception an initialized exception
202 void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
205 * Go to Previous playlist item
206 * \param p_instance the instance
207 * \param p_exception an initialized exception
209 void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
212 * Add an item at the end of the playlist
213 * If you need more advanced options, \see libvlc_playlist_add_extended
214 * \param p_instance the instance
215 * \param psz_uri the URI to open, using VLC format
216 * \param psz_name a name that you might want to give or NULL
217 * \return the identifier of the new item
219 int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
220 libvlc_exception_t * );
223 * Add an item at the end of the playlist, with additional input options
224 * \param p_instance the instance
225 * \param psz_uri the URI to open, using VLC format
226 * \param psz_name a name that you might want to give or NULL
227 * \param i_options the number of options to add
228 * \param ppsz_options strings representing the options to add
229 * \return the identifier of the new item
231 int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
232 const char *, int, const char **,
233 libvlc_exception_t * );
237 typedef struct libvlc_input_t libvlc_input_t;
239 /* Get the input that is currently being played by the playlist
240 * \param p_instance the instance to use
241 * \param p_exception an initialized excecption
242 * \return an input object
244 libvlc_input_t *libvlc_playlist_get_input( libvlc_instance_t *,
245 libvlc_exception_t * );
251 /*****************************************************************************
253 *****************************************************************************/
254 /** defgroup libvlc_input Input
256 * LibVLC Input handling
260 /** Free an input object
261 * \param p_input the input to free
263 void libvlc_input_free( libvlc_input_t * );
265 /// \bug This might go away ... to be replaced by a broader system
266 vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
267 vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *);
268 float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *);
273 /** defgroup libvlc_video Video
275 * LibVLC Video handling
280 * Toggle fullscreen status on video output
281 * \param p_input the input
282 * \param p_exception an initialized exception
284 void libvlc_toggle_fullscreen( libvlc_input_t *, libvlc_exception_t * );
287 * Enable or disable fullscreen on a video output
288 * \param p_input the input
289 * \param b_fullscreen boolean for fullscreen status
290 * \param p_exception an initialized exception
292 void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * );
295 * Get current fullscreen status
296 * \param p_input the input
297 * \param p_exception an initialized exception
298 * \return the fullscreen status (boolean)
300 int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
305 * defgroup libvlc_vlm VLM
307 * LibVLC VLM handling
313 * Add a broadcast, with one input
314 * \param p_instance the instance
315 * \param psz_name the name of the new broadcast
316 * \param psz_input the input MRL
317 * \param psz_output the output MRL (the parameter to the "sout" variable)
318 * \param i_options number of additional options
319 * \param ppsz_options additional options
320 * \param b_enabled boolean for enabling the new broadcast
321 * \param b_loop Should this broadcast be played in loop ?
322 * \param p_exception an initialized exception
324 void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
325 int, char **, int, int, libvlc_exception_t * );
328 * Delete a media (vod or broadcast)
329 * \param p_instance the instance
330 * \param psz_name the media to delete
331 * \param p_exception an initialized exception
333 void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
336 * Enable or disable a media (vod or broadcast)
337 * \param p_instance the instance
338 * \param psz_name the media to work on
339 * \param b_enabled the new status
340 * \param p_exception an initialized exception
342 void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
343 libvlc_exception_t *);
346 * Set the output for a media
347 * \param p_instance the instance
348 * \param psz_name the media to work on
349 * \param psz_output the output MRL (the parameter to the "sout" variable)
350 * \param p_exception an initialized exception
352 void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
353 libvlc_exception_t *);
356 * Set a media's input MRL. This will delete all existing inputs and
357 * add the specified one.
358 * \param p_instance the instance
359 * \param psz_name the media to work on
360 * \param psz_input the input MRL
361 * \param p_exception an initialized exception
363 void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
364 libvlc_exception_t *);
369 * Set output for a media
370 * \param p_instance the instance
371 * \param psz_name the media to work on
372 * \param b_loop the new status
373 * \param p_exception an initialized exception
375 void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
376 libvlc_exception_t *);
382 * Edit the parameters of a media. This will delete all existing inputs and
383 * add the specified one.
384 * \param p_instance the instance
385 * \param psz_name the name of the new broadcast
386 * \param psz_input the input MRL
387 * \param psz_output the output MRL (the parameter to the "sout" variable)
388 * \param i_options number of additional options
389 * \param ppsz_options additional options
390 * \param b_enabled boolean for enabling the new broadcast
391 * \param b_loop Should this broadcast be played in loop ?
392 * \param p_exception an initialized exception
394 void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
395 int, char **, int, int, libvlc_exception_t * );
405 #endif /* <vlc/libvlc.h> */