]> git.sesse.net Git - vlc/blob - include/vlc_vlm.h
A bit of headers cleanup
[vlc] / include / vlc_vlm.h
1 /*****************************************************************************
2  * vlc_vlm.h: VLM core structures
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Simon Latapie <garf@videolan.org>
8  *          Laurent Aimar <fenrir@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef _VLC_VLM_H
26 #define _VLC_VLM_H 1
27
28 #ifdef __cpluplus
29 extern "C" {
30 #endif
31
32 #include <vlc_input.h>
33
34 /* VLM specific - structures and functions */
35 enum
36 {
37     VOD_TYPE = 0,
38     BROADCAST_TYPE,
39     SCHEDULE_TYPE,
40 };
41
42 typedef struct
43 {
44     /* instance name */
45     char *psz_name;
46
47     /* "playlist" index */
48     int i_index;
49
50     input_item_t   item;
51     input_thread_t *p_input;
52
53 } vlm_media_instance_t;
54
55 struct vlm_media_t
56 {
57     vlc_bool_t b_enabled;
58     int      i_type;
59
60     /* name "media" is reserved */
61     char    *psz_name;
62     input_item_t item;
63
64     /* "playlist" */
65     int     i_input;
66     char    **input;
67
68     int     i_option;
69     char    **option;
70
71     char    *psz_output;
72
73     /* only for broadcast */
74     vlc_bool_t b_loop;
75
76     /* only for vod */
77     vod_media_t *vod_media;
78     char *psz_vod_output;
79     char *psz_mux;
80
81     /* actual input instances */
82     int                  i_instance;
83     vlm_media_instance_t **instance;
84
85 };
86
87 struct vlm_schedule_t
88 {
89     /* names "schedule" is reserved */
90     char    *psz_name;
91     vlc_bool_t b_enabled;
92     /* list of commands to execute on date */
93     int i_command;
94     char **command;
95
96     /* the date of 1st execution */
97     mtime_t i_date;
98
99     /* if != 0 repeat schedule every (period) */
100     mtime_t i_period;
101     /* number of times you have to repeat
102        i_repeat < 0 : endless repeat     */
103     int i_repeat;
104
105 };
106
107 /* ok, here is the structure of a vlm_message:
108    The parent node is ( name_of_the_command , NULL ), or
109    ( name_of_the_command , message_error ) on error.
110    If a node has children, it should not have a value (=NULL).*/
111 struct vlm_message_t
112 {
113     char *psz_name;
114     char *psz_value;
115
116     int           i_child;
117     vlm_message_t **child;
118 };
119
120
121 struct vlm_t
122 {
123     VLC_COMMON_MEMBERS
124
125     vlc_mutex_t lock;
126
127     int            i_media;
128     vlm_media_t    **media;
129
130     int            i_vod;
131     vod_t          *vod;
132
133     int            i_schedule;
134     vlm_schedule_t **schedule;
135 };
136
137
138 #define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
139 VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
140 VLC_EXPORT( void, vlm_Delete, ( vlm_t * ) );
141 VLC_EXPORT( int, vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) );
142 VLC_EXPORT( void, vlm_MessageDelete, ( vlm_message_t * ) );
143 VLC_EXPORT( vlm_media_t *, vlm_MediaNew, ( vlm_t *, const char *, int ) );
144 VLC_EXPORT( void, vlm_MediaDelete, ( vlm_t *, vlm_media_t *, const char * ) );
145 VLC_EXPORT( int, vlm_MediaSetup, ( vlm_t *, vlm_media_t *, const char *, const char * ) );
146 VLC_EXPORT( int, vlm_MediaControl, ( vlm_t *, vlm_media_t *, const char *, const char *, const char * ) );
147 VLC_EXPORT( vlm_media_t* , vlm_MediaSearch,( vlm_t *, const char *) );
148 VLC_EXPORT( vlm_schedule_t *, vlm_ScheduleNew, ( vlm_t *, const char * ) );
149 VLC_EXPORT( void, vlm_ScheduleDelete, ( vlm_t *, vlm_schedule_t *, const char * ) );
150 VLC_EXPORT( int, vlm_ScheduleSetup, ( vlm_schedule_t *, const char *, const char * ) );
151 VLC_EXPORT( int, vlm_MediaVodControl, ( void *, vod_media_t *, const char *, int, va_list ) );
152 VLC_EXPORT( int, vlm_Save, ( vlm_t *, const char * ) );
153 VLC_EXPORT( int, vlm_Load, ( vlm_t *, const char * ) );
154
155 #ifdef __cpluplus
156 }
157 #endif
158
159 #endif