2 * valerie.h -- High Level Client API for miracle
3 * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 /* System header files */
27 /* Application header files */
28 #include "valerie_parser.h"
29 #include "valerie_status.h"
30 #include "valerie_notifier.h"
37 /** Client error conditions
43 valerie_malloc_failed
,
44 valerie_unknown_error
,
46 valerie_invalid_command
,
47 valerie_server_timeout
,
48 valerie_missing_argument
,
49 valerie_server_unavailable
,
50 valerie_unit_creation_failed
,
51 valerie_unit_unavailable
,
53 valerie_invalid_position
57 /** Clip index specification.
72 valerie_parser parser
;
73 valerie_response last_response
;
80 extern valerie
valerie_init( valerie_parser
);
82 /* Connect to the valerie parser instance */
83 extern valerie_error_code
valerie_connect( valerie
);
85 /* Global functions */
86 extern valerie_error_code
valerie_set( valerie
, char *, char * );
87 extern valerie_error_code
valerie_get( valerie
, char *, char *, int );
88 extern valerie_error_code
valerie_run( valerie
, char * );
91 extern valerie_error_code
valerie_unit_add( valerie
, char *, int * );
92 extern valerie_error_code
valerie_unit_load( valerie
, int, char * );
93 extern valerie_error_code
valerie_unit_load_clipped( valerie
, int, char *, int32_t, int32_t );
94 extern valerie_error_code
valerie_unit_load_back( valerie
, int, char * );
95 extern valerie_error_code
valerie_unit_load_back_clipped( valerie
, int, char *, int32_t, int32_t );
96 extern valerie_error_code
valerie_unit_append( valerie
, int, char *, int32_t, int32_t );
97 extern valerie_error_code
valerie_unit_clean( valerie
, int );
98 extern valerie_error_code
valerie_unit_clear( valerie
, int );
99 extern valerie_error_code
valerie_unit_clip_move( valerie
, int, valerie_clip_offset
, int, valerie_clip_offset
, int );
100 extern valerie_error_code
valerie_unit_clip_remove( valerie
, int, valerie_clip_offset
, int );
101 extern valerie_error_code
valerie_unit_remove_current_clip( valerie
, int );
102 extern valerie_error_code
valerie_unit_clip_insert( valerie
, int, valerie_clip_offset
, int, char *, int32_t, int32_t );
103 extern valerie_error_code
valerie_unit_play( valerie
, int );
104 extern valerie_error_code
valerie_unit_play_at_speed( valerie
, int, int );
105 extern valerie_error_code
valerie_unit_stop( valerie
, int );
106 extern valerie_error_code
valerie_unit_pause( valerie
, int );
107 extern valerie_error_code
valerie_unit_rewind( valerie
, int );
108 extern valerie_error_code
valerie_unit_fast_forward( valerie
, int );
109 extern valerie_error_code
valerie_unit_step( valerie
, int, int32_t );
110 extern valerie_error_code
valerie_unit_goto( valerie
, int, int32_t );
111 extern valerie_error_code
valerie_unit_clip_goto( valerie
, int, valerie_clip_offset
, int, int32_t );
112 extern valerie_error_code
valerie_unit_clip_set_in( valerie
, int, valerie_clip_offset
, int, int32_t );
113 extern valerie_error_code
valerie_unit_clip_set_out( valerie
, int, valerie_clip_offset
, int, int32_t );
114 extern valerie_error_code
valerie_unit_set_in( valerie
, int, int32_t );
115 extern valerie_error_code
valerie_unit_set_out( valerie
, int, int32_t );
116 extern valerie_error_code
valerie_unit_clear_in( valerie
, int );
117 extern valerie_error_code
valerie_unit_clear_out( valerie
, int );
118 extern valerie_error_code
valerie_unit_clear_in_out( valerie
, int );
119 extern valerie_error_code
valerie_unit_set( valerie
, int, char *, char * );
120 extern valerie_error_code
valerie_unit_get( valerie
, int, char * );
121 extern valerie_error_code
valerie_unit_status( valerie
, int, valerie_status
);
122 extern valerie_error_code
valerie_unit_transfer( valerie
, int, int );
124 /* Notifier functionality. */
125 extern valerie_notifier
valerie_get_notifier( valerie
);
127 /** Structure for the directory.
133 valerie_response response
;
135 *valerie_dir
, valerie_dir_t
;
137 /** Directory entry structure.
143 char name
[ NAME_MAX
];
144 char full
[ PATH_MAX
+ NAME_MAX
];
145 unsigned long long size
;
147 *valerie_dir_entry
, valerie_dir_entry_t
;
149 /* Directory reading. */
150 extern valerie_dir
valerie_dir_init( valerie
, char * );
151 extern valerie_error_code
valerie_dir_get_error_code( valerie_dir
);
152 extern valerie_error_code
valerie_dir_get( valerie_dir
, int, valerie_dir_entry
);
153 extern int valerie_dir_count( valerie_dir
);
154 extern void valerie_dir_close( valerie_dir
);
156 /** Structure for the list.
162 valerie_response response
;
164 *valerie_list
, valerie_list_t
;
166 /** List entry structure.
172 char full
[ PATH_MAX
+ NAME_MAX
];
179 *valerie_list_entry
, valerie_list_entry_t
;
182 extern valerie_list
valerie_list_init( valerie
, int );
183 extern valerie_error_code
valerie_list_get_error_code( valerie_list
);
184 extern valerie_error_code
valerie_list_get( valerie_list
, int, valerie_list_entry
);
185 extern int valerie_list_count( valerie_list
);
186 extern void valerie_list_close( valerie_list
);
188 /** Structure for nodes.
193 valerie_response response
;
195 *valerie_nodes
, valerie_nodes_t
;
197 /** Node entry structure.
206 *valerie_node_entry
, valerie_node_entry_t
;
209 extern valerie_nodes
valerie_nodes_init( valerie
);
210 extern valerie_error_code
valerie_nodes_get_error_code( valerie_nodes
);
211 extern valerie_error_code
valerie_nodes_get( valerie_nodes
, int, valerie_node_entry
);
212 extern int valerie_nodes_count( valerie_nodes
);
213 extern void valerie_nodes_close( valerie_nodes
);
215 /** Structure for units.
220 valerie_response response
;
222 *valerie_units
, valerie_units_t
;
224 /** Unit entry structure.
234 *valerie_unit_entry
, valerie_unit_entry_t
;
237 extern valerie_units
valerie_units_init( valerie
);
238 extern valerie_error_code
valerie_units_get_error_code( valerie_units
);
239 extern valerie_error_code
valerie_units_get( valerie_units
, int, valerie_unit_entry
);
240 extern int valerie_units_count( valerie_units
);
241 extern void valerie_units_close( valerie_units
);
243 /* Miscellaenous functions */
244 extern valerie_response
valerie_get_last_response( valerie
);
245 extern char *valerie_error_description( valerie_error_code
);
247 /* Courtesy functions. */
248 extern valerie_error_code
valerie_execute( valerie
, size_t, char *, ... );
250 /* Close function. */
251 extern void valerie_close( valerie
);