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