restore last used driver+devices for a given backend.
This commit is contained in:
parent
3c9b71b50e
commit
b754c4341e
|
@ -1021,6 +1021,15 @@ EngineControl::backend_changed ()
|
|||
set_active_text_if_present (buffer_size_combo, bufsize_as_string (backend->buffer_size()));
|
||||
}
|
||||
|
||||
if (_have_control && !ignore_changes) {
|
||||
// set driver & devices
|
||||
State state = get_matching_state (backend_combo.get_active_text());
|
||||
if (state) {
|
||||
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
|
||||
set_current_state (state);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignore_changes) {
|
||||
maybe_display_saved_state ();
|
||||
}
|
||||
|
@ -1270,6 +1279,8 @@ EngineControl::driver_changed ()
|
|||
backend->set_driver (driver_combo.get_active_text());
|
||||
list_devices ();
|
||||
|
||||
// TODO load LRU device(s) for backend + driver combo
|
||||
|
||||
if (!ignore_changes) {
|
||||
maybe_display_saved_state ();
|
||||
}
|
||||
|
@ -1615,6 +1626,19 @@ EngineControl::parameter_changed ()
|
|||
{
|
||||
}
|
||||
|
||||
EngineControl::State
|
||||
EngineControl::get_matching_state (const string& backend)
|
||||
{
|
||||
for (StateList::iterator i = states.begin(); i != states.end(); ++i) {
|
||||
// TODO use LRU for every backend and prefer the active one
|
||||
// uniqueness is only guaranteed for backend + driver + device(s)
|
||||
if ((*i)->backend == backend) {
|
||||
return (*i);
|
||||
}
|
||||
}
|
||||
return State();
|
||||
}
|
||||
|
||||
EngineControl::State
|
||||
EngineControl::get_matching_state (
|
||||
const string& backend,
|
||||
|
|
|
@ -234,6 +234,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
|
||||
StateList states;
|
||||
|
||||
State get_matching_state (const std::string& backend);
|
||||
State get_matching_state (const std::string& backend,
|
||||
const std::string& driver,
|
||||
const std::string& device);
|
||||
|
|
Loading…
Reference in New Issue
Block a user