Compare the string returned by backend->driver_name() against driver names in EngineControl
Don't assume an empty string has any meaning and compare string returned with enumerated drivers
This commit is contained in:
parent
e20d74079a
commit
495dd2e52a
@ -915,21 +915,18 @@ EngineControl::set_driver_popdown_strings ()
|
||||
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
|
||||
vector<string> drivers = backend->enumerate_drivers();
|
||||
|
||||
if (drivers.empty()) {
|
||||
if (drivers.empty ()) {
|
||||
// This is an error...?
|
||||
return false;
|
||||
}
|
||||
|
||||
string current_driver;
|
||||
current_driver = backend->driver_name ();
|
||||
string current_driver = backend->driver_name ();
|
||||
|
||||
DEBUG_ECONTROL (string_compose ("backend->driver_name: %1", current_driver));
|
||||
|
||||
// driver might not have been set yet
|
||||
if (current_driver == "") {
|
||||
current_driver = driver_combo.get_active_text ();
|
||||
if (current_driver == "")
|
||||
// driver has never been set, make sure it's not blank
|
||||
if (std::find (drivers.begin (), drivers.end (), current_driver) ==
|
||||
drivers.end ()) {
|
||||
|
||||
current_driver = drivers.front ();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user