--- liblscp/trunk/src/device.c 2005/05/08 23:37:47 522 +++ liblscp/trunk/src/device.c 2005/05/09 10:17:12 523 @@ -263,15 +263,41 @@ // Audio driver control functions. /** - * Getting all available audio output drivers. + * Getting all available audio output driver count. * GET AVAILABLE_AUDIO_OUTPUT_DRIVERS * * @param pClient Pointer to client instance structure. * + * @returns The current total number of audio output drivers on success, + * -1 otherwise. + */ +int lscp_get_available_audio_drivers ( lscp_client_t *pClient ) +{ + int iAudioDrivers = -1; + + // Lock this section up. + lscp_mutex_lock(pClient->mutex); + + if (lscp_client_call(pClient, "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n") == LSCP_OK) + iAudioDrivers = atoi(lscp_client_get_result(pClient)); + + // Unlock this section down. + lscp_mutex_unlock(pClient->mutex); + + return iAudioDrivers; +} + + +/** + * Getting all available audio output drivers. + * LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS + * + * @param pClient Pointer to client instance structure. + * * @returns A NULL terminated array of audio output driver type * name strings, or NULL in case of failure. */ -const char ** lscp_get_available_audio_drivers ( lscp_client_t *pClient ) +const char ** lscp_list_available_audio_drivers ( lscp_client_t *pClient ) { const char *pszSeps = ","; @@ -283,7 +309,7 @@ pClient->audio_drivers = NULL; } - if (lscp_client_call(pClient, "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n") == LSCP_OK) + if (lscp_client_call(pClient, "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n") == LSCP_OK) pClient->audio_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps); // Unlock this section down. @@ -606,15 +632,41 @@ // MIDI driver control functions. /** - * Getting all available MIDI input drivers. + * Getting all available MIDI input driver count. * GET AVAILABLE_MIDI_INPUT_DRIVERS * * @param pClient Pointer to client instance structure. * + * @returns The current total number of MIDI input drivers on success, + * -1 otherwise. + */ +int lscp_get_available_midi_drivers ( lscp_client_t *pClient ) +{ + int iMidiDrivers = -1; + + // Lock this section up. + lscp_mutex_lock(pClient->mutex); + + if (lscp_client_call(pClient, "GET AVAILABLE_MIDI_INPUT_DRIVERS\r\n") == LSCP_OK) + iMidiDrivers = atoi(lscp_client_get_result(pClient)); + + // Unlock this section up. + lscp_mutex_unlock(pClient->mutex); + + return iMidiDrivers; +} + + +/** + * Getting all available MIDI input drivers. + * LIST AVAILABLE_MIDI_INPUT_DRIVERS + * + * @param pClient Pointer to client instance structure. + * * @returns A NULL terminated array of MIDI input driver type * name strings, or NULL in case of failure. */ -const char** lscp_get_available_midi_drivers ( lscp_client_t *pClient ) +const char** lscp_list_available_midi_drivers ( lscp_client_t *pClient ) { const char *pszSeps = ","; @@ -626,7 +678,7 @@ pClient->midi_drivers = NULL; } - if (lscp_client_call(pClient, "GET AVAILABLE_MIDI_INPUT_DRIVERS\r\n") == LSCP_OK) + if (lscp_client_call(pClient, "LIST AVAILABLE_MIDI_INPUT_DRIVERS\r\n") == LSCP_OK) pClient->midi_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps); // Unlock this section up.