32 |
|
|
33 |
//////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////// |
34 |
|
|
35 |
lscp_status_t client_callback ( lscp_client_t *pClient, lscp_event_t event, const char *pchBuffer, int cchBuffer, void *pvData ) |
lscp_status_t client_callback ( lscp_client_t *pClient, lscp_event_t event, const char *pchData, int cchData, void *pvData ) |
36 |
{ |
{ |
37 |
lscp_status_t ret = LSCP_OK; |
lscp_status_t ret = LSCP_FAILED; |
38 |
|
|
39 |
char *pszBuffer = (char *) malloc(cchBuffer + 1); |
char *pszData = (char *) malloc(cchData + 1); |
40 |
if (pszBuffer) { |
if (pszData) { |
41 |
memcpy(pszBuffer, pchBuffer, cchBuffer); |
memcpy(pszData, pchData, cchData); |
42 |
pszBuffer[cchBuffer] = (char) 0; |
pszData[cchData] = (char) 0; |
43 |
printf("client_callback: event=0x%04x [%s]\n", (unsigned int) event, pszBuffer); |
printf("client_callback: event=%s (0x%04x) [%s]\n", lscp_event_to_text(event), (int) event, pszData); |
44 |
free(pszBuffer); |
free(pszData); |
45 |
|
ret = LSCP_OK; |
46 |
} |
} |
|
else ret = LSCP_FAILED; |
|
47 |
|
|
48 |
return ret; |
return ret; |
49 |
} |
} |
50 |
|
|
51 |
//////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////// |
52 |
|
|
53 |
|
int client_test_int ( int i ) |
54 |
|
{ |
55 |
|
printf("%d\n", i); |
56 |
|
return (i >= 0 ? 0 : 1); |
57 |
|
} |
58 |
|
|
59 |
|
int client_test_status ( lscp_status_t s ) |
60 |
|
{ |
61 |
|
const char *pszStatus; |
62 |
|
|
63 |
|
switch (s) { |
64 |
|
case LSCP_OK: pszStatus = "OK"; break; |
65 |
|
case LSCP_FAILED: pszStatus = "FAILED"; break; |
66 |
|
case LSCP_ERROR: pszStatus = "ERROR"; break; |
67 |
|
case LSCP_WARNING: pszStatus = "WARNING"; break; |
68 |
|
case LSCP_TIMEOUT: pszStatus = "TIMEOUT"; break; |
69 |
|
case LSCP_QUIT: pszStatus = "QUIT"; break; |
70 |
|
default: pszStatus = "NONE"; break; |
71 |
|
} |
72 |
|
printf("%s\n", pszStatus); |
73 |
|
return (s == LSCP_OK ? 0 : 1); |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
|
int client_test_isplit ( int *piSplit ) |
78 |
|
{ |
79 |
|
int i; |
80 |
|
|
81 |
|
printf("{"); |
82 |
|
for (i = 0; piSplit && piSplit[i] >= 0; i++) { |
83 |
|
if (i > 0) |
84 |
|
printf(","); |
85 |
|
printf(" %d", piSplit[i]); |
86 |
|
} |
87 |
|
printf(" }\n"); |
88 |
|
return 0; |
89 |
|
} |
90 |
|
|
91 |
|
int client_test_szsplit ( char **ppszSplit ) |
92 |
|
{ |
93 |
|
int i; |
94 |
|
|
95 |
|
printf("{"); |
96 |
|
for (i = 0; ppszSplit && ppszSplit[i]; i++) { |
97 |
|
if (i > 0) |
98 |
|
printf(","); |
99 |
|
printf(" %s", ppszSplit[i]); |
100 |
|
} |
101 |
|
printf(" }\n"); |
102 |
|
return 0; |
103 |
|
} |
104 |
|
|
105 |
|
int client_test_params ( lscp_param_t *pParams ) |
106 |
|
{ |
107 |
|
int i; |
108 |
|
|
109 |
|
printf("{"); |
110 |
|
for (i = 0; pParams && pParams[i].key; i++) { |
111 |
|
if (i > 0) |
112 |
|
printf(","); |
113 |
|
printf(" %s='%s'", pParams[i].key, pParams[i].value); |
114 |
|
} |
115 |
|
printf(" }\n"); |
116 |
|
return 0; |
117 |
|
} |
118 |
|
|
119 |
|
int client_test_param_info ( lscp_param_info_t *pParamInfo ) |
120 |
|
{ |
121 |
|
const char *pszType; |
122 |
|
|
123 |
|
if (pParamInfo == NULL) { |
124 |
|
printf("(nil)\n"); |
125 |
|
return 1; |
126 |
|
} |
127 |
|
switch (pParamInfo->type) { |
128 |
|
case LSCP_TYPE_BOOL: pszType = "BOOL"; break; |
129 |
|
case LSCP_TYPE_INT: pszType = "INT"; break; |
130 |
|
case LSCP_TYPE_FLOAT: pszType = "FLOAT"; break; |
131 |
|
case LSCP_TYPE_STRING: pszType = "STRING"; break; |
132 |
|
default: pszType = "NONE"; break; |
133 |
|
} |
134 |
|
printf("{\n"); |
135 |
|
printf(" param_info.type = %d (%s)\n", (int) pParamInfo->type, pszType); |
136 |
|
printf(" param_info.description = %s\n", pParamInfo->description); |
137 |
|
printf(" param_info.mandatory = %d\n", pParamInfo->mandatory); |
138 |
|
printf(" param_info.fix = %d\n", pParamInfo->fix); |
139 |
|
printf(" param_info.multiplicity = %d\n", pParamInfo->multiplicity); |
140 |
|
printf(" param_info.depends = "); client_test_szsplit(pParamInfo->depends); |
141 |
|
printf(" param_info.defaultv = %s\n", pParamInfo->defaultv); |
142 |
|
printf(" param_info.range_min = %s\n", pParamInfo->range_min); |
143 |
|
printf(" param_info.range_max = %s\n", pParamInfo->range_max); |
144 |
|
printf(" param_info.possibilities = "); client_test_szsplit(pParamInfo->possibilities); |
145 |
|
printf(" }\n"); |
146 |
|
return 0; |
147 |
|
} |
148 |
|
|
149 |
|
int client_test_driver_info ( lscp_driver_info_t *pDriverInfo ) |
150 |
|
{ |
151 |
|
if (pDriverInfo == NULL) { |
152 |
|
printf("(nil)\n"); |
153 |
|
return 1; |
154 |
|
} |
155 |
|
printf("{\n"); |
156 |
|
printf(" driver_info.description = %s\n", pDriverInfo->description); |
157 |
|
printf(" driver_info.version = %s\n", pDriverInfo->version); |
158 |
|
printf(" driver_info.parameters = "); client_test_szsplit(pDriverInfo->parameters); |
159 |
|
printf(" }\n"); |
160 |
|
return 0; |
161 |
|
} |
162 |
|
|
163 |
|
int client_test_device_info ( lscp_device_info_t *pDeviceInfo ) |
164 |
|
{ |
165 |
|
if (pDeviceInfo == NULL) { |
166 |
|
printf("(nil)\n"); |
167 |
|
return 1; |
168 |
|
} |
169 |
|
printf("{\n"); |
170 |
|
printf(" device_info.driver = %s\n", pDeviceInfo->driver); |
171 |
|
printf(" device_info.params = "); client_test_params(pDeviceInfo->params); |
172 |
|
printf(" }\n"); |
173 |
|
return 0; |
174 |
|
} |
175 |
|
|
176 |
|
int client_test_device_port_info ( lscp_device_port_info_t *pDevicePortInfo ) |
177 |
|
{ |
178 |
|
if (pDevicePortInfo == NULL) { |
179 |
|
printf("(nil)\n"); |
180 |
|
return 1; |
181 |
|
} |
182 |
|
printf("{\n"); |
183 |
|
printf(" device_port_info.name = %s\n", pDevicePortInfo->name); |
184 |
|
printf(" device_port_info.params = "); client_test_params(pDevicePortInfo->params); |
185 |
|
printf(" }\n"); |
186 |
|
return 0; |
187 |
|
} |
188 |
|
|
189 |
|
int client_test_engine_info ( lscp_engine_info_t *pEngineInfo ) |
190 |
|
{ |
191 |
|
if (pEngineInfo == NULL) { |
192 |
|
printf("(nil)\n"); |
193 |
|
return 1; |
194 |
|
} |
195 |
|
printf("{\n"); |
196 |
|
printf(" engine_info.description = %s\n", pEngineInfo->description); |
197 |
|
printf(" engine_info.version = %s\n", pEngineInfo->version); |
198 |
|
printf(" }\n"); |
199 |
|
return 0; |
200 |
|
} |
201 |
|
|
202 |
|
int client_test_channel_info ( lscp_channel_info_t *pChannelInfo ) |
203 |
|
{ |
204 |
|
if (pChannelInfo == NULL) { |
205 |
|
printf("(nil)\n"); |
206 |
|
return 1; |
207 |
|
} |
208 |
|
printf("{\n"); |
209 |
|
printf(" channel_info.engine_name = %s\n", pChannelInfo->engine_name); |
210 |
|
printf(" channel_info.audio_device = %d\n", pChannelInfo->audio_device); |
211 |
|
printf(" channel_info.audio_channels = %d\n", pChannelInfo->audio_channels); |
212 |
|
printf(" channel_info.audio_routing = "); client_test_szsplit(pChannelInfo->audio_routing); |
213 |
|
printf(" channel_info.instrument_file = %s\n", pChannelInfo->instrument_file); |
214 |
|
printf(" channel_info.instrument_nr = %d\n", pChannelInfo->instrument_nr); |
215 |
|
printf(" channel_info.instrument_status = %d\n", pChannelInfo->instrument_status); |
216 |
|
printf(" channel_info.midi_device = %d\n", pChannelInfo->midi_device); |
217 |
|
printf(" channel_info.midi_port = %d\n", pChannelInfo->midi_port); |
218 |
|
printf(" channel_info.midi_channel = %d\n", pChannelInfo->midi_channel); |
219 |
|
printf(" channel_info.volume = %g\n", pChannelInfo->volume); |
220 |
|
printf(" }\n"); |
221 |
|
return 0; |
222 |
|
} |
223 |
|
|
224 |
|
int client_test_buffer_fill ( lscp_buffer_fill_t *pBufferFill ) |
225 |
|
{ |
226 |
|
if (pBufferFill == NULL) { |
227 |
|
printf("(nil)\n"); |
228 |
|
return 1; |
229 |
|
} |
230 |
|
printf("{ <%p> }\n", pBufferFill); |
231 |
|
return 0; |
232 |
|
} |
233 |
|
|
234 |
|
//////////////////////////////////////////////////////////////////////// |
235 |
|
|
236 |
|
static int g_test_step = 0; |
237 |
|
static int g_test_count = 0; |
238 |
|
static int g_test_fails = 0; |
239 |
|
|
240 |
|
|
241 |
void client_test_start ( clock_t *pclk ) { *pclk = clock(); } |
void client_test_start ( clock_t *pclk ) { *pclk = clock(); } |
242 |
float client_test_elapsed ( clock_t *pclk ) { return (float) ((long) clock() - *pclk) / (float) CLOCKS_PER_SEC; } |
float client_test_elapsed ( clock_t *pclk ) { return (float) ((long) clock() - *pclk) / (float) CLOCKS_PER_SEC; } |
243 |
|
|
244 |
#define CLIENT_TEST(p, x) { clock_t c; void *v;\ |
typedef int * isplit; |
245 |
printf(#x ":\n"); client_test_start(&c); v = (void *) (x); \ |
typedef char ** szsplit; |
246 |
printf(" elapsed=%gs\n", client_test_elapsed(&c)); \ |
typedef lscp_status_t status; |
247 |
printf(" ret=%p (%d)\n", v, (int) v); \ |
typedef lscp_driver_info_t * driver_info; |
248 |
printf(" errno=%d\n", lscp_client_get_errno(p)); \ |
typedef lscp_device_info_t * device_info; |
249 |
printf(" result=\"%s\"\n", lscp_client_get_result(p)); } |
typedef lscp_device_port_info_t * device_port_info; |
250 |
|
typedef lscp_param_info_t * param_info; |
251 |
|
typedef lscp_engine_info_t * engine_info; |
252 |
|
typedef lscp_channel_info_t * channel_info; |
253 |
|
typedef lscp_buffer_fill_t * buffer_fill; |
254 |
|
|
255 |
|
#define CLIENT_TEST(p, t, x) { clock_t c; void *v; g_test_count++; \ |
256 |
|
printf("\n" #x ":\n"); client_test_start(&c); v = (void *) (x); \ |
257 |
|
printf(" elapsed=%gs errno=%d result='%s...' ret=", \ |
258 |
|
client_test_elapsed(&c), \ |
259 |
|
lscp_client_get_errno(p), \ |
260 |
|
lscp_client_get_result(p)); \ |
261 |
|
if (client_test_##t((t)(v))) { g_test_fails++; getchar(); } \ |
262 |
|
else if (g_test_step) getchar(); } |
263 |
|
|
264 |
|
|
265 |
void client_test ( lscp_client_t *pClient ) |
void client_test ( lscp_client_t *pClient ) |
266 |
{ |
{ |
267 |
const char **ppszAudioDrivers, **ppszMidiDrivers, **ppszEngines; |
const char **ppszAudioDrivers, **ppszMidiDrivers, **ppszEngines; |
268 |
const char *pszAudioDriver, *pszMidiDriver, *pszEngine; |
const char *pszAudioDriver, *pszMidiDriver, *pszEngine; |
269 |
int iAudioDriver, iMidiDriver, iEngine; |
int iAudioDriver, iMidiDriver, iEngine; |
270 |
|
int iAudioDevice, iMidiDevice; |
271 |
int iSamplerChannel; |
int iSamplerChannel; |
272 |
|
|
273 |
CLIENT_TEST(pClient, ppszAudioDrivers = lscp_get_available_audio_drivers(pClient)); |
g_test_count = 0; |
274 |
|
g_test_fails = 0; |
275 |
|
|
276 |
|
CLIENT_TEST(pClient, szsplit, ppszAudioDrivers = lscp_get_available_audio_drivers(pClient)); |
277 |
if (ppszAudioDrivers == NULL) { |
if (ppszAudioDrivers == NULL) { |
278 |
fprintf(stderr, "client_test: No audio drivers available.\n"); |
fprintf(stderr, "client_test: No audio drivers available.\n"); |
279 |
return; |
return; |
280 |
} |
} |
281 |
|
|
282 |
CLIENT_TEST(pClient, ppszMidiDrivers = lscp_get_available_midi_drivers(pClient)); |
CLIENT_TEST(pClient, szsplit, ppszMidiDrivers = lscp_get_available_midi_drivers(pClient)); |
283 |
if (ppszMidiDrivers == NULL) { |
if (ppszMidiDrivers == NULL) { |
284 |
fprintf(stderr, "client_test: No MIDI drivers available.\n"); |
fprintf(stderr, "client_test: No MIDI drivers available.\n"); |
285 |
return; |
return; |
286 |
} |
} |
287 |
|
|
288 |
CLIENT_TEST(pClient, ppszEngines = lscp_get_available_engines(pClient)); |
CLIENT_TEST(pClient, szsplit, ppszEngines = lscp_get_available_engines(pClient)); |
289 |
if (ppszEngines == NULL) { |
if (ppszEngines == NULL) { |
290 |
fprintf(stderr, "client_test: No engines available.\n"); |
fprintf(stderr, "client_test: No engines available.\n"); |
291 |
return; |
return; |
292 |
} |
} |
293 |
|
|
294 |
CLIENT_TEST(pClient, lscp_get_audio_devices(pClient)); |
CLIENT_TEST(pClient, int, lscp_get_audio_devices(pClient)); |
295 |
CLIENT_TEST(pClient, lscp_list_audio_devices(pClient)); |
CLIENT_TEST(pClient, isplit, lscp_list_audio_devices(pClient)); |
296 |
|
|
297 |
CLIENT_TEST(pClient, lscp_get_midi_devices(pClient)); |
CLIENT_TEST(pClient, int, lscp_get_midi_devices(pClient)); |
298 |
CLIENT_TEST(pClient, lscp_list_midi_devices(pClient)); |
CLIENT_TEST(pClient, isplit, lscp_list_midi_devices(pClient)); |
299 |
|
|
300 |
for (iAudioDriver = 0; ppszAudioDrivers[iAudioDriver]; iAudioDriver++) { |
for (iAudioDriver = 0; ppszAudioDrivers[iAudioDriver]; iAudioDriver++) { |
301 |
pszAudioDriver = ppszAudioDrivers[iAudioDriver]; |
pszAudioDriver = ppszAudioDrivers[iAudioDriver]; |
302 |
printf("\n--- pszAudioDriver=\"%s\" ---\n", pszAudioDriver); |
printf("\n--- pszAudioDriver=\"%s\" ---\n", pszAudioDriver); |
303 |
CLIENT_TEST(pClient, lscp_get_audio_driver_info(pClient, pszAudioDriver)); |
CLIENT_TEST(pClient, driver_info, lscp_get_audio_driver_info(pClient, pszAudioDriver)); |
304 |
|
CLIENT_TEST(pClient, param_info, lscp_get_audio_driver_param_info(pClient, pszAudioDriver, "active", NULL)); |
305 |
|
CLIENT_TEST(pClient, int, iAudioDevice = lscp_create_audio_device(pClient, pszAudioDriver, NULL)); |
306 |
|
CLIENT_TEST(pClient, device_info, lscp_get_audio_device_info(pClient, iAudioDevice)); |
307 |
for (iMidiDriver = 0; ppszMidiDrivers[iMidiDriver]; iMidiDriver++) { |
for (iMidiDriver = 0; ppszMidiDrivers[iMidiDriver]; iMidiDriver++) { |
308 |
pszMidiDriver = ppszMidiDrivers[iMidiDriver]; |
pszMidiDriver = ppszMidiDrivers[iMidiDriver]; |
309 |
printf("\n--- pszMidiDriver=\"%s\" ---\n", pszMidiDriver); |
printf("\n--- pszMidiDriver=\"%s\" ---\n", pszMidiDriver); |
310 |
CLIENT_TEST(pClient, lscp_get_midi_driver_info(pClient, pszMidiDriver)); |
CLIENT_TEST(pClient, driver_info, lscp_get_midi_driver_info(pClient, pszMidiDriver)); |
311 |
|
CLIENT_TEST(pClient, param_info, lscp_get_midi_driver_param_info(pClient, pszMidiDriver, "active", NULL)); |
312 |
|
CLIENT_TEST(pClient, int, iMidiDevice = lscp_create_midi_device(pClient, pszMidiDriver, NULL)); |
313 |
|
CLIENT_TEST(pClient, device_info, lscp_get_midi_device_info(pClient, iMidiDevice)); |
314 |
for (iEngine = 0; ppszEngines[iEngine]; iEngine++) { |
for (iEngine = 0; ppszEngines[iEngine]; iEngine++) { |
315 |
pszEngine = ppszEngines[iEngine]; |
pszEngine = ppszEngines[iEngine]; |
316 |
printf("\n--- pszEngine=\"%s\" ---\n", pszEngine); |
printf("\n--- pszEngine=\"%s\" ---\n", pszEngine); |
317 |
CLIENT_TEST(pClient, lscp_get_engine_info(pClient, pszEngine)); |
CLIENT_TEST(pClient, engine_info, lscp_get_engine_info(pClient, pszEngine)); |
318 |
CLIENT_TEST(pClient, lscp_get_channels(pClient)); |
CLIENT_TEST(pClient, int, lscp_get_channels(pClient)); |
319 |
CLIENT_TEST(pClient, lscp_list_channels(pClient)); |
CLIENT_TEST(pClient, isplit, lscp_list_channels(pClient)); |
320 |
CLIENT_TEST(pClient, iSamplerChannel = lscp_add_channel(pClient)); |
CLIENT_TEST(pClient, int, iSamplerChannel = lscp_add_channel(pClient)); |
321 |
printf(">>> iSamplerChannel=\"%d\"\n", iSamplerChannel); |
CLIENT_TEST(pClient, channel_info, lscp_get_channel_info(pClient, iSamplerChannel)); |
322 |
CLIENT_TEST(pClient, lscp_get_channel_info(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, status, lscp_load_engine(pClient, pszEngine, iSamplerChannel)); |
323 |
CLIENT_TEST(pClient, lscp_load_engine(pClient, pszEngine, iSamplerChannel)); |
CLIENT_TEST(pClient, status, lscp_load_instrument(pClient, "DefaultInstrument.gig", 0, iSamplerChannel)); |
324 |
CLIENT_TEST(pClient, lscp_load_instrument(pClient, "DefaultInstrument.gig", 0, iSamplerChannel)); |
CLIENT_TEST(pClient, int, lscp_get_channel_voice_count(pClient, iSamplerChannel)); |
325 |
CLIENT_TEST(pClient, lscp_get_channel_voice_count(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, int, lscp_get_channel_stream_count(pClient, iSamplerChannel)); |
326 |
CLIENT_TEST(pClient, lscp_get_channel_stream_count(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, int, lscp_get_channel_stream_usage(pClient, iSamplerChannel)); |
327 |
CLIENT_TEST(pClient, lscp_get_channel_buffer_fill(pClient, LSCP_USAGE_BYTES, iSamplerChannel)); |
CLIENT_TEST(pClient, buffer_fill, lscp_get_channel_buffer_fill(pClient, LSCP_USAGE_BYTES, iSamplerChannel)); |
328 |
CLIENT_TEST(pClient, lscp_get_channel_buffer_fill(pClient, LSCP_USAGE_PERCENTAGE, iSamplerChannel)); |
CLIENT_TEST(pClient, buffer_fill, lscp_get_channel_buffer_fill(pClient, LSCP_USAGE_PERCENTAGE, iSamplerChannel)); |
329 |
CLIENT_TEST(pClient, lscp_set_channel_audio_type(pClient, iSamplerChannel, pszAudioDriver)); |
CLIENT_TEST(pClient, status, lscp_set_channel_audio_type(pClient, iSamplerChannel, pszAudioDriver)); |
330 |
CLIENT_TEST(pClient, lscp_set_channel_audio_device(pClient, iSamplerChannel, 0)); |
CLIENT_TEST(pClient, status, lscp_set_channel_audio_device(pClient, iSamplerChannel, 0)); |
331 |
CLIENT_TEST(pClient, lscp_set_channel_audio_channel(pClient, iSamplerChannel, 0, 1)); |
CLIENT_TEST(pClient, status, lscp_set_channel_audio_channel(pClient, iSamplerChannel, 0, 1)); |
332 |
CLIENT_TEST(pClient, lscp_set_channel_midi_type(pClient, iSamplerChannel, pszMidiDriver)); |
CLIENT_TEST(pClient, status, lscp_set_channel_midi_type(pClient, iSamplerChannel, pszMidiDriver)); |
333 |
CLIENT_TEST(pClient, lscp_set_channel_midi_device(pClient, iSamplerChannel, 0)); |
CLIENT_TEST(pClient, status, lscp_set_channel_midi_device(pClient, iSamplerChannel, 0)); |
334 |
CLIENT_TEST(pClient, lscp_set_channel_midi_channel(pClient, iSamplerChannel, 0)); |
CLIENT_TEST(pClient, status, lscp_set_channel_midi_channel(pClient, iSamplerChannel, 0)); |
335 |
CLIENT_TEST(pClient, lscp_set_channel_midi_port(pClient, iSamplerChannel, 0)); |
CLIENT_TEST(pClient, status, lscp_set_channel_midi_port(pClient, iSamplerChannel, 0)); |
336 |
CLIENT_TEST(pClient, lscp_set_channel_volume(pClient, iSamplerChannel, 0.5)); |
CLIENT_TEST(pClient, status, lscp_set_channel_volume(pClient, iSamplerChannel, 0.5)); |
337 |
CLIENT_TEST(pClient, lscp_get_channel_info(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, channel_info, lscp_get_channel_info(pClient, iSamplerChannel)); |
338 |
CLIENT_TEST(pClient, lscp_reset_channel(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, status, lscp_reset_channel(pClient, iSamplerChannel)); |
339 |
CLIENT_TEST(pClient, lscp_remove_channel(pClient, iSamplerChannel)); |
CLIENT_TEST(pClient, status, lscp_remove_channel(pClient, iSamplerChannel)); |
|
printf("\n"); |
|
340 |
} |
} |
341 |
|
CLIENT_TEST(pClient, status, lscp_destroy_midi_device(pClient, iMidiDevice)); |
342 |
} |
} |
343 |
|
CLIENT_TEST(pClient, status, lscp_destroy_audio_device(pClient, iAudioDevice)); |
344 |
} |
} |
345 |
|
printf("\n"); |
346 |
|
printf(" Total: %d tests, %d failed.\n\n", g_test_count, g_test_fails); |
347 |
} |
} |
348 |
|
|
349 |
//////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////// |
352 |
{ |
{ |
353 |
printf("\n %s %s (Build: %s)\n", lscp_client_package(), lscp_client_version(), lscp_client_build()); |
printf("\n %s %s (Build: %s)\n", lscp_client_package(), lscp_client_version(), lscp_client_build()); |
354 |
|
|
355 |
fputs("\n Available client commands: help, test, exit, quit, subscribe, unsubscribe", stdout); |
fputs("\n Available commands: help, test[step], exit, quit, subscribe, unsubscribe", stdout); |
356 |
fputs("\n (all else are sent verbatim to server)\n\n", stdout); |
fputs("\n (all else are sent verbatim to server)\n\n", stdout); |
357 |
|
|
358 |
} |
} |
406 |
if (strcmp(szLine, "test") == 0) |
if (strcmp(szLine, "test") == 0) |
407 |
client_test(pClient); |
client_test(pClient); |
408 |
else |
else |
409 |
|
if (strcmp(szLine, "teststep") == 0 || strcmp(szLine, "test step") == 0) { |
410 |
|
g_test_step = 1; |
411 |
|
client_test(pClient); |
412 |
|
g_test_step = 0; |
413 |
|
} |
414 |
|
else |
415 |
if (cchLine > 0 && strcmp(szLine, "help") != 0) { |
if (cchLine > 0 && strcmp(szLine, "help") != 0) { |
416 |
szLine[cchLine++] = '\r'; |
szLine[cchLine++] = '\r'; |
417 |
szLine[cchLine++] = '\n'; |
szLine[cchLine++] = '\n'; |