summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-01-16 15:29:25 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-01-16 15:29:38 -0600
commitc60d8cf747421fc3acbba1719c7d913ab548ccdf (patch)
tree3afce632db8a7bb634345316c677a0a6c4945f70
parent4c064081af23656c6b1bef756e23b20b9770a213 (diff)
(libs) call ARDOUR::init_post_engine() from within libardour rather than requiring "users" of the library to arrange for it
-rw-r--r--gtk2_ardour/ardour_ui.cc11
-rw-r--r--gtk2_ardour/ardour_ui.h3
-rw-r--r--headless/load_session.cc2
-rw-r--r--session_utils/common.cc4
4 files changed, 4 insertions, 16 deletions
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;