X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc%2Fvlc.h;h=95212e4ab331543eaee84c62ee99930f96eee075;hb=a326574d0db885d845dcdc39d2e844a7d1f38663;hp=e7667d3f29239c1323c20d3864b881072bd1be77;hpb=68aa3ca3202b0f2c7e3b10db9dbe46b436b17bbd;p=vlc diff --git a/include/vlc/vlc.h b/include/vlc/vlc.h index e7667d3f29..95212e4ab3 100644 --- a/include/vlc/vlc.h +++ b/include/vlc/vlc.h @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /** @@ -38,12 +38,14 @@ # ifdef __cplusplus extern "C" { +# else +# include # endif /***************************************************************************** * Our custom types *****************************************************************************/ -typedef int vlc_bool_t; +typedef bool vlc_bool_t; typedef struct vlc_list_t vlc_list_t; typedef struct vlc_object_t vlc_object_t; @@ -122,6 +124,8 @@ struct vlc_list_t #define VLC_ENOVAR -30 /* Variable not found */ #define VLC_EBADVAR -31 /* Bad variable value */ +#define VLC_ENOITEM -40 /**< Item not found */ + #define VLC_EEXIT -255 /* Program exited */ #define VLC_EEXITSUCCESS -999 /* Program exited successfully */ #define VLC_EGENERIC -666 /* Generic error */ @@ -129,8 +133,8 @@ struct vlc_list_t /***************************************************************************** * Booleans *****************************************************************************/ -#define VLC_FALSE 0 -#define VLC_TRUE 1 +#define VLC_FALSE false +#define VLC_TRUE true /***************************************************************************** * Playlist @@ -138,73 +142,98 @@ struct vlc_list_t /* Used by VLC_AddTarget() */ #define PLAYLIST_INSERT 0x0001 -#define PLAYLIST_REPLACE 0x0002 -#define PLAYLIST_APPEND 0x0004 -#define PLAYLIST_GO 0x0008 -#define PLAYLIST_CHECK_INSERT 0x0010 +#define PLAYLIST_APPEND 0x0002 +#define PLAYLIST_GO 0x0004 +#define PLAYLIST_PREPARSE 0x0008 +#define PLAYLIST_SPREPARSE 0x0010 +#define PLAYLIST_NO_REBUILD 0x0020 #define PLAYLIST_END -666 /***************************************************************************** * Required internal headers *****************************************************************************/ -#if defined( __VLC__ ) +#if defined( __LIBVLC__ ) # include "vlc_common.h" #endif +/***************************************************************************** + * Shared library Export macros + *****************************************************************************/ +#ifndef VLC_PUBLIC_API +# define VLC_PUBLIC_API extern +#endif + +/***************************************************************************** + * Compiler specific + *****************************************************************************/ + +#ifndef VLC_DEPRECATED_API +# ifdef __LIBVLC__ +/* Avoid unuseful warnings from libvlc with our deprecated APIs */ +# define VLC_DEPRECATED_API VLC_PUBLIC_API +# else /* __LIBVLC__ */ +# if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +# define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated)) +# else +# define VLC_DEPRECATED_API VLC_PUBLIC_API +# endif +# endif /* __LIBVLC__ */ +#endif + /***************************************************************************** * Exported libvlc API *****************************************************************************/ -#if !defined( __VLC__ ) +#if !defined( __LIBVLC__ ) /* Otherwise they are declared and exported in vlc_common.h */ /** * Retrieve libvlc version * * \return a string containing the libvlc version */ -char const * VLC_Version ( void ); +VLC_DEPRECATED_API char const * VLC_Version ( void ); /** * Retrieve libvlc compile time * * \return a string containing the libvlc compile time */ -char const * VLC_CompileTime ( void ); +VLC_DEPRECATED_API char const * VLC_CompileTime ( void ); /** * Retrieve the username of the libvlc builder * * \return a string containing the username of the libvlc builder */ -char const * VLC_CompileBy ( void ); +VLC_DEPRECATED_API char const * VLC_CompileBy ( void ); /** * Retrieve the host of the libvlc builder * * \return a string containing the host of the libvlc builder */ -char const * VLC_CompileHost ( void ); +VLC_DEPRECATED_API char const * VLC_CompileHost ( void ); /** * Retrieve the domain name of the host of the libvlc builder * * \return a string containing the domain name of the host of the libvlc builder */ -char const * VLC_CompileDomain ( void ); +VLC_DEPRECATED_API char const * VLC_CompileDomain ( void ); /** * Retrieve libvlc compiler version * * \return a string containing the libvlc compiler version */ -char const * VLC_Compiler ( void ); +VLC_DEPRECATED_API char const * VLC_Compiler ( void ); /** * Retrieve libvlc changeset * * \return a string containing the libvlc subversion changeset */ -char const * VLC_Changeset ( void ); +VLC_DEPRECATED_API char const * VLC_Changeset ( void ); /** * Return an error string @@ -212,9 +241,9 @@ char const * VLC_Changeset ( void ); * \param i_err an error code * \return an error string */ -char const * VLC_Error ( int i_err ); +VLC_DEPRECATED_API char const * VLC_Error ( int i_err ); -#endif /* __VLC__ */ +#endif /* __LIBVLC__ */ /** * Initialize libvlc @@ -224,7 +253,7 @@ char const * VLC_Error ( int i_err ); * * \return vlc object id or an error code */ -int VLC_Create( void ); +VLC_PUBLIC_API int VLC_Create( void ); /** * Initialize a vlc_t structure @@ -240,7 +269,7 @@ int VLC_Create( void ); * \param ppsz_argv an array of arguments * \return VLC_SUCCESS on success */ -int VLC_Init( int, int, char *[] ); +VLC_PUBLIC_API int VLC_Init( int, int, const char *[] ); /** * Add an interface @@ -256,18 +285,18 @@ int VLC_Init( int, int, char *[] ); * \param b_play start playing when the interface is done loading * \return VLC_SUCCESS on success */ -int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t ); +VLC_PUBLIC_API int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t ); /** * Ask vlc to die * - * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other + * This function sets p_libvlc->b_die to VLC_TRUE, but does not do any other * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards. * * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_Die( int ); +VLC_PUBLIC_API int VLC_Die( int ); /** * Clean up all the intf, playlist, vout and aout @@ -280,7 +309,7 @@ int VLC_Die( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_CleanUp( int ); +VLC_PUBLIC_API int VLC_CleanUp( int ); /** * Destroy all threads and the VLC object @@ -292,7 +321,7 @@ int VLC_CleanUp( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_Destroy( int ); +VLC_PUBLIC_API int VLC_Destroy( int ); /** * Set a VLC variable @@ -306,7 +335,7 @@ int VLC_Destroy( int ); * \param value a vlc_value_t structure * \return VLC_SUCCESS on success */ -int VLC_VariableSet( int, char const *, vlc_value_t ); +VLC_DEPRECATED_API int VLC_VariableSet( int, char const *, vlc_value_t ); /** * Get a VLC variable @@ -321,7 +350,7 @@ int VLC_VariableSet( int, char const *, vlc_value_t ); * \param p_value a pointer to a vlc_value_t structure * \return VLC_SUCCESS on success */ -int VLC_VariableGet( int, char const *, vlc_value_t * ); +VLC_DEPRECATED_API int VLC_VariableGet( int, char const *, vlc_value_t * ); /** * Get a VLC variable type @@ -334,7 +363,7 @@ int VLC_VariableGet( int, char const *, vlc_value_t * ); * \param pi_type a pointer to an integer * \return VLC_SUCCESS on success */ -int VLC_VariableType( int, char const *, int * ); +VLC_DEPRECATED_API int VLC_VariableType( int, char const *, int * ); /** * Add a target to the current playlist @@ -348,9 +377,9 @@ int VLC_VariableType( int, char const *, int * ); * \param i_options the amount of options in the ppsz_options array * \param i_mode the insert mode to insert the target into the playlist (PLAYLIST_* defines) * \param i_pos the position at which to add the new target (PLAYLIST_END for end) - * \return VLC_SUCCESS on success + * \return the item id on success and -1 on error */ -int VLC_AddTarget( int, char const *, const char **, int, int, int ); +VLC_PUBLIC_API int VLC_AddTarget( int, char const *, const char **, int, int, int ); /** * Start the playlist and play the currently selected playlist item @@ -362,7 +391,7 @@ int VLC_AddTarget( int, char const *, const char **, int, int, int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_Play( int ); +VLC_DEPRECATED_API int VLC_Play( int ); /** * Pause the currently playing item. Resume it if already paused @@ -373,7 +402,7 @@ int VLC_Play( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_Pause( int ); +VLC_DEPRECATED_API int VLC_Pause( int ); /** * Stop the playlist @@ -386,7 +415,7 @@ int VLC_Pause( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_Stop( int ); +VLC_DEPRECATED_API int VLC_Stop( int ); /** * Tell if VLC is playing @@ -397,7 +426,7 @@ int VLC_Stop( int ); * \param i_object a vlc object id * \return VLC_TRUE or VLC_FALSE */ -vlc_bool_t VLC_IsPlaying( int ); +VLC_DEPRECATED_API vlc_bool_t VLC_IsPlaying( int ); /** * Get the current position in a input @@ -409,7 +438,7 @@ vlc_bool_t VLC_IsPlaying( int ); * \param i_object a vlc object id * \return a float in the range of 0.0 - 1.0 */ -float VLC_PositionGet( int ); +VLC_DEPRECATED_API float VLC_PositionGet( int ); /** * Set the current position in a input @@ -422,7 +451,7 @@ float VLC_PositionGet( int ); * \param i_position a float in the range of 0.0 - 1.0 * \return a float in the range of 0.0 - 1.0 */ -float VLC_PositionSet( int, float ); +VLC_DEPRECATED_API float VLC_PositionSet( int, float ); /** * Get the current position in a input @@ -433,7 +462,7 @@ float VLC_PositionSet( int, float ); * \param i_object a vlc object id * \return the offset from 0:00 in seconds */ -int VLC_TimeGet( int ); +VLC_DEPRECATED_API int VLC_TimeGet( int ); /** * Seek to a position in the current input @@ -448,7 +477,7 @@ int VLC_TimeGet( int ); * \param b_relative seek relative from current position * \return VLC_SUCCESS on success */ -int VLC_TimeSet( int, int, vlc_bool_t ); +VLC_DEPRECATED_API int VLC_TimeSet( int, int, vlc_bool_t ); /** * Get the total length of a input @@ -459,7 +488,7 @@ int VLC_TimeSet( int, int, vlc_bool_t ); * \param i_object a vlc object id * \return the length in seconds */ -int VLC_LengthGet( int ); +VLC_DEPRECATED_API int VLC_LengthGet( int ); /** * Play the input faster than realtime @@ -470,7 +499,7 @@ int VLC_LengthGet( int ); * \param i_object a vlc object id * \return the current speedrate */ -float VLC_SpeedFaster( int ); +VLC_DEPRECATED_API float VLC_SpeedFaster( int ); /** * Play the input slower than realtime @@ -481,7 +510,7 @@ float VLC_SpeedFaster( int ); * \param i_object a vlc object id * \return the current speedrate */ -float VLC_SpeedSlower( int ); +VLC_DEPRECATED_API float VLC_SpeedSlower( int ); /** * Return the current playlist item @@ -489,7 +518,7 @@ float VLC_SpeedSlower( int ); * \param i_object a vlc object id * \return the index of the playlistitem that is currently selected for play */ -int VLC_PlaylistIndex( int ); +VLC_DEPRECATED_API int VLC_PlaylistIndex( int ); /** * Total amount of items in the playlist @@ -497,7 +526,7 @@ int VLC_PlaylistIndex( int ); * \param i_object a vlc object id * \return amount of playlist items */ -int VLC_PlaylistNumberOfItems( int ); +VLC_DEPRECATED_API int VLC_PlaylistNumberOfItems( int ); /** * Next playlist item @@ -507,7 +536,7 @@ int VLC_PlaylistNumberOfItems( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_PlaylistNext( int ); +VLC_DEPRECATED_API int VLC_PlaylistNext( int ); /** * Previous playlist item @@ -517,7 +546,7 @@ int VLC_PlaylistNext( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_PlaylistPrev( int ); +VLC_DEPRECATED_API int VLC_PlaylistPrev( int ); /** * Clear the contents of the playlist @@ -529,7 +558,7 @@ int VLC_PlaylistPrev( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_PlaylistClear( int ); +VLC_DEPRECATED_API int VLC_PlaylistClear( int ); /** * Change the volume @@ -538,7 +567,7 @@ int VLC_PlaylistClear( int ); * \param i_volume something in a range from 0-200 * \return the new volume (range 0-200 %) */ -int VLC_VolumeSet( int, int ); +VLC_DEPRECATED_API int VLC_VolumeSet( int, int ); /** * Get the current volume @@ -548,7 +577,7 @@ int VLC_VolumeSet( int, int ); * \param i_object a vlc object id * \return the current volume (range 0-200 %) */ -int VLC_VolumeGet( int ); +VLC_DEPRECATED_API int VLC_VolumeGet( int ); /** * Mute/Unmute the volume @@ -556,7 +585,7 @@ int VLC_VolumeGet( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_VolumeMute( int ); +VLC_DEPRECATED_API int VLC_VolumeMute( int ); /** * Toggle Fullscreen mode @@ -566,7 +595,7 @@ int VLC_VolumeMute( int ); * \param i_object a vlc object id * \return VLC_SUCCESS on success */ -int VLC_FullScreen( int ); +VLC_DEPRECATED_API int VLC_FullScreen( int ); # ifdef __cplusplus