mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Implement AudioBackend::driver_name() in PortaudioBackend
This was missing and is necessary for EngineControl dialog to work properly
This commit is contained in:
parent
6a0e46352c
commit
fe50d06876
4 changed files with 27 additions and 7 deletions
|
|
@ -128,10 +128,22 @@ PortAudioBackend::enumerate_drivers () const
|
||||||
int
|
int
|
||||||
PortAudioBackend::set_driver (const std::string& name)
|
PortAudioBackend::set_driver (const std::string& name)
|
||||||
{
|
{
|
||||||
_pcmio->set_host_api (name);
|
DEBUG_AUDIO (string_compose ("Portaudio: set_driver %1 \n", name));
|
||||||
|
if (!_pcmio->set_host_api (name)) {
|
||||||
|
DEBUG_AUDIO (string_compose ("Portaudio: Unable to set_driver %1 \n", name));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
PortAudioBackend::driver_name () const
|
||||||
|
{
|
||||||
|
std::string driver_name = _pcmio->get_host_api ();
|
||||||
|
DEBUG_AUDIO (string_compose ("Portaudio: driver_name %1 \n", driver_name));
|
||||||
|
return driver_name;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PortAudioBackend::use_separate_input_and_output_devices () const
|
PortAudioBackend::use_separate_input_and_output_devices () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ class PortAudioBackend : public AudioBackend {
|
||||||
bool is_realtime () const;
|
bool is_realtime () const;
|
||||||
|
|
||||||
bool requires_driver_selection() const;
|
bool requires_driver_selection() const;
|
||||||
|
std::string driver_name () const;
|
||||||
std::vector<std::string> enumerate_drivers () const;
|
std::vector<std::string> enumerate_drivers () const;
|
||||||
int set_driver (const std::string&);
|
int set_driver (const std::string&);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ PortAudioIO::PortAudioIO ()
|
||||||
, _cur_sample_rate (0)
|
, _cur_sample_rate (0)
|
||||||
, _cur_input_latency (0)
|
, _cur_input_latency (0)
|
||||||
, _cur_output_latency (0)
|
, _cur_output_latency (0)
|
||||||
|
, _host_api_index(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,14 +181,18 @@ PortAudioIO::host_api_list (std::vector<std::string>& api_list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
PortAudioIO::set_host_api (const std::string& host_api_name)
|
PortAudioIO::set_host_api (const std::string& host_api_name)
|
||||||
{
|
{
|
||||||
_host_api_index = get_host_api_index_from_name (host_api_name);
|
PaHostApiIndex new_index = get_host_api_index_from_name (host_api_name);
|
||||||
|
|
||||||
if (_host_api_index < 0) {
|
if (new_index < 0) {
|
||||||
DEBUG_AUDIO ("Error setting host API\n");
|
DEBUG_AUDIO ("Portaudio: Error setting host API\n");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
_host_api_index = new_index;
|
||||||
|
_host_api_name = host_api_name;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PaHostApiIndex
|
PaHostApiIndex
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,9 @@ public:
|
||||||
|
|
||||||
bool initialize_pa ();
|
bool initialize_pa ();
|
||||||
|
|
||||||
void host_api_list (std::vector<std::string>&);
|
void host_api_list (std::vector<std::string>&);
|
||||||
void set_host_api (const std::string& host_api_name);
|
bool set_host_api (const std::string& host_api_name);
|
||||||
|
std::string get_host_api () const { return _host_api_name; }
|
||||||
PaHostApiIndex get_host_api_index_from_name (const std::string& name);
|
PaHostApiIndex get_host_api_index_from_name (const std::string& name);
|
||||||
|
|
||||||
PaDeviceIndex get_default_input_device ();
|
PaDeviceIndex get_default_input_device ();
|
||||||
|
|
@ -114,6 +115,7 @@ private: // Data
|
||||||
std::map<int, paDevice *> _output_devices;
|
std::map<int, paDevice *> _output_devices;
|
||||||
|
|
||||||
PaHostApiIndex _host_api_index;
|
PaHostApiIndex _host_api_index;
|
||||||
|
std::string _host_api_name;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue