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. */
28 #include <framework/mlt.h>
30 /* Application header files */
31 #include "mvcp_parser.h"
32 #include "mvcp_status.h"
33 #include "mvcp_notifier.h"
40 /** Client error conditions
51 mvcp_missing_argument
,
52 mvcp_server_unavailable
,
53 mvcp_unit_creation_failed
,
54 mvcp_unit_unavailable
,
60 /** Clip index specification.
76 mvcp_response last_response
;
83 extern mvcp
mvcp_init( mvcp_parser
);
85 /* Connect to the mvcp parser instance */
86 extern mvcp_error_code
mvcp_connect( mvcp
);
88 /* Global functions */
89 extern mvcp_error_code
mvcp_set( mvcp
, char *, char * );
90 extern mvcp_error_code
mvcp_get( mvcp
, char *, char *, int );
91 extern mvcp_error_code
mvcp_run( mvcp
, char * );
94 extern mvcp_error_code
mvcp_unit_add( mvcp
, char *, int * );
95 extern mvcp_error_code
mvcp_unit_load( mvcp
, int, char * );
96 extern mvcp_error_code
mvcp_unit_load_clipped( mvcp
, int, char *, int32_t, int32_t );
97 extern mvcp_error_code
mvcp_unit_load_back( mvcp
, int, char * );
98 extern mvcp_error_code
mvcp_unit_load_back_clipped( mvcp
, int, char *, int32_t, int32_t );
99 extern mvcp_error_code
mvcp_unit_append( mvcp
, int, char *, int32_t, int32_t );
100 extern mvcp_error_code
mvcp_unit_receive( mvcp
, int, char *, char * );
101 extern mvcp_error_code
mvcp_unit_push( mvcp
, int, char *, mlt_service
);
102 extern mvcp_error_code
mvcp_unit_clean( mvcp
, int );
103 extern mvcp_error_code
mvcp_unit_wipe( mvcp
, int );
104 extern mvcp_error_code
mvcp_unit_clear( mvcp
, int );
105 extern mvcp_error_code
mvcp_unit_clip_move( mvcp
, int, mvcp_clip_offset
, int, mvcp_clip_offset
, int );
106 extern mvcp_error_code
mvcp_unit_clip_remove( mvcp
, int, mvcp_clip_offset
, int );
107 extern mvcp_error_code
mvcp_unit_remove_current_clip( mvcp
, int );
108 extern mvcp_error_code
mvcp_unit_clip_insert( mvcp
, int, mvcp_clip_offset
, int, char *, int32_t, int32_t );
109 extern mvcp_error_code
mvcp_unit_play( mvcp
, int );
110 extern mvcp_error_code
mvcp_unit_play_at_speed( mvcp
, int, int );
111 extern mvcp_error_code
mvcp_unit_stop( mvcp
, int );
112 extern mvcp_error_code
mvcp_unit_pause( mvcp
, int );
113 extern mvcp_error_code
mvcp_unit_rewind( mvcp
, int );
114 extern mvcp_error_code
mvcp_unit_fast_forward( mvcp
, int );
115 extern mvcp_error_code
mvcp_unit_step( mvcp
, int, int32_t );
116 extern mvcp_error_code
mvcp_unit_goto( mvcp
, int, int32_t );
117 extern mvcp_error_code
mvcp_unit_clip_goto( mvcp
, int, mvcp_clip_offset
, int, int32_t );
118 extern mvcp_error_code
mvcp_unit_clip_set_in( mvcp
, int, mvcp_clip_offset
, int, int32_t );
119 extern mvcp_error_code
mvcp_unit_clip_set_out( mvcp
, int, mvcp_clip_offset
, int, int32_t );
120 extern mvcp_error_code
mvcp_unit_set_in( mvcp
, int, int32_t );
121 extern mvcp_error_code
mvcp_unit_set_out( mvcp
, int, int32_t );
122 extern mvcp_error_code
mvcp_unit_clear_in( mvcp
, int );
123 extern mvcp_error_code
mvcp_unit_clear_out( mvcp
, int );
124 extern mvcp_error_code
mvcp_unit_clear_in_out( mvcp
, int );
125 extern mvcp_error_code
mvcp_unit_set( mvcp
, int, const char *, const char * );
126 extern mvcp_error_code
mvcp_unit_get( mvcp
, int, char * );
127 extern mvcp_error_code
mvcp_unit_status( mvcp
, int, mvcp_status
);
128 extern mvcp_error_code
mvcp_unit_transfer( mvcp
, int, int );
130 /* Notifier functionality. */
131 extern mvcp_notifier
mvcp_get_notifier( mvcp
);
133 /** Structure for the directory.
139 mvcp_response response
;
141 *mvcp_dir
, mvcp_dir_t
;
143 /** Directory entry structure.
149 char name
[ NAME_MAX
];
150 char full
[ PATH_MAX
+ NAME_MAX
];
151 unsigned long long size
;
153 *mvcp_dir_entry
, mvcp_dir_entry_t
;
155 /* Directory reading. */
156 extern mvcp_dir
mvcp_dir_init( mvcp
, const char * );
157 extern mvcp_error_code
mvcp_dir_get_error_code( mvcp_dir
);
158 extern mvcp_error_code
mvcp_dir_get( mvcp_dir
, int, mvcp_dir_entry
);
159 extern int mvcp_dir_count( mvcp_dir
);
160 extern void mvcp_dir_close( mvcp_dir
);
162 /** Structure for the list.
168 mvcp_response response
;
170 *mvcp_list
, mvcp_list_t
;
172 /** List entry structure.
178 char full
[ PATH_MAX
+ NAME_MAX
];
185 *mvcp_list_entry
, mvcp_list_entry_t
;
188 extern mvcp_list
mvcp_list_init( mvcp
, int );
189 extern mvcp_error_code
mvcp_list_get_error_code( mvcp_list
);
190 extern mvcp_error_code
mvcp_list_get( mvcp_list
, int, mvcp_list_entry
);
191 extern int mvcp_list_count( mvcp_list
);
192 extern void mvcp_list_close( mvcp_list
);
194 /** Structure for nodes.
199 mvcp_response response
;
201 *mvcp_nodes
, mvcp_nodes_t
;
203 /** Node entry structure.
212 *mvcp_node_entry
, mvcp_node_entry_t
;
215 extern mvcp_nodes
mvcp_nodes_init( mvcp
);
216 extern mvcp_error_code
mvcp_nodes_get_error_code( mvcp_nodes
);
217 extern mvcp_error_code
mvcp_nodes_get( mvcp_nodes
, int, mvcp_node_entry
);
218 extern int mvcp_nodes_count( mvcp_nodes
);
219 extern void mvcp_nodes_close( mvcp_nodes
);
221 /** Structure for units.
226 mvcp_response response
;
228 *mvcp_units
, mvcp_units_t
;
230 /** Unit entry structure.
240 *mvcp_unit_entry
, mvcp_unit_entry_t
;
243 extern mvcp_units
mvcp_units_init( mvcp
);
244 extern mvcp_error_code
mvcp_units_get_error_code( mvcp_units
);
245 extern mvcp_error_code
mvcp_units_get( mvcp_units
, int, mvcp_unit_entry
);
246 extern int mvcp_units_count( mvcp_units
);
247 extern void mvcp_units_close( mvcp_units
);
249 /* Miscellaenous functions */
250 extern mvcp_response
mvcp_get_last_response( mvcp
);
251 extern const char *mvcp_error_description( mvcp_error_code
);
253 /* Courtesy functions. */
254 extern mvcp_error_code
mvcp_execute( mvcp
, size_t, const char *, ... );
255 extern mvcp_error_code
mvcp_push( mvcp
, mlt_service
, size_t, const char *, ... );
257 /* Close function. */
258 extern void mvcp_close( mvcp
);