]> git.sesse.net Git - vlc/blob - include/vlc_vlm.h
* vlm.*: move vlm to the core (now, vlm_New create only one instance)
[vlc] / include / vlc_vlm.h
1 /*****************************************************************************
2  * vlc_vlm.h: VLM interface plugin
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VideoLAN
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #ifndef _VLC_VLM_H
26 #define _VLC_VLM_H 1
27
28 /* VLM specific - structures and functions */
29 enum
30 {
31     VOD_TYPE = 0,
32     BROADCAST_TYPE = 1,
33 };
34
35 typedef struct
36 {
37     vlc_bool_t b_enabled;
38     int      i_type;
39
40     /* name "media" is reserved */
41     char    *psz_name;
42
43     int     i_input;
44     char    **input;
45
46     /* only for broadcast */
47     vlc_bool_t b_loop;
48
49     /* "playlist" index */
50     int     i_index;
51
52     char    *psz_output;
53
54     int     i_option;
55     char    **option;
56
57     /* global options for all inputs */
58     char    **input_option;
59     int     i_input_option;
60     input_thread_t  *p_input;
61
62 } vlm_media_t;
63
64
65 typedef struct
66 {
67     /* names "schedule" is reserved */
68     char    *psz_name;
69     vlc_bool_t b_enabled;
70     /* list of commands to execute on date */
71     int i_command;
72     char **command;
73
74     /* the date of 1st execution */
75     mtime_t i_date;
76
77     /* if != 0 repeat schedule every (period) */
78     mtime_t i_period;
79     /* number of times you have to repeat
80        i_repeat < 0 : endless repeat     */
81     int i_repeat;
82
83 } vlm_schedule_t;
84
85 /* ok, here is the structure of a vlm_message:
86    The parent node is ( name_of_the_command , NULL ), or
87    ( name_of_the_command , message_error ) on error.
88    If a node has children, it should not have a value (=NULL).*/
89 struct vlm_message_t
90 {
91     char *psz_name;
92     char *psz_value;
93
94     int           i_child;
95     vlm_message_t **child;
96 };
97
98
99 struct vlm_t
100 {
101     VLC_COMMON_MEMBERS
102
103     vlc_mutex_t lock;
104
105 #if 0
106     int         i_vod;
107     vlm_media_t **vod;
108
109     int         i_broadcast;
110     vlm_media_t **broadcast;
111 #endif
112
113     int            i_media;
114     vlm_media_t    **media;
115
116     int            i_schedule;
117     vlm_schedule_t **schedule;
118 };
119
120
121 #define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
122
123 VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
124 VLC_EXPORT( void,    vlm_Delete, ( vlm_t * ) );
125
126 VLC_EXPORT( int,     vlm_ExecuteCommand, ( vlm_t *, char *, vlm_message_t **) );
127 VLC_EXPORT( void,    vlm_MessageDelete, ( vlm_message_t* ) );
128
129 #endif