]> git.sesse.net Git - vlc/blob - include/vlc/vlc.h
ALL: MSVC compilation fixes to libvlc.
[vlc] / include / vlc / vlc.h
1 /*****************************************************************************
2  * vlc.h: global header for vlc
3  *****************************************************************************
4  * Copyright (C) 1998, 1999, 2000 VideoLAN
5  * $Id: vlc.h,v 1.28 2003/12/02 12:57:35 gbazin Exp $
6  *
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.
11  *
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.
16  *
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  *****************************************************************************/
21
22 #ifndef _VLC_VLC_H
23 #define _VLC_VLC_H 1
24
25 # ifdef __cplusplus
26 extern "C" {
27 # endif
28
29 /*****************************************************************************
30  * Our custom types
31  *****************************************************************************/
32 typedef int vlc_bool_t;
33 typedef struct vlc_list_t vlc_list_t;
34 typedef struct vlc_object_t vlc_object_t;
35
36 typedef union
37 {
38     int             i_int;
39     vlc_bool_t      b_bool;
40     float           f_float;
41     char *          psz_string;
42     void *          p_address;
43     vlc_object_t *  p_object;
44     vlc_list_t *    p_list;
45
46 #if defined( WIN32 ) && !defined( __MINGW32__ )
47     signed __int64   i_time;
48 # else
49     signed long long i_time;
50 #endif
51
52     struct { char *psz_name; int i_object_id; } var;
53
54    /* Make sure the structure is at least 64bits */
55     struct { char a, b, c, d, e, f, g, h; } padding;
56
57 } vlc_value_t;
58
59 struct vlc_list_t
60 {
61     int             i_count;
62     vlc_value_t *   p_values;
63     int *           pi_types;
64
65 };
66
67 /*****************************************************************************
68  * Error values
69  *****************************************************************************/
70 #define VLC_SUCCESS         -0                                   /* No error */
71 #define VLC_ENOMEM          -1                          /* Not enough memory */
72 #define VLC_ETHREAD         -2                               /* Thread error */
73 #define VLC_ETIMEOUT        -3                                    /* Timeout */
74
75 #define VLC_ENOMOD         -10                           /* Module not found */
76
77 #define VLC_ENOOBJ         -20                           /* Object not found */
78 #define VLC_EBADOBJ        -21                            /* Bad object type */
79
80 #define VLC_ENOVAR         -30                         /* Variable not found */
81 #define VLC_EBADVAR        -31                         /* Bad variable value */
82
83 #define VLC_EEXIT         -255                             /* Program exited */
84 #define VLC_EGENERIC      -666                              /* Generic error */
85
86 /*****************************************************************************
87  * Booleans
88  *****************************************************************************/
89 #define VLC_FALSE 0
90 #define VLC_TRUE  1
91
92 /*****************************************************************************
93  * Playlist
94  *****************************************************************************/
95
96 /* Used by playlist_Add */
97 #define PLAYLIST_INSERT          0x0001
98 #define PLAYLIST_REPLACE         0x0002
99 #define PLAYLIST_APPEND          0x0004
100 #define PLAYLIST_GO              0x0008
101 #define PLAYLIST_CHECK_INSERT    0x0010
102
103 #define PLAYLIST_END           -666
104
105 /** Playlist commands */
106 typedef enum {
107     PLAYLIST_PLAY,                              /**< Starts playing. No arg. */
108     PLAYLIST_PAUSE,                     /**< Toggles playlist pause. No arg. */
109     PLAYLIST_STOP,                               /**< Stops playing. No arg. */
110     PLAYLIST_SKIP,                               /**< Skip X items and play. */
111     PLAYLIST_GOTO,                                       /**< Goto Xth item. */
112     PLAYLIST_MODE                                /**< Set playlist mode. ??? */
113 } playlist_command_t;
114
115 /*****************************************************************************
116  * Required internal headers
117  *****************************************************************************/
118 #if defined( __VLC__ )
119 #   include "vlc_common.h"
120 #endif
121
122 /*****************************************************************************
123  * Exported libvlc API
124  *****************************************************************************/
125 char const * VLC_Version ( void );
126 char const * VLC_Error   ( int );
127
128 int     VLC_Create       ( void );
129 int     VLC_Init         ( int, int, char *[] );
130 int     VLC_Die          ( int );
131 int     VLC_Destroy      ( int );
132
133 int     VLC_Set          ( int, char const *, vlc_value_t );
134 int     VLC_Get          ( int, char const *, vlc_value_t * );
135 int     VLC_AddIntf      ( int, char const *, vlc_bool_t );
136 int     VLC_AddTarget    ( int, char const *, const char **, int, int, int );
137
138 int     VLC_Play         ( int );
139 int     VLC_Pause        ( int );
140 int     VLC_Stop         ( int );
141 int     VLC_FullScreen   ( int );
142
143 # ifdef __cplusplus
144 }
145 # endif
146
147 #endif /* <vlc/vlc.h> */