]> git.sesse.net Git - vlc/blob - include/vlc/vlc.h
* ./src/misc/objects.c: implemented vlc_list_find() which works like
[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.8 2002/08/14 17:06:53 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 struct vlc_t vlc_t;
33 typedef struct vlc_list_t vlc_list_t;
34 typedef struct vlc_object_t vlc_object_t;
35
36 typedef signed int vlc_error_t;
37 typedef int        vlc_bool_t;
38 typedef int        vlc_status_t;
39
40 /*****************************************************************************
41  * Error values
42  *****************************************************************************/
43 #define VLC_SUCCESS         -0                                   /* No error */
44 #define VLC_EGENERIC        -1                              /* Generic error */
45 #define VLC_ENOMEM          -2                          /* Not enough memory */
46 #define VLC_ESTATUS         -3                             /* Invalid status */
47 #define VLC_EEXIT         -255                             /* Program exited */
48
49 /*****************************************************************************
50  * Booleans
51  *****************************************************************************/
52 #define VLC_FALSE 0
53 #define VLC_TRUE  1
54
55 /*****************************************************************************
56  * Main structure status
57  *****************************************************************************/
58 #define VLC_STATUS_NONE     0x00000000
59 #define VLC_STATUS_CREATED  0x02020202
60 #define VLC_STATUS_STOPPED  0x12121212
61 #define VLC_STATUS_RUNNING  0x42424242
62
63 /*****************************************************************************
64  * Playlist
65  *****************************************************************************/
66
67 /* Used by playlist_Add */
68 #define PLAYLIST_INSERT      0x0001
69 #define PLAYLIST_REPLACE     0x0002
70 #define PLAYLIST_APPEND      0x0004
71 #define PLAYLIST_GO          0x0008
72
73 #define PLAYLIST_END           -666
74
75 /* Playlist parsing mode */
76 #define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
77 #define PLAYLIST_FORWARD          1              /* Parse playlist until end */
78 #define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
79 #define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
80 #define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
81 #define PLAYLIST_RANDOM           3                          /* Shuffle play */
82 #define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
83
84 /* Playlist commands */
85 #define PLAYLIST_PLAY   1                         /* Starts playing. No arg. */
86 #define PLAYLIST_PAUSE  2                 /* Toggles playlist pause. No arg. */
87 #define PLAYLIST_STOP   3                          /* Stops playing. No arg. */
88 #define PLAYLIST_SKIP   4                          /* Skip X items and play. */
89 #define PLAYLIST_GOTO   5                                  /* Goto Xth item. */
90 #define PLAYLIST_MODE   6                          /* Set playlist mode. ??? */
91
92 /*****************************************************************************
93  * Required internal headers
94  *****************************************************************************/
95 #if defined( __VLC__ )
96 #   include "defs.h"
97 #   include "config.h"
98 #   include "modules_inner.h"
99 #   include "vlc_common.h"
100 #   include "os_specific.h"
101 #   include "vlc_messages.h"
102 #   include "mtime.h"
103 #   include "modules.h"
104 #   include "main.h"
105 #   include "configuration.h"
106 #   include "vlc_objects.h"
107 #endif
108
109 /*****************************************************************************
110  * Exported libvlc API
111  *****************************************************************************/
112 vlc_status_t    vlc_status       ( void );
113
114 vlc_error_t     vlc_create       ( void );
115 vlc_error_t     vlc_init         ( int, char *[] );
116 vlc_error_t     vlc_run          ( void );
117 vlc_error_t     vlc_stop         ( void );
118 vlc_error_t     vlc_end          ( void );
119 vlc_error_t     vlc_destroy      ( void );
120
121 vlc_error_t     vlc_add_intf     ( const char *, vlc_bool_t );
122 vlc_error_t     vlc_add_target   ( const char *, int, int );
123
124 /*****************************************************************************
125  * Exported libvlc reentrant API
126  *****************************************************************************/
127 vlc_status_t    vlc_status_r     ( vlc_t * );
128
129 vlc_t *         vlc_create_r     ( void );
130 vlc_error_t     vlc_init_r       ( vlc_t *, int, char *[] );
131 vlc_error_t     vlc_run_r        ( vlc_t * );
132 vlc_error_t     vlc_stop_r       ( vlc_t * );
133 vlc_error_t     vlc_end_r        ( vlc_t * );
134 vlc_error_t     vlc_destroy_r    ( vlc_t * );
135
136 vlc_error_t     vlc_add_intf_r   ( vlc_t *, const char *, vlc_bool_t );
137 vlc_error_t     vlc_add_target_r ( vlc_t *, const char *, int, int );
138
139 # ifdef __cplusplus
140 }
141 # endif
142
143 #endif /* <vlc/vlc.h> */