1 /*****************************************************************************
2 * deprecated.h: libvlc deprecated API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
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.
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.
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 *****************************************************************************/
25 #ifndef _LIBVLC_DEPRECATED_H
26 #define _LIBVLC_DEPRECATED_H 1
33 /*****************************************************************************
34 * Playlist (Deprecated)
35 *****************************************************************************/
36 /** \defgroup libvlc_playlist Playlist (Deprecated)
38 * LibVLC Playlist handling (Deprecated)
39 * @deprecated Use media_list
44 * Set the playlist's loop attribute. If set, the playlist runs continuously
45 * and wraps around when it reaches the end.
47 * \param p_instance the playlist instance
48 * \param loop the loop attribute. 1 sets looping, 0 disables it
49 * \param p_e an initialized exception pointer
51 VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
52 libvlc_exception_t * );
57 * Additionnal playlist item options can be specified for addition to the
58 * item before it is played.
60 * \param p_instance the playlist instance
61 * \param i_id the item to play. If this is a negative number, the next
62 * item will be selected. Otherwise, the item with the given ID will be
64 * \param i_options the number of options to add to the item
65 * \param ppsz_options the options to add to the item
66 * \param p_e an initialized exception pointer
68 VLC_DEPRECATED_API void libvlc_playlist_play( libvlc_instance_t*, int, int,
69 char **, libvlc_exception_t * );
72 * Toggle the playlist's pause status.
74 * If the playlist was running, it is paused. If it was paused, it is resumed.
76 * \param p_instance the playlist instance to pause
77 * \param p_e an initialized exception pointer
79 VLC_DEPRECATED_API void libvlc_playlist_pause( libvlc_instance_t *,
80 libvlc_exception_t * );
83 * Checks whether the playlist is running
85 * \param p_instance the playlist instance
86 * \param p_e an initialized exception pointer
87 * \return 0 if the playlist is stopped or paused, 1 if it is running
89 VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
90 libvlc_exception_t * );
93 * Get the number of items in the playlist
95 * \param p_instance the playlist instance
96 * \param p_e an initialized exception pointer
97 * \return the number of items
99 VLC_DEPRECATED_API int libvlc_playlist_items_count( libvlc_instance_t *,
100 libvlc_exception_t * );
105 * \param p_instance the playlist instance
107 VLC_DEPRECATED_API void libvlc_playlist_lock( libvlc_instance_t * );
110 * Unlock the playlist.
112 * \param p_instance the playlist instance
114 VLC_DEPRECATED_API void libvlc_playlist_unlock( libvlc_instance_t * );
119 * \param p_instance the playlist instance to stop
120 * \param p_e an initialized exception pointer
122 VLC_DEPRECATED_API void libvlc_playlist_stop( libvlc_instance_t *,
123 libvlc_exception_t * );
126 * Go to the next playlist item. If the playlist was stopped, playback
129 * \param p_instance the playlist instance
130 * \param p_e an initialized exception pointer
132 VLC_DEPRECATED_API void libvlc_playlist_next( libvlc_instance_t *,
133 libvlc_exception_t * );
136 * Go to the previous playlist item. If the playlist was stopped, playback
139 * \param p_instance the playlist instance
140 * \param p_e an initialized exception pointer
142 VLC_DEPRECATED_API void libvlc_playlist_prev( libvlc_instance_t *,
143 libvlc_exception_t * );
146 * Empty a playlist. All items in the playlist are removed.
148 * \param p_instance the playlist instance
149 * \param p_e an initialized exception pointer
151 VLC_DEPRECATED_API void libvlc_playlist_clear( libvlc_instance_t *,
152 libvlc_exception_t * );
155 * Append an item to the playlist. The item is added at the end. If more
156 * advanced options are required, \see libvlc_playlist_add_extended instead.
158 * \param p_instance the playlist instance
159 * \param psz_uri the URI to open, using VLC format
160 * \param psz_name a name that you might want to give or NULL
161 * \param p_e an initialized exception pointer
162 * \return the identifier of the new item
164 VLC_DEPRECATED_API int libvlc_playlist_add( libvlc_instance_t *, const char *,
165 const char *, libvlc_exception_t * );
168 * Append an item to the playlist. The item is added at the end, with
169 * additional input options.
171 * \param p_instance the playlist instance
172 * \param psz_uri the URI to open, using VLC format
173 * \param psz_name a name that you might want to give or NULL
174 * \param i_options the number of options to add
175 * \param ppsz_options strings representing the options to add
176 * \param p_e an initialized exception pointer
177 * \return the identifier of the new item
179 VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
180 const char *, int, const char **,
181 libvlc_exception_t * );
184 * Delete the playlist item with the given ID.
186 * \param p_instance the playlist instance
187 * \param i_id the id to remove
188 * \param p_e an initialized exception pointer
189 * \return 0 in case of success, a non-zero value otherwise
191 VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
192 libvlc_exception_t * );
194 /** Get the input that is currently being played by the playlist.
196 * \param p_instance the playlist instance to use
197 * \param p_e an initialized exception pointern
198 * \return a media instance object
200 VLC_DEPRECATED_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
201 libvlc_instance_t *, libvlc_exception_t * );
206 * \defgroup libvlc_old Libvlc Old (Deprecated)
207 * This is libvlc, the base library of the VLC program. (Deprecated)
208 * This is the legacy API. Please consider using the new libvlc API
215 /*****************************************************************************
216 * Exported vlc API (Deprecated)
217 *****************************************************************************/
219 /*****************************************************************************
221 *****************************************************************************/
223 /* Used by VLC_AddTarget() */
224 #define PLAYLIST_INSERT 0x0001
225 #define PLAYLIST_APPEND 0x0002
226 #define PLAYLIST_GO 0x0004
227 #define PLAYLIST_PREPARSE 0x0008
228 #define PLAYLIST_SPREPARSE 0x0010
229 #define PLAYLIST_NO_REBUILD 0x0020
231 #define PLAYLIST_END -666
233 /*****************************************************************************
235 *****************************************************************************/
236 #define VLC_SUCCESS -0 /* No error */
237 #define VLC_ENOMEM -1 /* Not enough memory */
238 #define VLC_ETHREAD -2 /* Thread error */
239 #define VLC_ETIMEOUT -3 /* Timeout */
241 #define VLC_ENOMOD -10 /* Module not found */
243 #define VLC_ENOOBJ -20 /* Object not found */
244 #define VLC_EBADOBJ -21 /* Bad object type */
246 #define VLC_ENOVAR -30 /* Variable not found */
247 #define VLC_EBADVAR -31 /* Bad variable value */
249 #define VLC_ENOITEM -40 /**< Item not found */
251 #define VLC_EEXIT -255 /* Program exited */
252 #define VLC_EEXITSUCCESS -999 /* Program exited successfully */
253 #define VLC_EGENERIC -666 /* Generic error */
255 /*****************************************************************************
257 *****************************************************************************/
258 #define VLC_FALSE false
259 #define VLC_TRUE true
262 * \defgroup var_type Variable types
263 * These are the different types a vlc variable can have.
266 #define VLC_VAR_VOID 0x0010
267 #define VLC_VAR_BOOL 0x0020
268 #define VLC_VAR_INTEGER 0x0030
269 #define VLC_VAR_HOTKEY 0x0031
270 #define VLC_VAR_STRING 0x0040
271 #define VLC_VAR_MODULE 0x0041
272 #define VLC_VAR_FILE 0x0042
273 #define VLC_VAR_DIRECTORY 0x0043
274 #define VLC_VAR_VARIABLE 0x0044
275 #define VLC_VAR_FLOAT 0x0050
276 #define VLC_VAR_TIME 0x0060
277 #define VLC_VAR_ADDRESS 0x0070
278 #define VLC_VAR_MUTEX 0x0080
279 #define VLC_VAR_LIST 0x0090
283 #if !defined( __LIBVLC__ )
284 /* Otherwise they are declared and exported in vlc_common.h */
286 * Retrieve libvlc version
288 * \return a string containing the libvlc version
290 VLC_DEPRECATED_API char const * VLC_Version ( void );
293 * Retrieve libvlc compile time
295 * \return a string containing the libvlc compile time
297 VLC_DEPRECATED_API char const * VLC_CompileTime ( void );
300 * Retrieve the username of the libvlc builder
302 * \return a string containing the username of the libvlc builder
304 VLC_DEPRECATED_API char const * VLC_CompileBy ( void );
307 * Retrieve the host of the libvlc builder
309 * \return a string containing the host of the libvlc builder
311 VLC_DEPRECATED_API char const * VLC_CompileHost ( void );
314 * Retrieve the domain name of the host of the libvlc builder
316 * \return a string containing the domain name of the host of the libvlc builder
318 VLC_DEPRECATED_API char const * VLC_CompileDomain ( void );
321 * Retrieve libvlc compiler version
323 * \return a string containing the libvlc compiler version
325 VLC_DEPRECATED_API char const * VLC_Compiler ( void );
328 * Retrieve libvlc changeset
330 * \return a string containing the libvlc subversion changeset
332 VLC_DEPRECATED_API char const * VLC_Changeset ( void );
335 * Return an error string
337 * \param i_err an error code
338 * \return an error string
340 VLC_DEPRECATED_API char const * VLC_Error ( int i_err );
342 #endif /* __LIBVLC__ */
347 * This function allocates a vlc_t structure and returns a negative value
348 * in case of failure. Also, the thread system is initialized
350 * \return vlc object id or an error code
352 VLC_DEPRECATED_API int VLC_Create( void );
355 * Initialize a vlc_t structure
357 * This function initializes a previously allocated vlc_t structure:
359 * - gettext initialization
360 * - message queue, module bank and playlist initialization
361 * - configuration and commandline parsing
363 * \param i_object a vlc object id
364 * \param i_argc the number of arguments
365 * \param ppsz_argv an array of arguments
366 * \return VLC_SUCCESS on success
368 VLC_DEPRECATED_API int VLC_Init( int, int, const char *[] );
373 * This function opens an interface plugin and runs it. If b_block is set
374 * to 0, VLC_AddIntf will return immediately and let the interface run in a
375 * separate thread. If b_block is set to 1, VLC_AddIntf will continue until
376 * user requests to quit.
378 * \param i_object a vlc object id
379 * \param psz_module a vlc module name of an interface
380 * \param b_block make this interface blocking
381 * \param b_play start playing when the interface is done loading
382 * \return VLC_SUCCESS on success
384 VLC_DEPRECATED_API int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t );
389 * This function sets p_libvlc->b_die to VLC_TRUE, but does not do any other
390 * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
392 * \param i_object a vlc object id
393 * \return VLC_SUCCESS on success
395 VLC_DEPRECATED_API int VLC_Die( int );
398 * Clean up all the intf, playlist, vout and aout
400 * This function requests all intf, playlist, vout and aout objects to finish
401 * and CleanUp. Only a blank VLC object should remain after this.
403 * \note This function was previously called VLC_Stop
405 * \param i_object a vlc object id
406 * \return VLC_SUCCESS on success
408 VLC_DEPRECATED_API int VLC_CleanUp( int );
411 * Destroy all threads and the VLC object
413 * This function requests the running threads to finish, waits for their
414 * termination, and destroys their structure.
415 * Then it will de-init all VLC object initializations.
417 * \param i_object a vlc object id
418 * \return VLC_SUCCESS on success
420 VLC_DEPRECATED_API int VLC_Destroy( int );
425 * This function sets a variable of VLC
427 * \note Was previously called VLC_Set
429 * \param i_object a vlc object id
430 * \param psz_var a vlc variable name
431 * \param value a vlc_value_t structure
432 * \return VLC_SUCCESS on success
434 VLC_DEPRECATED_API int VLC_VariableSet( int, char const *, vlc_value_t );
439 * This function gets the value of a variable of VLC
440 * It stores it in the p_value argument
442 * \note Was previously called VLC_Get
444 * \param i_object a vlc object id
445 * \param psz_var a vlc variable name
446 * \param p_value a pointer to a vlc_value_t structure
447 * \return VLC_SUCCESS on success
449 VLC_DEPRECATED_API int VLC_VariableGet( int, char const *, vlc_value_t * );
452 * Get a VLC variable type
454 * This function gets the type of a variable of VLC
455 * It stores it in the p_type argument
457 * \param i_object a vlc object id
458 * \param psz_var a vlc variable name
459 * \param pi_type a pointer to an integer
460 * \return VLC_SUCCESS on success
462 VLC_DEPRECATED_API int VLC_VariableType( int, char const *, int * );
465 * Add a target to the current playlist
467 * This funtion will add a target to the current playlist. If a playlist does
468 * not exist, it will be created.
470 * \param i_object a vlc object id
471 * \param psz_target the URI of the target to play
472 * \param ppsz_options an array of strings with input options (ie. :input-repeat)
473 * \param i_options the amount of options in the ppsz_options array
474 * \param i_mode the insert mode to insert the target into the playlist (PLAYLIST_* defines)
475 * \param i_pos the position at which to add the new target (PLAYLIST_END for end)
476 * \return the item id on success and -1 on error
478 VLC_DEPRECATED_API int VLC_AddTarget( int, char const *, const char **, int, int, int );
481 * Start the playlist and play the currently selected playlist item
483 * If there is something in the playlist, and the playlist is not running,
484 * then start the playlist and play the currently selected playlist item.
485 * If an item is currently paused, then resume it.
487 * \param i_object a vlc object id
488 * \return VLC_SUCCESS on success
490 VLC_DEPRECATED_API int VLC_Play( int );
493 * Pause the currently playing item. Resume it if already paused
495 * If an item is currently playing then pause it.
496 * If the item is already paused, then resume playback.
498 * \param i_object a vlc object id
499 * \return VLC_SUCCESS on success
501 VLC_DEPRECATED_API int VLC_Pause( int );
506 * If an item is currently playing then stop it.
507 * Set the playlist to a stopped state.
509 * \note This function is new. The old VLC_Stop is now called VLC_CleanUp
511 * \param i_object a vlc object id
512 * \return VLC_SUCCESS on success
514 VLC_DEPRECATED_API int VLC_Stop( int );
517 * Tell if VLC is playing
519 * If an item is currently playing, it returns
520 * VLC_TRUE, else VLC_FALSE
522 * \param i_object a vlc object id
523 * \return VLC_TRUE or VLC_FALSE
525 VLC_DEPRECATED_API vlc_bool_t VLC_IsPlaying( int );
528 * Get the current position in a input
530 * Return the current position as a float
531 * This method should be used for time sliders etc
532 * \note For some inputs, this will be unknown.
534 * \param i_object a vlc object id
535 * \return a float in the range of 0.0 - 1.0
537 VLC_DEPRECATED_API float VLC_PositionGet( int );
540 * Set the current position in a input
542 * Set the current position as a float
543 * This method should be used for time sliders etc
544 * \note For some inputs, this will be unknown.
546 * \param i_object a vlc object id
547 * \param i_position a float in the range of 0.0 - 1.0
548 * \return a float in the range of 0.0 - 1.0
550 VLC_DEPRECATED_API float VLC_PositionSet( int, float );
553 * Get the current position in a input
555 * Return the current position in seconds from the start.
556 * \note For some inputs, this will be unknown.
558 * \param i_object a vlc object id
559 * \return the offset from 0:00 in seconds
561 VLC_DEPRECATED_API int VLC_TimeGet( int );
564 * Seek to a position in the current input
566 * Seek i_seconds in the current input. If b_relative is set,
567 * then the seek will be relative to the current position, otherwise
568 * it will seek to i_seconds from the beginning of the input.
569 * \note For some inputs, this will be unknown.
571 * \param i_object a vlc object id
572 * \param i_seconds seconds from current position or from beginning of input
573 * \param b_relative seek relative from current position
574 * \return VLC_SUCCESS on success
576 VLC_DEPRECATED_API int VLC_TimeSet( int, int, vlc_bool_t );
579 * Get the total length of a input
581 * Return the total length in seconds from the current input.
582 * \note For some inputs, this will be unknown.
584 * \param i_object a vlc object id
585 * \return the length in seconds
587 VLC_DEPRECATED_API int VLC_LengthGet( int );
590 * Play the input faster than realtime
592 * 2x, 4x, 8x faster than realtime
593 * \note For some inputs, this will be impossible.
595 * \param i_object a vlc object id
596 * \return the current speedrate
598 VLC_DEPRECATED_API float VLC_SpeedFaster( int );
601 * Play the input slower than realtime
603 * 1/2x, 1/4x, 1/8x slower than realtime
604 * \note For some inputs, this will be impossible.
606 * \param i_object a vlc object id
607 * \return the current speedrate
609 VLC_DEPRECATED_API float VLC_SpeedSlower( int );
612 * Return the current playlist item
614 * \param i_object a vlc object id
615 * \return the index of the playlistitem that is currently selected for play
617 VLC_DEPRECATED_API int VLC_PlaylistIndex( int );
620 * Total amount of items in the playlist
622 * \param i_object a vlc object id
623 * \return amount of playlist items
625 VLC_DEPRECATED_API int VLC_PlaylistNumberOfItems( int );
630 * Skip to the next playlistitem and play it.
632 * \param i_object a vlc object id
633 * \return VLC_SUCCESS on success
635 VLC_DEPRECATED_API int VLC_PlaylistNext( int );
638 * Previous playlist item
640 * Skip to the previous playlistitem and play it.
642 * \param i_object a vlc object id
643 * \return VLC_SUCCESS on success
645 VLC_DEPRECATED_API int VLC_PlaylistPrev( int );
648 * Clear the contents of the playlist
650 * Completly empty the entire playlist.
652 * \note Was previously called VLC_ClearPlaylist
654 * \param i_object a vlc object id
655 * \return VLC_SUCCESS on success
657 VLC_DEPRECATED_API int VLC_PlaylistClear( int );
662 * \param i_object a vlc object id
663 * \param i_volume something in a range from 0-200
664 * \return the new volume (range 0-200 %)
666 VLC_DEPRECATED_API int VLC_VolumeSet( int, int );
669 * Get the current volume
671 * Retrieve the current volume.
673 * \param i_object a vlc object id
674 * \return the current volume (range 0-200 %)
676 VLC_DEPRECATED_API int VLC_VolumeGet( int );
679 * Mute/Unmute the volume
681 * \param i_object a vlc object id
682 * \return VLC_SUCCESS on success
684 VLC_DEPRECATED_API int VLC_VolumeMute( int );
687 * Toggle Fullscreen mode
689 * Switch between normal and fullscreen video
691 * \param i_object a vlc object id
692 * \return VLC_SUCCESS on success
694 VLC_DEPRECATED_API int VLC_FullScreen( int );
702 #endif /* _LIBVLC_DEPRECATED_H */