1 /*****************************************************************************
2 * vlc.h: global header for vlc
3 *****************************************************************************
4 * Copyright (C) 1998-2004 VideoLAN
7 * Authors: Vincent Seguin <seguin@via.ecp.fr>
8 * Samuel Hocevar <sam@zoy.org>
9 * Gildas Bazin <gbazin@netcourrier.com>
10 * Derk-Jan Hartman <hartman at videolan dot org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 *****************************************************************************/
28 * \defgroup libvlc Libvlc
29 * This is libvlc, the base library of the VLC program.
42 /*****************************************************************************
44 *****************************************************************************/
45 typedef int vlc_bool_t;
46 typedef struct vlc_list_t vlc_list_t;
47 typedef struct vlc_object_t vlc_object_t;
59 vlc_object_t * p_object;
62 #if defined( WIN32 ) && !defined( __MINGW32__ )
63 signed __int64 i_time;
65 signed long long i_time;
68 struct { char *psz_name; int i_object_id; } var;
70 /* Make sure the structure is at least 64bits */
71 struct { char a, b, c, d, e, f, g, h; } padding;
81 vlc_value_t * p_values;
86 /*****************************************************************************
88 *****************************************************************************/
89 #define VLC_SUCCESS -0 /* No error */
90 #define VLC_ENOMEM -1 /* Not enough memory */
91 #define VLC_ETHREAD -2 /* Thread error */
92 #define VLC_ETIMEOUT -3 /* Timeout */
94 #define VLC_ENOMOD -10 /* Module not found */
96 #define VLC_ENOOBJ -20 /* Object not found */
97 #define VLC_EBADOBJ -21 /* Bad object type */
99 #define VLC_ENOVAR -30 /* Variable not found */
100 #define VLC_EBADVAR -31 /* Bad variable value */
102 #define VLC_EEXIT -255 /* Program exited */
103 #define VLC_EGENERIC -666 /* Generic error */
105 /*****************************************************************************
107 *****************************************************************************/
111 /*****************************************************************************
113 *****************************************************************************/
115 /* Used by VLC_AddTarget() */
116 #define PLAYLIST_INSERT 0x0001
117 #define PLAYLIST_REPLACE 0x0002
118 #define PLAYLIST_APPEND 0x0004
119 #define PLAYLIST_GO 0x0008
120 #define PLAYLIST_CHECK_INSERT 0x0010
122 #define PLAYLIST_END -666
124 /*****************************************************************************
125 * Required internal headers
126 *****************************************************************************/
127 #if defined( __VLC__ )
128 # include "vlc_common.h"
131 /*****************************************************************************
132 * Exported libvlc API
133 *****************************************************************************/
136 * Retrieve libvlc version
138 * \return a string containing the libvlc version
140 char const * VLC_Version ( void );
143 * Return an error string
145 * \param i_err an error code
146 * \return an error string
148 char const * VLC_Error ( int i_err );
153 * This function allocates a vlc_t structure and returns a negative value
154 * in case of failure. Also, the thread system is initialized
156 * \return vlc object id or an error code
158 int VLC_Create ( void );
161 * Initialize a vlc_t structure
163 * This function initializes a previously allocated vlc_t structure:
165 * - gettext initialization
166 * - message queue, module bank and playlist initialization
167 * - configuration and commandline parsing
169 * \param i_object a vlc object id
170 * \param i_argc the number of arguments
171 * \param ppsz_argv an array of arguments
172 * \return VLC_SUCCESS on success
174 int VLC_Init ( int, int, char *[] );
179 * This function opens an interface plugin and runs it. If b_block is set
180 * to 0, VLC_AddIntf will return immediately and let the interface run in a
181 * separate thread. If b_block is set to 1, VLC_AddIntf will continue until
182 * user requests to quit.
184 * \param i_object a vlc object id
185 * \param psz_module a vlc module name of an interface
186 * \param b_block make this interface blocking
187 * \param b_play start playing when the interface is done loading
188 * \return VLC_SUCCESS on success
190 int VLC_AddIntf ( int, char const *, vlc_bool_t, vlc_bool_t );
195 * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other
196 * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
198 * \param i_object a vlc object id
199 * \return VLC_SUCCESS on success
204 * Clean up all the intf, playlist, vout and aout
206 * This function requests all intf, playlist, vout and aout objects to finish
207 * and CleanUp. Only a blank VLC object should remain after this.
209 * \param i_object a vlc object id
210 * \return VLC_SUCCESS on success
212 int VLC_CleanUp ( int );
215 * Destroy all threads and the VLC object
217 * This function requests the running threads to finish, waits for their
218 * termination, and destroys their structure.
219 * Then it will de-init all VLC object initializations.
221 * \param i_object a vlc object id
222 * \return VLC_SUCCESS on success
224 int VLC_Destroy ( int );
229 * This function sets a variable of VLC
231 * \param i_object a vlc object id
232 * \param psz_var a vlc variable name
233 * \param value a vlc_value_t structure
234 * \return VLC_SUCCESS on success
236 int VLC_Set ( int, char const *, vlc_value_t );
241 * This function gets the value of a variable of VLC
242 * It stores it in the p_value argument
244 * \param i_object a vlc object id
245 * \param psz_var a vlc variable name
246 * \param p_value a pointer to a vlc_value_t structure
247 * \return VLC_SUCCESS on success
249 int VLC_Get ( int, char const *, vlc_value_t * );
252 * Add a target to the current playlist
254 * This funtion will add a target to the current playlist. If a playlist does
255 * not exist, it will be created.
257 * \param i_object a vlc object id
258 * \param psz_target the URI of the target to play
259 * \param ppsz_options an array of strings with input options (ie. :input-repeat)
260 * \param i_options the amount of options in the ppsz_options array
261 * \param i_mode the insert mode to insert the target into the playlist (PLAYLIST_* defines)
262 * \param i_pos the position at which to add the new target (PLAYLIST_END for end)
263 * \return VLC_SUCCESS on success
265 int VLC_AddTarget ( int, char const *, const char **, int, int, int );
268 * Start the playlist and play the currently selected playlist item
270 * If there is something in the playlist, and the playlist is not running,
271 * then start the playlist and play the currently selected playlist item.
272 * If an item is currently paused, then resume it.
274 * \param i_object a vlc object id
275 * \return VLC_SUCCESS on success
277 int VLC_Play ( int );
280 * Pause the currently playing item. Resume it if already paused
282 * If an item is currently playing then pause it.
283 * If the item is already paused, then resume playback.
285 * \param i_object a vlc object id
286 * \return VLC_SUCCESS on success
288 int VLC_Pause ( int );
293 * If an item is currently playing then stop it.
294 * Set the playlist to a stopped state.
296 * \param i_object a vlc object id
297 * \return VLC_SUCCESS on success
299 int VLC_Stop ( int );
304 * If an item is currently playing then stop it.
305 * Set the playlist to a stopped state.
307 * \param i_object a vlc object id
308 * \return VLC_SUCCESS on success
310 vlc_bool_t VLC_IsPlaying ( int );
313 * Clear the contents of the playlist
315 * Completly empty the entire playlist.
317 * \param i_object a vlc object id
318 * \return VLC_SUCCESS on success
320 int VLC_ClearPlaylist( int );
323 * Toggle Fullscreen mode
325 * Switch between normal and fullscreen video
327 * \param i_object a vlc object id
328 * \return VLC_SUCCESS on success
330 int VLC_FullScreen ( int );
337 #endif /* <vlc/vlc.h> */