CuteLogger
Fast and simple logging solution for Qt based applications
mvcp.h
1 /*
2  * mvcp.h -- High Level Client API for Melted
3  * Copyright (C) 2002-2015 Meltytech, LLC
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef _MVCP_H_
21 #define _MVCP_H_
22 
23 /* System header files */
24 #include <limits.h>
25 
26 /* MLT Header files. */
27 #ifndef MVCP_EMBEDDED
28 #include <framework/mlt.h>
29 #else
30 #define mlt_service void *
31 #endif
32 
33 /* Application header files */
34 #include "mvcp_parser.h"
35 #include "mvcp_status.h"
36 #include "mvcp_notifier.h"
37 
38 
39 #ifndef PATH_MAX
40 #define PATH_MAX (4096)
41 #endif
42 #ifndef NAME_MAX
43 #define NAME_MAX (256)
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
54 typedef enum
55 {
56  mvcp_ok = 0,
57  mvcp_malloc_failed,
58  mvcp_unknown_error,
59  mvcp_no_response,
60  mvcp_invalid_command,
61  mvcp_server_timeout,
62  mvcp_missing_argument,
63  mvcp_server_unavailable,
64  mvcp_unit_creation_failed,
65  mvcp_unit_unavailable,
66  mvcp_invalid_file,
67  mvcp_invalid_position
68 }
69 mvcp_error_code;
70 
74 typedef enum
75 {
76  mvcp_absolute = 0,
77  mvcp_relative
78 }
79 mvcp_clip_offset;
80 
84 typedef struct
85 {
86  mvcp_parser parser;
87  mvcp_response last_response;
88 }
89 *mvcp, mvcp_t;
90 
94 extern mvcp mvcp_init( mvcp_parser );
95 
96 /* Connect to the mvcp parser instance */
97 extern mvcp_error_code mvcp_connect( mvcp );
98 
99 /* Global functions */
100 extern mvcp_error_code mvcp_set( mvcp, char *, char * );
101 extern mvcp_error_code mvcp_get( mvcp, char *, char *, int );
102 extern mvcp_error_code mvcp_run( mvcp, char * );
103 
104 /* Unit functions */
105 extern mvcp_error_code mvcp_unit_add( mvcp, char *, int * );
106 extern mvcp_error_code mvcp_unit_load( mvcp, int, char * );
107 extern mvcp_error_code mvcp_unit_load_clipped( mvcp, int, char *, int32_t, int32_t );
108 extern mvcp_error_code mvcp_unit_load_back( mvcp, int, char * );
109 extern mvcp_error_code mvcp_unit_load_back_clipped( mvcp, int, char *, int32_t, int32_t );
110 extern mvcp_error_code mvcp_unit_append( mvcp, int, char *, int32_t, int32_t );
111 extern mvcp_error_code mvcp_unit_receive( mvcp, int, char *, char * );
112 extern mvcp_error_code mvcp_unit_push( mvcp, int, char *, mlt_service );
113 extern mvcp_error_code mvcp_unit_clean( mvcp, int );
114 extern mvcp_error_code mvcp_unit_wipe( mvcp, int );
115 extern mvcp_error_code mvcp_unit_clear( mvcp, int );
116 extern mvcp_error_code mvcp_unit_clip_move( mvcp, int, mvcp_clip_offset, int, mvcp_clip_offset, int );
117 extern mvcp_error_code mvcp_unit_clip_remove( mvcp, int, mvcp_clip_offset, int );
118 extern mvcp_error_code mvcp_unit_remove_current_clip( mvcp, int );
119 extern mvcp_error_code mvcp_unit_clip_insert( mvcp, int, mvcp_clip_offset, int, char *, int32_t, int32_t );
120 extern mvcp_error_code mvcp_unit_play( mvcp, int );
121 extern mvcp_error_code mvcp_unit_play_at_speed( mvcp, int, int );
122 extern mvcp_error_code mvcp_unit_stop( mvcp, int );
123 extern mvcp_error_code mvcp_unit_pause( mvcp, int );
124 extern mvcp_error_code mvcp_unit_rewind( mvcp, int );
125 extern mvcp_error_code mvcp_unit_fast_forward( mvcp, int );
126 extern mvcp_error_code mvcp_unit_step( mvcp, int, int32_t );
127 extern mvcp_error_code mvcp_unit_goto( mvcp, int, int32_t );
128 extern mvcp_error_code mvcp_unit_clip_goto( mvcp, int, mvcp_clip_offset, int, int32_t );
129 extern mvcp_error_code mvcp_unit_clip_set_in( mvcp, int, mvcp_clip_offset, int, int32_t );
130 extern mvcp_error_code mvcp_unit_clip_set_out( mvcp, int, mvcp_clip_offset, int, int32_t );
131 extern mvcp_error_code mvcp_unit_set_in( mvcp, int, int32_t );
132 extern mvcp_error_code mvcp_unit_set_out( mvcp, int, int32_t );
133 extern mvcp_error_code mvcp_unit_clear_in( mvcp, int );
134 extern mvcp_error_code mvcp_unit_clear_out( mvcp, int );
135 extern mvcp_error_code mvcp_unit_clear_in_out( mvcp, int );
136 extern mvcp_error_code mvcp_unit_set( mvcp, int, const char *, const char * );
137 extern mvcp_error_code mvcp_unit_get( mvcp, int, char *, char *, int );
138 extern mvcp_error_code mvcp_unit_status( mvcp, int, mvcp_status );
139 extern mvcp_error_code mvcp_unit_transfer( mvcp, int, int );
140 
141 /* Notifier functionality. */
142 extern mvcp_notifier mvcp_get_notifier( mvcp );
143 
147 typedef struct
148 {
149  char *directory;
150  mvcp_response response;
151 }
153 
157 typedef struct
158 {
159  int dir;
160  char name[ NAME_MAX ];
161  char full[ PATH_MAX + NAME_MAX ];
162  unsigned long long size;
163 }
165 
166 /* Directory reading. */
167 extern mvcp_dir mvcp_dir_init( mvcp, const char * );
168 extern mvcp_error_code mvcp_dir_get_error_code( mvcp_dir );
169 extern mvcp_error_code mvcp_dir_get( mvcp_dir, int, mvcp_dir_entry );
170 extern int mvcp_dir_count( mvcp_dir );
171 extern void mvcp_dir_close( mvcp_dir );
172 
176 typedef struct
177 {
178  int generation;
179  mvcp_response response;
180 }
182 
186 typedef struct
187 {
188  int clip;
189  char full[ PATH_MAX + NAME_MAX ];
190  int32_t in;
191  int32_t out;
192  int32_t max;
193  int32_t size;
194  float fps;
195 }
197 
198 /* List reading. */
199 extern mvcp_list mvcp_list_init( mvcp, int );
200 extern mvcp_error_code mvcp_list_get_error_code( mvcp_list );
201 extern mvcp_error_code mvcp_list_get( mvcp_list, int, mvcp_list_entry );
202 extern int mvcp_list_count( mvcp_list );
203 extern void mvcp_list_close( mvcp_list );
204 
208 typedef struct
209 {
210  mvcp_response response;
211 }
213 
217 typedef struct
218 {
219  int node;
220  char guid[ 17 ];
221  char name[ 1024 ];
222 }
224 
225 /* Node reading. */
226 extern mvcp_nodes mvcp_nodes_init( mvcp );
227 extern mvcp_error_code mvcp_nodes_get_error_code( mvcp_nodes );
228 extern mvcp_error_code mvcp_nodes_get( mvcp_nodes, int, mvcp_node_entry );
229 extern int mvcp_nodes_count( mvcp_nodes );
230 extern void mvcp_nodes_close( mvcp_nodes );
231 
235 typedef struct
236 {
237  mvcp_response response;
238 }
240 
244 typedef struct
245 {
246  int unit;
247  int node;
248  char guid[ 512 ];
249  int online;
250 }
252 
253 /* Unit reading. */
254 extern mvcp_units mvcp_units_init( mvcp );
255 extern mvcp_error_code mvcp_units_get_error_code( mvcp_units );
256 extern mvcp_error_code mvcp_units_get( mvcp_units, int, mvcp_unit_entry );
257 extern int mvcp_units_count( mvcp_units );
258 extern void mvcp_units_close( mvcp_units );
259 
260 /* Miscellaenous functions */
261 extern mvcp_response mvcp_get_last_response( mvcp );
262 extern const char *mvcp_error_description( mvcp_error_code );
263 
264 /* Courtesy functions. */
265 extern mvcp_error_code mvcp_execute( mvcp, size_t, const char *, ... );
266 extern mvcp_error_code mvcp_push( mvcp, mlt_service, size_t, const char *, ... );
267 
268 /* Close function. */
269 extern void mvcp_close( mvcp );
270 
271 #ifdef __cplusplus
272 }
273 #endif
274 
275 #endif
Definition: mvcp.h:186
Definition: mvcp.h:244
Definition: mvcp.h:84
Definition: mvcp.h:157
Definition: mvcp.h:217
Definition: mvcp.h:147
Definition: mvcp_notifier.h:40
Definition: mvcp.h:176
Definition: mvcp_parser.h:52
Definition: mvcp_response.h:34
Definition: mvcp.h:235
Definition: mvcp.h:208
Definition: mvcp_status.h:50