]> git.sesse.net Git - vlc/blob - include/vlc/vlc.h
Changes to the libvlc API:
[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.15 2002/10/11 22:32:56 sam 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
34 typedef union
35 {
36     int         i_int;
37     vlc_bool_t  b_bool;
38     float       f_float;
39     char *      psz_string;
40     void *      p_address;
41
42     /* Use this to make sure the structure is at least 64bits */
43     struct { char a, b, c, d, e, f, g, h; } padding;
44
45 } vlc_value_t;
46
47 /*****************************************************************************
48  * Error values
49  *****************************************************************************/
50 #define VLC_SUCCESS         -0                                   /* No error */
51 #define VLC_ENOMEM          -1                          /* Not enough memory */
52 #define VLC_EMODULE         -2                           /* Module not found */
53 #define VLC_ESTATUS         -3                             /* Invalid status */
54 #define VLC_ETHREAD         -4                     /* Could not spawn thread */
55 #define VLC_EOBJECT         -5                           /* Object not found */
56 #define VLC_EVAR            -6                         /* Variable not found */
57 #define VLC_EEXIT         -255                             /* Program exited */
58 #define VLC_EGENERIC      -666                              /* Generic error */
59
60 /*****************************************************************************
61  * Booleans
62  *****************************************************************************/
63 #define VLC_FALSE 0
64 #define VLC_TRUE  1
65
66 /*****************************************************************************
67  * Main structure status
68  *****************************************************************************/
69 #define VLC_STATUS_NONE     0x00000000
70 #define VLC_STATUS_CREATED  0x02020202
71 #define VLC_STATUS_STOPPED  0x12121212
72 #define VLC_STATUS_RUNNING  0x42424242
73
74 /*****************************************************************************
75  * Playlist
76  *****************************************************************************/
77
78 /* Used by playlist_Add */
79 #define PLAYLIST_INSERT      0x0001
80 #define PLAYLIST_REPLACE     0x0002
81 #define PLAYLIST_APPEND      0x0004
82 #define PLAYLIST_GO          0x0008
83
84 #define PLAYLIST_END           -666
85
86 /* Playlist parsing mode */
87 #define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
88 #define PLAYLIST_FORWARD          1              /* Parse playlist until end */
89 #define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
90 #define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
91 #define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
92 #define PLAYLIST_RANDOM           3                          /* Shuffle play */
93 #define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
94
95 /* Playlist commands */
96 #define PLAYLIST_PLAY   1                         /* Starts playing. No arg. */
97 #define PLAYLIST_PAUSE  2                 /* Toggles playlist pause. No arg. */
98 #define PLAYLIST_STOP   3                          /* Stops playing. No arg. */
99 #define PLAYLIST_SKIP   4                          /* Skip X items and play. */
100 #define PLAYLIST_GOTO   5                                  /* Goto Xth item. */
101 #define PLAYLIST_MODE   6                          /* Set playlist mode. ??? */
102
103 /*****************************************************************************
104  * Required internal headers
105  *****************************************************************************/
106 #if defined( __VLC__ )
107 #   include "vlc_common.h"
108 #endif
109
110 /*****************************************************************************
111  * Exported libvlc API
112  *****************************************************************************/
113 char *  VLC_Version     ( void );
114
115 int     VLC_Create      ( void );
116 int     VLC_Init        ( int, int, char *[] );
117 int     VLC_Die         ( int );
118 int     VLC_Destroy     ( int );
119
120 int     VLC_Set         ( int, const char *, vlc_value_t );
121 int     VLC_Get         ( int, const char *, vlc_value_t * );
122 int     VLC_AddIntf     ( int, const char *, vlc_bool_t );
123 int     VLC_AddTarget   ( int, const char *, int, int );
124
125 int     VLC_Play        ( int );
126 int     VLC_Pause       ( int );
127 int     VLC_Stop        ( int );
128 int     VLC_FullScreen  ( int );
129
130 # ifdef __cplusplus
131 }
132 # endif
133
134 #endif /* <vlc/vlc.h> */