1 /*****************************************************************************
2 * vlc.h: global header for vlc
3 *****************************************************************************
4 * Copyright (C) 1998, 1999, 2000 VideoLAN
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 *****************************************************************************/
23 * \defgroup libvlc Libvlc
37 /*****************************************************************************
39 *****************************************************************************/
40 typedef int vlc_bool_t;
41 typedef struct vlc_list_t vlc_list_t;
42 typedef struct vlc_object_t vlc_object_t;
54 vlc_object_t * p_object;
57 #if defined( WIN32 ) && !defined( __MINGW32__ )
58 signed __int64 i_time;
60 signed long long i_time;
63 struct { char *psz_name; int i_object_id; } var;
65 /* Make sure the structure is at least 64bits */
66 struct { char a, b, c, d, e, f, g, h; } padding;
76 vlc_value_t * p_values;
81 /*****************************************************************************
83 *****************************************************************************/
84 #define VLC_SUCCESS -0 /* No error */
85 #define VLC_ENOMEM -1 /* Not enough memory */
86 #define VLC_ETHREAD -2 /* Thread error */
87 #define VLC_ETIMEOUT -3 /* Timeout */
89 #define VLC_ENOMOD -10 /* Module not found */
91 #define VLC_ENOOBJ -20 /* Object not found */
92 #define VLC_EBADOBJ -21 /* Bad object type */
94 #define VLC_ENOVAR -30 /* Variable not found */
95 #define VLC_EBADVAR -31 /* Bad variable value */
97 #define VLC_EEXIT -255 /* Program exited */
98 #define VLC_EGENERIC -666 /* Generic error */
100 /*****************************************************************************
102 *****************************************************************************/
106 /*****************************************************************************
108 *****************************************************************************/
110 /* Used by playlist_Add */
111 #define PLAYLIST_INSERT 0x0001
112 #define PLAYLIST_REPLACE 0x0002
113 #define PLAYLIST_APPEND 0x0004
114 #define PLAYLIST_GO 0x0008
115 #define PLAYLIST_CHECK_INSERT 0x0010
117 #define PLAYLIST_END -666
123 PLAYLIST_PLAY, /**< Starts playing. No arg. */
124 PLAYLIST_PAUSE, /**< Toggles playlist pause. No arg. */
125 PLAYLIST_STOP, /**< Stops playing. No arg. */
126 PLAYLIST_SKIP, /**< Skip X items and play. */
127 PLAYLIST_GOTO, /**< Goto Xth item. */
128 PLAYLIST_MODE /**< Set playlist mode. ??? */
129 } playlist_command_t;
131 /*****************************************************************************
132 * Required internal headers
133 *****************************************************************************/
134 #if defined( __VLC__ )
135 # include "vlc_common.h"
138 /*****************************************************************************
139 * Exported libvlc API
140 *****************************************************************************/
143 * Retrieve libvlc version
145 * \return a string containing the libvlc version
147 char const * VLC_Version ( void );
150 * Return an error string
152 * \param i_err an error code
153 * \return an error string
155 char const * VLC_Error ( int i_err );
160 * This function allocates a vlc_t structure and returns a negative value
161 * in case of failure. Also, the thread system is initialized
163 * \return vlc object id or an error code
165 int VLC_Create ( void );
168 * Initialize a vlc_t structure
170 * This function initializes a previously allocated vlc_t structure:
172 * - gettext initialization
173 * - message queue, module bank and playlist initialization
174 * - configuration and commandline parsing
176 * \param i_object a vlc object id
177 * \param i_argc the number of arguments
178 * \param ppsz_argv an array of arguments
179 * \return VLC_SUCCESS on success
181 int VLC_Init ( int, int, char *[] );
186 * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other
187 * task. It is your duty to call VLC_End and VLC_Destroy afterwards.
189 * \param i_object a vlc object id
190 * \return VLC_SUCCESS on success
195 * Stop playing and destroy everything.
197 * This function requests the running threads to finish, waits for their
198 * termination, and destroys their structure.
199 * \param i_object a vlc object id
200 * \return VLC_SUCCESS on success
202 int VLC_Destroy ( int );
207 * This function sets a variable of VLC
209 * \param i_object a vlc object id
210 * \param psz_var a vlc variable name
211 * \param value a vlc_value_t structure
212 * \return VLC_SUCCESS on success
214 int VLC_Set ( int, char const *, vlc_value_t );
219 * This function gets the value of a variable of VLC
220 * It stores it in the p_value argument
222 * \param i_object a vlc object id
223 * \param psz_var a vlc variable name
224 * \param p_value a pointer to a vlc_value_t structure
225 * \return VLC_SUCCESS on success
227 int VLC_Get ( int, char const *, vlc_value_t * );
229 int VLC_AddIntf ( int, char const *, vlc_bool_t );
230 int VLC_AddTarget ( int, char const *, const char **, int, int, int );
232 int VLC_Play ( int );
233 int VLC_Pause ( int );
234 int VLC_Stop ( int );
235 int VLC_FullScreen ( int );
236 int VLC_ClearPlaylist( int );
237 vlc_bool_t VLC_IsPlaying ( int );
243 #endif /* <vlc/vlc.h> */