NSM special-cases
Special cases to load-or-create session via NSM_Client::command_open This bypasses most of the startup-FSM for NSM. Either a session is loaded or created. JACK is mandatory.
This commit is contained in:
parent
61ce687017
commit
5d0867ec10
|
@ -70,6 +70,7 @@
|
||||||
#include "nsm.h"
|
#include "nsm.h"
|
||||||
#include "opts.h"
|
#include "opts.h"
|
||||||
#include "pingback.h"
|
#include "pingback.h"
|
||||||
|
#include "plugin_scan_dialog.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "splash.h"
|
#include "splash.h"
|
||||||
|
|
||||||
|
@ -412,8 +413,9 @@ ARDOUR_UI::nsm_init ()
|
||||||
nsm = 0;
|
nsm = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// wait for open command from nsm server
|
|
||||||
for ( i = 0; i < 5000; ++i) {
|
/* wait for open command from nsm server */
|
||||||
|
for (i = 0; i < 5000; ++i) {
|
||||||
nsm->check ();
|
nsm->check ();
|
||||||
Glib::usleep (1000);
|
Glib::usleep (1000);
|
||||||
if (nsm->client_id ()) {
|
if (nsm->client_id ()) {
|
||||||
|
@ -510,6 +512,9 @@ ARDOUR_UI::starting ()
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (nsm) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
startup_fsm = new StartupFSM (*amd);
|
startup_fsm = new StartupFSM (*amd);
|
||||||
startup_fsm->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::sfsm_response));
|
startup_fsm->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::sfsm_response));
|
||||||
|
@ -678,6 +683,7 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Cancel SessionDialog if it's visible to make OSX delegates work.
|
/* Cancel SessionDialog if it's visible to make OSX delegates work.
|
||||||
*
|
*
|
||||||
* ARDOUR_UI::starting connects app->ShouldLoad signal and then shows a SessionDialog
|
* ARDOUR_UI::starting connects app->ShouldLoad signal and then shows a SessionDialog
|
||||||
|
@ -698,11 +704,30 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nsm) {
|
||||||
|
AudioEngine::instance()->set_backend("JACK", "", "");
|
||||||
|
if (!AudioEngine::instance()->running()) {
|
||||||
|
if (AudioEngine::instance()->start()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PluginScanDialog psd (true, false);
|
||||||
|
psd.start ();
|
||||||
|
|
||||||
|
post_engine ();
|
||||||
|
}
|
||||||
|
|
||||||
/* the mechanisms that can result is this being called are only
|
/* the mechanisms that can result is this being called are only
|
||||||
* possible for existing sessions.
|
* possible for existing sessions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
|
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
|
||||||
|
if (nsm) {
|
||||||
|
BusProfile bus_profile;
|
||||||
|
bus_profile.master_out_channels = 2;
|
||||||
|
build_session (path, basename_nosuffix (path), "", bus_profile, true, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ NSM_Client::command_open(const char* name,
|
||||||
ARDOUR_COMMAND_LINE::backend_client_name = client_id;
|
ARDOUR_COMMAND_LINE::backend_client_name = client_id;
|
||||||
|
|
||||||
/* this appears asynchronous, but almost certainly is
|
/* this appears asynchronous, but almost certainly is
|
||||||
synchronous. However, there's no return value available.
|
* synchronous. However, there's no return value available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Gtkmm2ext::Application::instance()->ShouldLoad (name);
|
Gtkmm2ext::Application::instance()->ShouldLoad (name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user