201 |
|
|
202 |
|
|
203 |
/** |
/** |
204 |
* Getting all created audio output devices. |
* Getting all created audio output device count. |
205 |
* GET AUDIO_OUTPUT_DEVICES |
* GET AUDIO_OUTPUT_DEVICES |
206 |
* |
* |
207 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
208 |
* |
* |
209 |
|
* @returns The current total number of audio devices on success, |
210 |
|
* -1 otherwise. |
211 |
|
*/ |
212 |
|
int lscp_get_audio_devices ( lscp_client_t *pClient ) |
213 |
|
{ |
214 |
|
int iAudioDevices = -1; |
215 |
|
if (lscp_client_query(pClient, "GET AUDIO_OUTPUT_DEVICES\r\n") == LSCP_OK) |
216 |
|
iAudioDevices = atoi(lscp_client_get_result(pClient)); |
217 |
|
return iAudioDevices; |
218 |
|
} |
219 |
|
|
220 |
|
|
221 |
|
/** |
222 |
|
* Getting all created audio output device list. |
223 |
|
* LIST AUDIO_OUTPUT_DEVICES |
224 |
|
* |
225 |
|
* @param pClient Pointer to client instance structure. |
226 |
|
* |
227 |
* @returns An array of audio device number identifiers, |
* @returns An array of audio device number identifiers, |
228 |
* terminated with -1 on success, or NULL in case of failure. |
* terminated with -1 on success, or NULL in case of failure. |
229 |
*/ |
*/ |
230 |
int *lscp_get_audio_devices ( lscp_client_t *pClient ) |
int *lscp_list_audio_devices ( lscp_client_t *pClient ) |
231 |
{ |
{ |
232 |
int *piAudioDevices = NULL; |
const char *pszSeps = ","; |
233 |
|
|
234 |
if (pClient == NULL) |
if (pClient == NULL) |
235 |
return NULL; |
return NULL; |
236 |
|
|
237 |
return piAudioDevices; |
if (pClient->audio_devices) { |
238 |
|
lscp_isplit_destroy(pClient->audio_devices); |
239 |
|
pClient->audio_devices = NULL; |
240 |
|
} |
241 |
|
|
242 |
|
if (lscp_client_query(pClient, "LIST AUDIO_OUTPUT_DEVICES\r\n") == LSCP_OK) |
243 |
|
pClient->audio_devices = lscp_isplit_create(lscp_client_get_result(pClient), pszSeps); |
244 |
|
|
245 |
|
return pClient->audio_devices; |
246 |
} |
} |
247 |
|
|
248 |
|
|
510 |
|
|
511 |
|
|
512 |
/** |
/** |
513 |
* Getting all created MIDI input devices. |
* Getting all created MIDI intput device count. |
514 |
* GET MIDI_INPUT_DEVICES |
* GET MIDI_INPUT_DEVICES |
515 |
* |
* |
516 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
517 |
* |
* |
518 |
|
* @returns The current total number of MIDI devices on success, |
519 |
|
* -1 otherwise. |
520 |
|
*/ |
521 |
|
int lscp_get_midi_devices ( lscp_client_t *pClient ) |
522 |
|
{ |
523 |
|
int iMidiDevices = -1; |
524 |
|
if (lscp_client_query(pClient, "GET MIDI_INPUT_DEVICES\r\n") == LSCP_OK) |
525 |
|
iMidiDevices = atoi(lscp_client_get_result(pClient)); |
526 |
|
return iMidiDevices; |
527 |
|
} |
528 |
|
|
529 |
|
|
530 |
|
/** |
531 |
|
* Getting all created MIDI intput device list. |
532 |
|
* LIST MIDI_INPUT_DEVICES |
533 |
|
* |
534 |
|
* @param pClient Pointer to client instance structure. |
535 |
|
* |
536 |
* @returns An array of MIDI device number identifiers, |
* @returns An array of MIDI device number identifiers, |
537 |
* terminated with -1 on success, or NULL in case of failure. |
* terminated with -1 on success, or NULL in case of failure. |
538 |
*/ |
*/ |
539 |
int *lscp_get_midi_devices ( lscp_client_t *pClient ) |
int *lscp_list_midi_devices ( lscp_client_t *pClient ) |
540 |
{ |
{ |
541 |
int *piMidiDevices = NULL; |
const char *pszSeps = ","; |
542 |
|
|
543 |
if (pClient == NULL) |
if (pClient == NULL) |
544 |
return NULL; |
return NULL; |
545 |
|
|
546 |
return piMidiDevices; |
if (pClient->midi_devices) { |
547 |
|
lscp_isplit_destroy(pClient->midi_devices); |
548 |
|
pClient->midi_devices = NULL; |
549 |
|
} |
550 |
|
|
551 |
|
if (lscp_client_query(pClient, "LIST MIDI_INPUT_DEVICES\r\n") == LSCP_OK) |
552 |
|
pClient->midi_devices = lscp_isplit_create(lscp_client_get_result(pClient), pszSeps); |
553 |
|
|
554 |
|
return pClient->midi_devices; |
555 |
} |
} |
556 |
|
|
557 |
|
|