Add Utility function to get host API type in PortaudioIO class
This commit is contained in:
@@ -348,6 +348,21 @@ PortAudioIO::host_api_list (std::vector<std::string>& api_list)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PaHostApiTypeId
|
||||
PortAudioIO::get_current_host_api_type () const
|
||||
{
|
||||
const PaHostApiInfo* info = Pa_GetHostApiInfo (_host_api_index);
|
||||
|
||||
if (info == NULL) {
|
||||
DEBUG_AUDIO(string_compose(
|
||||
"Unable to determine Host API type from index %1\n", _host_api_index));
|
||||
return (PaHostApiTypeId)0;
|
||||
}
|
||||
|
||||
return info->type;
|
||||
}
|
||||
|
||||
std::string
|
||||
PortAudioIO::get_host_api_name_from_index (PaHostApiIndex index)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
void host_api_list (std::vector<std::string>&);
|
||||
bool set_host_api (const std::string& host_api_name);
|
||||
std::string get_host_api () const { return _host_api_name; }
|
||||
PaHostApiTypeId get_current_host_api_type () const;
|
||||
PaHostApiIndex get_host_api_index_from_name (const std::string& name);
|
||||
|
||||
PaDeviceIndex get_default_input_device ();
|
||||
|
||||
Reference in New Issue
Block a user