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