]> git.sesse.net Git - vlc/blob - include/vlc/deprecated.h
Merge branch 'master' of git@git.videolan.org:vlc
[vlc] / include / vlc / deprecated.h
1 /*****************************************************************************
2  * deprecated.h:  libvlc deprecated API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id$
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 #ifndef _LIBVLC_DEPRECATED_H
26 #define _LIBVLC_DEPRECATED_H 1
27
28 # ifdef __cplusplus
29 extern "C" {
30 # endif
31
32
33 /*****************************************************************************
34  * Playlist (Deprecated)
35  *****************************************************************************/
36 /** \defgroup libvlc_playlist libvlc_playlist (Deprecated)
37  * \ingroup libvlc
38  * LibVLC Playlist handling (Deprecated)
39  * @deprecated Use media_list
40  * @{
41  */
42
43 /**
44  * Set the playlist's loop attribute. If set, the playlist runs continuously
45  * and wraps around when it reaches the end.
46  *
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
50  */
51 VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
52                                           libvlc_exception_t * );
53
54 /**
55  * Start playing.
56  *
57  * Additionnal playlist item options can be specified for addition to the
58  * item before it is played.
59  *
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
63  *        played
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
67  */
68 VLC_DEPRECATED_API void libvlc_playlist_play( libvlc_instance_t*, int, int,
69                                           char **, libvlc_exception_t * );
70
71 /**
72  * Toggle the playlist's pause status.
73  *
74  * If the playlist was running, it is paused. If it was paused, it is resumed.
75  *
76  * \param p_instance the playlist instance to pause
77  * \param p_e an initialized exception pointer
78  */
79 VLC_DEPRECATED_API void libvlc_playlist_pause( libvlc_instance_t *,
80                                            libvlc_exception_t * );
81
82 /**
83  * Checks whether the playlist is running
84  *
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
88  */
89 VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
90                                               libvlc_exception_t * );
91
92 /**
93  * Get the number of items in the playlist
94  *
95  * \param p_instance the playlist instance
96  * \param p_e an initialized exception pointer
97  * \return the number of items
98  */
99 VLC_DEPRECATED_API int libvlc_playlist_items_count( libvlc_instance_t *,
100                                                 libvlc_exception_t * );
101
102 /**
103  * Lock the playlist.
104  *
105  * \param p_instance the playlist instance
106  */
107 VLC_DEPRECATED_API void libvlc_playlist_lock( libvlc_instance_t * );
108
109 /**
110  * Unlock the playlist.
111  *
112  * \param p_instance the playlist instance
113  */
114 VLC_DEPRECATED_API void libvlc_playlist_unlock( libvlc_instance_t * );
115
116 /**
117  * Stop playing.
118  *
119  * \param p_instance the playlist instance to stop
120  * \param p_e an initialized exception pointer
121  */
122 VLC_DEPRECATED_API void libvlc_playlist_stop( libvlc_instance_t *,
123                                           libvlc_exception_t * );
124
125 /**
126  * Go to the next playlist item. If the playlist was stopped, playback
127  * is started.
128  *
129  * \param p_instance the playlist instance
130  * \param p_e an initialized exception pointer
131  */
132 VLC_DEPRECATED_API void libvlc_playlist_next( libvlc_instance_t *,
133                                           libvlc_exception_t * );
134
135 /**
136  * Go to the previous playlist item. If the playlist was stopped, playback
137  * is started.
138  *
139  * \param p_instance the playlist instance
140  * \param p_e an initialized exception pointer
141  */
142 VLC_DEPRECATED_API void libvlc_playlist_prev( libvlc_instance_t *,
143                                           libvlc_exception_t * );
144
145 /**
146  * Empty a playlist. All items in the playlist are removed.
147  *
148  * \param p_instance the playlist instance
149  * \param p_e an initialized exception pointer
150  */
151 VLC_DEPRECATED_API void libvlc_playlist_clear( libvlc_instance_t *,
152                                            libvlc_exception_t * );
153
154 /**
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.
157  *
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
163  */
164 VLC_DEPRECATED_API int libvlc_playlist_add( libvlc_instance_t *, const char *,
165                                         const char *, libvlc_exception_t * );
166
167 /**
168  * Append an item to the playlist. The item is added at the end, with
169  * additional input options.
170  *
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
178  */
179 VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
180                                                  const char *, int, const char **,
181                                                  libvlc_exception_t * );
182
183 /**
184  * Delete the playlist item with the given ID.
185  *
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
190  */
191 VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
192                                                 libvlc_exception_t * );
193
194 /** Get the input that is currently being played by the playlist.
195  *
196  * \param p_instance the playlist instance to use
197  * \param p_e an initialized exception pointern
198  * \return a media instance object
199  */
200 VLC_DEPRECATED_API libvlc_media_player_t * libvlc_playlist_get_media_player(
201                                 libvlc_instance_t *, libvlc_exception_t * );
202
203 /** @}*/
204
205 /**
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
209  *
210  * @deprecated
211  * @{
212  */
213
214
215 /*****************************************************************************
216  * Exported vlc API (Deprecated)
217  *****************************************************************************/
218
219 /*****************************************************************************
220  * Playlist
221  *****************************************************************************/
222
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
230
231 #define PLAYLIST_END           -666
232
233 /*****************************************************************************
234  * Error values
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 */
240
241 #define VLC_ENOMOD         -10                           /* Module not found */
242
243 #define VLC_ENOOBJ         -20                           /* Object not found */
244 #define VLC_EBADOBJ        -21                            /* Bad object type */
245
246 #define VLC_ENOVAR         -30                         /* Variable not found */
247 #define VLC_EBADVAR        -31                         /* Bad variable value */
248
249 #define VLC_ENOITEM        -40                           /**< Item not found */
250
251 #define VLC_EEXIT         -255                             /* Program exited */
252 #define VLC_EEXITSUCCESS  -999                /* Program exited successfully */
253 #define VLC_EGENERIC      -666                              /* Generic error */
254
255
256
257 #if !defined( __LIBVLC__ )
258 /* Otherwise they are declared and exported in vlc_common.h */
259 /**
260  * Retrieve libvlc version
261  *
262  * \return a string containing the libvlc version
263  */
264 VLC_DEPRECATED_API char const * VLC_Version ( void );
265
266 /**
267  * Retrieve libvlc compile time
268  *
269  * \return a string containing the libvlc compile time
270  */
271 VLC_DEPRECATED_API char const * VLC_CompileTime ( void );
272
273 /**
274  * Retrieve the username of the libvlc builder
275  *
276  * \return a string containing the username of the libvlc builder
277  */
278 VLC_DEPRECATED_API char const * VLC_CompileBy ( void );
279
280 /**
281  * Retrieve the host of the libvlc builder
282  *
283  * \return a string containing the host of the libvlc builder
284  */
285 VLC_DEPRECATED_API char const * VLC_CompileHost ( void );
286
287 /**
288  * Retrieve the domain name of the host of the libvlc builder
289  *
290  * \return a string containing the domain name of the host of the libvlc builder
291  */
292 VLC_DEPRECATED_API char const * VLC_CompileDomain ( void );
293
294 /**
295  * Retrieve libvlc compiler version
296  *
297  * \return a string containing the libvlc compiler version
298  */
299 VLC_DEPRECATED_API char const * VLC_Compiler ( void );
300
301 /**
302  * Retrieve libvlc changeset
303  *
304  * \return a string containing the libvlc subversion changeset
305  */
306 VLC_DEPRECATED_API char const * VLC_Changeset ( void );
307
308 /**
309  * Return an error string
310  *
311  * \param i_err an error code
312  * \return an error string
313  */
314 VLC_DEPRECATED_API char const * VLC_Error ( int i_err );
315
316 #endif /* __LIBVLC__ */
317
318 /**
319  * Initialize libvlc
320  *
321  * This function allocates a vlc_t structure and returns a negative value
322  * in case of failure. Also, the thread system is initialized
323  *
324  * \return vlc object id or an error code
325  */
326 VLC_DEPRECATED_API int     VLC_Create( void );
327
328 /**
329  * Initialize a vlc_t structure
330  *
331  * This function initializes a previously allocated vlc_t structure:
332  *  - CPU detection
333  *  - gettext initialization
334  *  - message queue, module bank and playlist initialization
335  *  - configuration and commandline parsing
336  *
337  *  \param i_object a vlc object id
338  *  \param i_argc the number of arguments
339  *  \param ppsz_argv an array of arguments
340  *  \return VLC_SUCCESS on success
341  */
342 VLC_DEPRECATED_API int     VLC_Init( int, int, const char *[] );
343
344 /**
345  * Add an interface
346  *
347  * This function opens an interface plugin and runs it. If b_block is set
348  * to 0, VLC_AddIntf will return immediately and let the interface run in a
349  * separate thread. If b_block is set to 1, VLC_AddIntf will continue until
350  * user requests to quit.
351  *
352  * \param i_object a vlc object id
353  * \param psz_module a vlc module name of an interface
354  * \param b_block make this interface blocking
355  * \param b_play start playing when the interface is done loading
356  * \return VLC_SUCCESS on success
357  */
358 VLC_DEPRECATED_API int     VLC_AddIntf( int, char const *, bool, bool );
359
360 /**
361  * Ask vlc to die
362  *
363  * This function sets p_libvlc->b_die to true, but does not do any other
364  * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
365  *
366  * \param i_object a vlc object id
367  * \return VLC_SUCCESS on success
368  */
369 VLC_DEPRECATED_API int     VLC_Die( int );
370
371 /**
372  * Clean up all the intf, playlist, vout and aout
373  *
374  * This function requests all intf, playlist, vout and aout objects to finish
375  * and CleanUp. Only a blank VLC object should remain after this.
376  *
377  * \note This function was previously called VLC_Stop
378  *
379  * \param i_object a vlc object id
380  * \return VLC_SUCCESS on success
381  */
382 VLC_DEPRECATED_API int     VLC_CleanUp( int );
383
384 /**
385  * Destroy all threads and the VLC object
386  *
387  * This function requests the running threads to finish, waits for their
388  * termination, and destroys their structure.
389  * Then it will de-init all VLC object initializations.
390  *
391  * \param i_object a vlc object id
392  * \return VLC_SUCCESS on success
393  */
394 VLC_DEPRECATED_API int     VLC_Destroy( int );
395
396 /**
397  * Set a VLC variable
398  *
399  * This function sets a variable of VLC
400  *
401  * \note Was previously called VLC_Set
402  *
403  * \param i_object a vlc object id
404  * \param psz_var a vlc variable name
405  * \param value a vlc_value_t structure
406  * \return VLC_SUCCESS on success
407  */
408 VLC_DEPRECATED_API int     VLC_VariableSet( int, char const *, vlc_value_t );
409
410 /**
411  * Get a VLC variable
412  *
413  * This function gets the value of a variable of VLC
414  * It stores it in the p_value argument
415  *
416  * \note Was previously called VLC_Get
417  *
418  * \param i_object a vlc object id
419  * \param psz_var a vlc variable name
420  * \param p_value a pointer to a vlc_value_t structure
421  * \return VLC_SUCCESS on success
422  */
423 VLC_DEPRECATED_API int     VLC_VariableGet( int, char const *, vlc_value_t * );
424
425 /**
426  * Get a VLC variable type
427  *
428  * This function gets the type of a variable of VLC
429  * It stores it in the p_type argument
430  *
431  * \param i_object a vlc object id
432  * \param psz_var a vlc variable name
433  * \param pi_type a pointer to an integer
434  * \return VLC_SUCCESS on success
435  */
436 VLC_DEPRECATED_API int     VLC_VariableType( int, char const *, int * );
437
438 /**
439  * Add a target to the current playlist
440  *
441  * This funtion will add a target to the current playlist. If a playlist does
442  * not exist, it will be created.
443  *
444  * \param i_object a vlc object id
445  * \param psz_target the URI of the target to play
446  * \param ppsz_options an array of strings with input options (ie. :input-repeat)
447  * \param i_options the amount of options in the ppsz_options array
448  * \param i_mode the insert mode to insert the target into the playlist (PLAYLIST_* defines)
449  * \param i_pos the position at which to add the new target (PLAYLIST_END for end)
450  * \return the item id on success and -1 on error
451  */
452 VLC_DEPRECATED_API int     VLC_AddTarget( int, char const *, const char **, int, int, int );
453
454 /**
455  * Start the playlist and play the currently selected playlist item
456  *
457  * If there is something in the playlist, and the playlist is not running,
458  * then start the playlist and play the currently selected playlist item.
459  * If an item is currently paused, then resume it.
460  *
461  * \param i_object a vlc object id
462  * \return VLC_SUCCESS on success
463  */
464 VLC_DEPRECATED_API int     VLC_Play( int );
465
466 /**
467  * Pause the currently playing item. Resume it if already paused
468  *
469  * If an item is currently playing then pause it.
470  * If the item is already paused, then resume playback.
471  *
472  * \param i_object a vlc object id
473  * \return VLC_SUCCESS on success
474  */
475 VLC_DEPRECATED_API int     VLC_Pause( int );
476
477 /**
478  * Stop the playlist
479  *
480  * If an item is currently playing then stop it.
481  * Set the playlist to a stopped state.
482  *
483  * \note This function is new. The old VLC_Stop is now called VLC_CleanUp
484  *
485  * \param i_object a vlc object id
486  * \return VLC_SUCCESS on success
487  */
488 VLC_DEPRECATED_API int             VLC_Stop( int );
489
490 /**
491  * Tell if VLC is playing
492  *
493  * If an item is currently playing, it returns
494  * true, else false
495  *
496  * \param i_object a vlc object id
497  * \return true or false
498  */
499 VLC_DEPRECATED_API bool      VLC_IsPlaying( int );
500
501 /**
502  * Get the current position in a input
503  *
504  * Return the current position as a float
505  * This method should be used for time sliders etc
506  * \note For some inputs, this will be unknown.
507  *
508  * \param i_object a vlc object id
509  * \return a float in the range of 0.0 - 1.0
510  */
511 VLC_DEPRECATED_API float           VLC_PositionGet( int );
512
513 /**
514  * Set the current position in a input
515  *
516  * Set the current position as a float
517  * This method should be used for time sliders etc
518  * \note For some inputs, this will be unknown.
519  *
520  * \param i_object a vlc object id
521  * \param i_position a float in the range of 0.0 - 1.0
522  * \return a float in the range of 0.0 - 1.0
523  */
524 VLC_DEPRECATED_API float           VLC_PositionSet( int, float );
525
526 /**
527  * Get the current position in a input
528  *
529  * Return the current position in seconds from the start.
530  * \note For some inputs, this will be unknown.
531  *
532  * \param i_object a vlc object id
533  * \return the offset from 0:00 in seconds
534  */
535 VLC_DEPRECATED_API int             VLC_TimeGet( int );
536
537 /**
538  * Seek to a position in the current input
539  *
540  * Seek i_seconds in the current input. If b_relative is set,
541  * then the seek will be relative to the current position, otherwise
542  * it will seek to i_seconds from the beginning of the input.
543  * \note For some inputs, this will be unknown.
544  *
545  * \param i_object a vlc object id
546  * \param i_seconds seconds from current position or from beginning of input
547  * \param b_relative seek relative from current position
548  * \return VLC_SUCCESS on success
549  */
550 VLC_DEPRECATED_API int             VLC_TimeSet( int, int, bool );
551
552 /**
553  * Get the total length of a input
554  *
555  * Return the total length in seconds from the current input.
556  * \note For some inputs, this will be unknown.
557  *
558  * \param i_object a vlc object id
559  * \return the length in seconds
560  */
561 VLC_DEPRECATED_API int             VLC_LengthGet( int );
562
563 /**
564  * Play the input faster than realtime
565  *
566  * 2x, 4x, 8x faster than realtime
567  * \note For some inputs, this will be impossible.
568  *
569  * \param i_object a vlc object id
570  * \return the current speedrate
571  */
572 VLC_DEPRECATED_API float           VLC_SpeedFaster( int );
573
574 /**
575  * Play the input slower than realtime
576  *
577  * 1/2x, 1/4x, 1/8x slower than realtime
578  * \note For some inputs, this will be impossible.
579  *
580  * \param i_object a vlc object id
581  * \return the current speedrate
582  */
583 VLC_DEPRECATED_API float           VLC_SpeedSlower( int );
584
585 /**
586  * Return the current playlist item
587  *
588  * \param i_object a vlc object id
589  * \return the index of the playlistitem that is currently selected for play
590  */
591 VLC_DEPRECATED_API int             VLC_PlaylistIndex( int );
592
593 /**
594  * Total amount of items in the playlist
595  *
596  * \param i_object a vlc object id
597  * \return amount of playlist items
598  */
599 VLC_DEPRECATED_API int             VLC_PlaylistNumberOfItems( int );
600
601 /**
602  * Next playlist item
603  *
604  * Skip to the next playlistitem and play it.
605  *
606  * \param i_object a vlc object id
607  * \return VLC_SUCCESS on success
608  */
609 VLC_DEPRECATED_API int             VLC_PlaylistNext( int );
610
611 /**
612  * Previous playlist item
613  *
614  * Skip to the previous playlistitem and play it.
615  *
616  * \param i_object a vlc object id
617  * \return VLC_SUCCESS on success
618  */
619 VLC_DEPRECATED_API int             VLC_PlaylistPrev( int );
620
621 /**
622  * Clear the contents of the playlist
623  *
624  * Completly empty the entire playlist.
625  *
626  * \note Was previously called VLC_ClearPlaylist
627  *
628  * \param i_object a vlc object id
629  * \return VLC_SUCCESS on success
630  */
631 VLC_DEPRECATED_API int             VLC_PlaylistClear( int );
632
633 /**
634  * Change the volume
635  *
636  * \param i_object a vlc object id
637  * \param i_volume something in a range from 0-200
638  * \return the new volume (range 0-200 %)
639  */
640 VLC_DEPRECATED_API int             VLC_VolumeSet( int, int );
641
642 /**
643  * Get the current volume
644  *
645  * Retrieve the current volume.
646  *
647  * \param i_object a vlc object id
648  * \return the current volume (range 0-200 %)
649  */
650 VLC_DEPRECATED_API int             VLC_VolumeGet( int );
651
652 /**
653  * Mute/Unmute the volume
654  *
655  * \param i_object a vlc object id
656  * \return VLC_SUCCESS on success
657  */
658 VLC_DEPRECATED_API int            VLC_VolumeMute( int );
659
660 /**
661  * Toggle Fullscreen mode
662  *
663  * Switch between normal and fullscreen video
664  *
665  * \param i_object a vlc object id
666  * \return VLC_SUCCESS on success
667  */
668 VLC_DEPRECATED_API int             VLC_FullScreen( int );
669
670 /**@} */
671
672 # ifdef __cplusplus
673 }
674 # endif
675
676 #endif /* _LIBVLC_DEPRECATED_H */