2 * mvcp.h -- High Level Client API for Melted
3 * Copyright (C) 2002-2009 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 /* System header files */
27 /* MLT Header files. */
29 #include <framework/mlt.h>
31 #define mlt_service void *
34 /* Application header files */
35 #include "mvcp_parser.h"
36 #include "mvcp_status.h"
37 #include "mvcp_notifier.h"
44 /** Client error conditions
55 mvcp_missing_argument
,
56 mvcp_server_unavailable
,
57 mvcp_unit_creation_failed
,
58 mvcp_unit_unavailable
,
64 /** Clip index specification.
80 mvcp_response last_response
;
87 extern mvcp
mvcp_init( mvcp_parser
);
89 /* Connect to the mvcp parser instance */
90 extern mvcp_error_code
mvcp_connect( mvcp
);
92 /* Global functions */
93 extern mvcp_error_code
mvcp_set( mvcp
, char *, char * );
94 extern mvcp_error_code
mvcp_get( mvcp
, char *, char *, int );
95 extern mvcp_error_code
mvcp_run( mvcp
, char * );
98 extern mvcp_error_code
mvcp_unit_add( mvcp
, char *, int * );
99 extern mvcp_error_code
mvcp_unit_load( mvcp
, int, char * );
100 extern mvcp_error_code
mvcp_unit_load_clipped( mvcp
, int, char *, int32_t, int32_t );
101 extern mvcp_error_code
mvcp_unit_load_back( mvcp
, int, char * );
102 extern mvcp_error_code
mvcp_unit_load_back_clipped( mvcp
, int, char *, int32_t, int32_t );
103 extern mvcp_error_code
mvcp_unit_append( mvcp
, int, char *, int32_t, int32_t );
104 extern mvcp_error_code
mvcp_unit_receive( mvcp
, int, char *, char * );
105 extern mvcp_error_code
mvcp_unit_push( mvcp
, int, char *, mlt_service
);
106 extern mvcp_error_code
mvcp_unit_clean( mvcp
, int );
107 extern mvcp_error_code
mvcp_unit_wipe( mvcp
, int );
108 extern mvcp_error_code
mvcp_unit_clear( mvcp
, int );
109 extern mvcp_error_code
mvcp_unit_clip_move( mvcp
, int, mvcp_clip_offset
, int, mvcp_clip_offset
, int );
110 extern mvcp_error_code
mvcp_unit_clip_remove( mvcp
, int, mvcp_clip_offset
, int );
111 extern mvcp_error_code
mvcp_unit_remove_current_clip( mvcp
, int );
112 extern mvcp_error_code
mvcp_unit_clip_insert( mvcp
, int, mvcp_clip_offset
, int, char *, int32_t, int32_t );
113 extern mvcp_error_code
mvcp_unit_play( mvcp
, int );
114 extern mvcp_error_code
mvcp_unit_play_at_speed( mvcp
, int, int );
115 extern mvcp_error_code
mvcp_unit_stop( mvcp
, int );
116 extern mvcp_error_code
mvcp_unit_pause( mvcp
, int );
117 extern mvcp_error_code
mvcp_unit_rewind( mvcp
, int );
118 extern mvcp_error_code
mvcp_unit_fast_forward( mvcp
, int );
119 extern mvcp_error_code
mvcp_unit_step( mvcp
, int, int32_t );
120 extern mvcp_error_code
mvcp_unit_goto( mvcp
, int, int32_t );
121 extern mvcp_error_code
mvcp_unit_clip_goto( mvcp
, int, mvcp_clip_offset
, int, int32_t );
122 extern mvcp_error_code
mvcp_unit_clip_set_in( mvcp
, int, mvcp_clip_offset
, int, int32_t );
123 extern mvcp_error_code
mvcp_unit_clip_set_out( mvcp
, int, mvcp_clip_offset
, int, int32_t );
124 extern mvcp_error_code
mvcp_unit_set_in( mvcp
, int, int32_t );
125 extern mvcp_error_code
mvcp_unit_set_out( mvcp
, int, int32_t );
126 extern mvcp_error_code
mvcp_unit_clear_in( mvcp
, int );
127 extern mvcp_error_code
mvcp_unit_clear_out( mvcp
, int );
128 extern mvcp_error_code
mvcp_unit_clear_in_out( mvcp
, int );
129 extern mvcp_error_code
mvcp_unit_set( mvcp
, int, const char *, const char * );
130 extern mvcp_error_code
mvcp_unit_get( mvcp
, int, char *, char *, int );
131 extern mvcp_error_code
mvcp_unit_status( mvcp
, int, mvcp_status
);
132 extern mvcp_error_code
mvcp_unit_transfer( mvcp
, int, int );
134 /* Notifier functionality. */
135 extern mvcp_notifier
mvcp_get_notifier( mvcp
);
137 /** Structure for the directory.
143 mvcp_response response
;
145 *mvcp_dir
, mvcp_dir_t
;
147 /** Directory entry structure.
153 char name
[ NAME_MAX
];
154 char full
[ PATH_MAX
+ NAME_MAX
];
155 unsigned long long size
;
157 *mvcp_dir_entry
, mvcp_dir_entry_t
;
159 /* Directory reading. */
160 extern mvcp_dir
mvcp_dir_init( mvcp
, const char * );
161 extern mvcp_error_code
mvcp_dir_get_error_code( mvcp_dir
);
162 extern mvcp_error_code
mvcp_dir_get( mvcp_dir
, int, mvcp_dir_entry
);
163 extern int mvcp_dir_count( mvcp_dir
);
164 extern void mvcp_dir_close( mvcp_dir
);
166 /** Structure for the list.
172 mvcp_response response
;
174 *mvcp_list
, mvcp_list_t
;
176 /** List entry structure.
182 char full
[ PATH_MAX
+ NAME_MAX
];
189 *mvcp_list_entry
, mvcp_list_entry_t
;
192 extern mvcp_list
mvcp_list_init( mvcp
, int );
193 extern mvcp_error_code
mvcp_list_get_error_code( mvcp_list
);
194 extern mvcp_error_code
mvcp_list_get( mvcp_list
, int, mvcp_list_entry
);
195 extern int mvcp_list_count( mvcp_list
);
196 extern void mvcp_list_close( mvcp_list
);
198 /** Structure for nodes.
203 mvcp_response response
;
205 *mvcp_nodes
, mvcp_nodes_t
;
207 /** Node entry structure.
216 *mvcp_node_entry
, mvcp_node_entry_t
;
219 extern mvcp_nodes
mvcp_nodes_init( mvcp
);
220 extern mvcp_error_code
mvcp_nodes_get_error_code( mvcp_nodes
);
221 extern mvcp_error_code
mvcp_nodes_get( mvcp_nodes
, int, mvcp_node_entry
);
222 extern int mvcp_nodes_count( mvcp_nodes
);
223 extern void mvcp_nodes_close( mvcp_nodes
);
225 /** Structure for units.
230 mvcp_response response
;
232 *mvcp_units
, mvcp_units_t
;
234 /** Unit entry structure.
244 *mvcp_unit_entry
, mvcp_unit_entry_t
;
247 extern mvcp_units
mvcp_units_init( mvcp
);
248 extern mvcp_error_code
mvcp_units_get_error_code( mvcp_units
);
249 extern mvcp_error_code
mvcp_units_get( mvcp_units
, int, mvcp_unit_entry
);
250 extern int mvcp_units_count( mvcp_units
);
251 extern void mvcp_units_close( mvcp_units
);
253 /* Miscellaenous functions */
254 extern mvcp_response
mvcp_get_last_response( mvcp
);
255 extern const char *mvcp_error_description( mvcp_error_code
);
257 /* Courtesy functions. */
258 extern mvcp_error_code
mvcp_execute( mvcp
, size_t, const char *, ... );
259 extern mvcp_error_code
mvcp_push( mvcp
, mlt_service
, size_t, const char *, ... );
261 /* Close function. */
262 extern void mvcp_close( mvcp
);