]> git.sesse.net Git - vlc/blob - include/vlc/vlc.h
* include/vlc/vlc.h: added a new pi_types field to vlc_list_t. This field will be...
[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.21 2002/12/15 16:28:20 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     /* Make sure the structure is at least 64bits */
47     struct { char a, b, c, d, e, f, g, h; } padding;
48
49 } vlc_value_t;
50
51 struct vlc_list_t
52 {
53     int             i_count;
54     vlc_value_t *   p_values;
55     int *           pi_types;
56
57 };
58
59 /*****************************************************************************
60  * Error values
61  *****************************************************************************/
62 #define VLC_SUCCESS         -0                                   /* No error */
63 #define VLC_ENOMEM          -1                          /* Not enough memory */
64 #define VLC_ETHREAD         -2                               /* Thread error */
65 #define VLC_ETIMEOUT        -3                                    /* Timeout */
66
67 #define VLC_ENOMOD         -10                           /* Module not found */
68
69 #define VLC_ENOOBJ         -20                           /* Object not found */
70 #define VLC_EBADOBJ        -21                            /* Bad object type */
71
72 #define VLC_ENOVAR         -30                         /* Variable not found */
73 #define VLC_EBADVAR        -31                         /* Bad variable value */
74
75 #define VLC_EEXIT         -255                             /* Program exited */
76 #define VLC_EGENERIC      -666                              /* Generic error */
77
78 /*****************************************************************************
79  * Booleans
80  *****************************************************************************/
81 #define VLC_FALSE 0
82 #define VLC_TRUE  1
83
84 /*****************************************************************************
85  * Playlist
86  *****************************************************************************/
87
88 /* Used by playlist_Add */
89 #define PLAYLIST_INSERT          0x0001
90 #define PLAYLIST_REPLACE         0x0002
91 #define PLAYLIST_APPEND          0x0004
92 #define PLAYLIST_GO              0x0008
93 #define PLAYLIST_CHECK_INSERT    0x0010
94
95 #define PLAYLIST_END           -666
96
97 /* Playlist parsing mode */
98 #define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
99 #define PLAYLIST_FORWARD          1              /* Parse playlist until end */
100 #define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
101 #define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
102 #define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
103 #define PLAYLIST_RANDOM           3                          /* Shuffle play */
104 #define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
105
106 /* Playlist commands */
107 #define PLAYLIST_PLAY   1                         /* Starts playing. No arg. */
108 #define PLAYLIST_PAUSE  2                 /* Toggles playlist pause. No arg. */
109 #define PLAYLIST_STOP   3                          /* Stops playing. No arg. */
110 #define PLAYLIST_SKIP   4                          /* Skip X items and play. */
111 #define PLAYLIST_GOTO   5                                  /* Goto Xth item. */
112 #define PLAYLIST_MODE   6                          /* Set playlist mode. ??? */
113
114 /*****************************************************************************
115  * Required internal headers
116  *****************************************************************************/
117 #if defined( __VLC__ )
118 #   include "vlc_common.h"
119 #endif
120
121 /*****************************************************************************
122  * Exported libvlc API
123  *****************************************************************************/
124 char const * VLC_Version ( void );
125 char const * VLC_Error   ( int );
126
127 int     VLC_Create       ( void );
128 int     VLC_Init         ( int, int, char *[] );
129 int     VLC_Die          ( int );
130 int     VLC_Destroy      ( int );
131
132 int     VLC_Set          ( int, char const *, vlc_value_t );
133 int     VLC_Get          ( int, char const *, vlc_value_t * );
134 int     VLC_AddIntf      ( int, char const *, vlc_bool_t );
135 int     VLC_AddTarget    ( int, char const *, int, int );
136
137 int     VLC_Play         ( int );
138 int     VLC_Pause        ( int );
139 int     VLC_Stop         ( int );
140 int     VLC_FullScreen   ( int );
141
142 # ifdef __cplusplus
143 }
144 # endif
145
146 #endif /* <vlc/vlc.h> */