diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 9843fb71db..8b025f1c3a 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -287,7 +287,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , _was_dirty (false) , _mixer_on_top (false) , _initial_verbose_plugin_scan (false) - , first_time_engine_run (true) , secondary_clock_spacer (0) , auto_input_button (ArdourButton::led_default_elements) , time_info_box (0) @@ -567,7 +566,7 @@ ARDOUR_UI::create_global_port_matrix (ARDOUR::DataType type) void ARDOUR_UI::attach_to_engine () { - AudioEngine::instance()->Running.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_running, this), gui_context()); + AudioEngine::instance()->Running.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_running, this, _1), gui_context()); ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports); } @@ -582,12 +581,10 @@ ARDOUR_UI::engine_stopped () } void -ARDOUR_UI::engine_running () +ARDOUR_UI::engine_running (uint32_t cnt) { - ENSURE_GUI_THREAD (*this, &ARDOUR_UI::engine_running) - if (first_time_engine_run) { + if (cnt == 0) { post_engine(); - first_time_engine_run = false; } if (_session) { @@ -659,8 +656,6 @@ ARDOUR_UI::post_engine () } #endif - ARDOUR::init_post_engine (); - /* connect to important signals */ AudioEngine::instance()->Stopped.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context()); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index d5fa18da73..db6b30fd60 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -400,7 +400,6 @@ private: bool _was_dirty; bool _mixer_on_top; bool _initial_verbose_plugin_scan; - bool first_time_engine_run; void hide_tabbable (ArdourWidgets::Tabbable*); void detach_tabbable (ArdourWidgets::Tabbable*); @@ -439,7 +438,7 @@ private: void engine_halted (const char* reason, bool free_reason); void engine_stopped (); - void engine_running (); + void engine_running (uint32_t cnt); void use_config (); diff --git a/headless/load_session.cc b/headless/load_session.cc index cce6a0ef5a..712e32c168 100644 --- a/headless/load_session.cc +++ b/headless/load_session.cc @@ -45,8 +45,6 @@ load_session (string dir, string state) ::exit (1); } - init_post_engine (); - if (engine->start () != 0) { std::cerr << "Cannot start Audio/MIDI engine\n"; ::exit (1); diff --git a/session_utils/common.cc b/session_utils/common.cc index 86e945f616..0910f6caf4 100644 --- a/session_utils/common.cc +++ b/session_utils/common.cc @@ -139,8 +139,6 @@ static Session * _load_session (string dir, string state) return 0; } - init_post_engine (); - if (engine->start () != 0) { std::cerr << "Cannot start Audio/MIDI engine\n"; return 0; @@ -194,8 +192,6 @@ SessionUtils::create_session (string dir, string state, float sample_rate) return 0; } - init_post_engine (); - if (engine->start () != 0) { std::cerr << "Cannot start Audio/MIDI engine\n"; return 0;