mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
possible fix for #6187 - assert(backend)
This commit is contained in:
parent
03229f4fe9
commit
411c3ee70a
1 changed files with 17 additions and 5 deletions
|
|
@ -95,7 +95,7 @@ EngineControl::EngineControl ()
|
||||||
, started_at_least_once (false)
|
, started_at_least_once (false)
|
||||||
{
|
{
|
||||||
using namespace Notebook_Helpers;
|
using namespace Notebook_Helpers;
|
||||||
vector<string> strings;
|
vector<string> backend_names;
|
||||||
Label* label;
|
Label* label;
|
||||||
AttachOptions xopt = AttachOptions (FILL|EXPAND);
|
AttachOptions xopt = AttachOptions (FILL|EXPAND);
|
||||||
int row;
|
int row;
|
||||||
|
|
@ -113,10 +113,10 @@ EngineControl::EngineControl ()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vector<const ARDOUR::AudioBackendInfo*>::const_iterator b = backends.begin(); b != backends.end(); ++b) {
|
for (vector<const ARDOUR::AudioBackendInfo*>::const_iterator b = backends.begin(); b != backends.end(); ++b) {
|
||||||
strings.push_back ((*b)->name);
|
backend_names.push_back ((*b)->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_popdown_strings (backend_combo, strings);
|
set_popdown_strings (backend_combo, backend_names);
|
||||||
backend_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::backend_changed));
|
backend_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::backend_changed));
|
||||||
|
|
||||||
/* setup basic packing characteristics for the table used on the main
|
/* setup basic packing characteristics for the table used on the main
|
||||||
|
|
@ -280,8 +280,10 @@ EngineControl::EngineControl ()
|
||||||
|
|
||||||
if (audio_setup) {
|
if (audio_setup) {
|
||||||
set_state (*audio_setup);
|
set_state (*audio_setup);
|
||||||
} else {
|
}
|
||||||
backend_combo.set_active_text (strings.front());
|
|
||||||
|
if (backend_combo.get_active_text().empty()) {
|
||||||
|
backend_combo.set_active_text (backend_names.front());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -290,6 +292,15 @@ EngineControl::EngineControl ()
|
||||||
backend_changed ();
|
backend_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* in case the setting the backend failed, e.g. stale config, from set_state(), try again */
|
||||||
|
if (0 == ARDOUR::AudioEngine::instance()->current_backend()) {
|
||||||
|
backend_combo.set_active_text (backend_names.back());
|
||||||
|
/* ignore: don't save state */
|
||||||
|
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
|
||||||
|
backend_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Connect to signals */
|
/* Connect to signals */
|
||||||
|
|
||||||
driver_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::driver_changed));
|
driver_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::driver_changed));
|
||||||
|
|
@ -709,6 +720,7 @@ EngineControl::backend_changed ()
|
||||||
|
|
||||||
if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, "ardour", ""))) {
|
if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, "ardour", ""))) {
|
||||||
/* eh? setting the backend failed... how ? */
|
/* eh? setting the backend failed... how ? */
|
||||||
|
/* A: stale config contains a backend that does not exist in current build */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue