From c2e7c32c53b481ef6889de834fe43b0853398c58 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 3 Aug 2013 16:37:10 -0400 Subject: add tim's jack_utils code to rationalize setup of JACK config --- gtk2_ardour/ardour_ui.cc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'gtk2_ardour/ardour_ui.cc') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index e764c50d4e..7e6ce10300 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -400,13 +400,23 @@ ARDOUR_UI::attach_to_engine () engine->BackendAvailable.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::post_engine, this)); ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports); + + /* if there is only one audio/midi backend, and it does not require setup, get our use of it underway + * right here (we need to know the client name and potential session ID + * to do this, which is why this is here, rather than in, say, + * ARDOUR::init(). + */ + + if (!AudioEngine::instance()->setup_required()) { + const AudioBackendInfo* backend = AudioEngine::instance()->available_backends().front(); + AudioEngine::instance()->set_backend (backend->name, ARDOUR_COMMAND_LINE::backend_client_name, ARDOUR_COMMAND_LINE::backend_session_uuid); + AudioEngine::instance()->start (); + } } void ARDOUR_UI::post_engine () { - cerr << "Backend available!\n"; - /* Things to be done once we have a backend running in the AudioEngine */ @@ -2565,17 +2575,6 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri int ret = -1; bool likely_new = false; - /* if the audio/midi backend does not require setup, get our use of it underway - * right here - */ - - if (!EngineControl::need_setup()) { - vector backends = AudioEngine::instance()->available_backends(); - cerr << "Setting up backend " << backends.front()->name; - AudioEngine::instance()->set_backend (backends.front()->name, ARDOUR_COMMAND_LINE::backend_client_name, ARDOUR_COMMAND_LINE::backend_session_uuid); - AudioEngine::instance()->start (); - } - /* deal with any existing DIRTY session now, rather than later. don't * treat a non-dirty session this way, so that it stays visible * as we bring up the new session dialog. -- cgit v1.2.3