diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-01-24 22:05:20 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-01-25 09:23:08 -0700 |
commit | 1be3301342c74fdbb92febcbc85e8d60fb09de0e (patch) | |
tree | 4fbdc594951ed02e89c0b47e10ccaae75e9b69fd /libs/ardour/globals.cc | |
parent | c01ab83e1f13f6d56a2e8ec13e9d26683dc9bb25 (diff) |
new approach to handling Transport Masters when engine is restarted
Trust that ::reset() works for all transport masters, and call it when engine is stopped. This way
the transport masters are ready to be called again as soon as the engine restarts.
Diffstat (limited to 'libs/ardour/globals.cc')
-rw-r--r-- | libs/ardour/globals.cc | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index b40db9466c..665277388a 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -561,7 +561,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir ARDOUR::AudioEngine::create (); - /* This will run only once in whatever thread calls AudioEngine::start() */ + /* This will run in whatever thread calls AudioEngine::start() */ ARDOUR::AudioEngine::instance()->Running.connect_same_thread (engine_startup_connection, ARDOUR::init_post_engine); /* it is unfortunate that we need to include reserved names here that @@ -599,39 +599,30 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir } void -ARDOUR::init_post_engine (uint32_t /* ignored */) +ARDOUR::init_post_engine (uint32_t start_cnt) { XMLNode* node; - if ((node = Config->control_protocol_state()) != 0) { - ControlProtocolManager::instance().set_state (*node, 0 /* here: global-config state */); - } + std::cerr << "Engine stated, libardour inits, cnt = " << start_cnt << std::endl; - if ((node = Config->transport_master_state()) != 0) { - if (TransportMasterManager::instance().set_state (*node, Stateful::loading_state_version)) { - error << _("Cannot restore transport master manager") << endmsg; - /* XXX now what? */ - } - } else { - if (TransportMasterManager::instance().set_default_configuration ()) { - error << _("Cannot initialize transport master manager") << endmsg; - /* XXX now what? */ - } - } + if (start_cnt == 0) { - /* find plugins */ + /* find plugins */ - ARDOUR::PluginManager::instance().refresh (!Config->get_discover_vst_on_start()); + ARDOUR::PluginManager::instance().refresh (!Config->get_discover_vst_on_start()); + } - /* Don't do this again - we are only meant to execute on the first - * engine start, not any subsequence starts - */ + if ((node = Config->control_protocol_state()) != 0) { + ControlProtocolManager::instance().set_state (*node, 0 /* here: global-config state */); + } - engine_startup_connection.disconnect (); + if (start_cnt == 0) { + TransportMasterManager::instance().restart (); + } } void - ARDOUR::cleanup () +ARDOUR::cleanup () { if (!libardour_initialized) { return; |