summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_startup.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/ardour_ui_startup.cc')
-rw-r--r--gtk2_ardour/ardour_ui_startup.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui_startup.cc b/gtk2_ardour/ardour_ui_startup.cc
index dc7060a4b6..ca470524c3 100644
--- a/gtk2_ardour/ardour_ui_startup.cc
+++ b/gtk2_ardour/ardour_ui_startup.cc
@@ -705,9 +705,26 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
}
if (nsm) {
- AudioEngine::instance()->set_backend("JACK", "", "");
+ if (!AudioEngine::instance()->set_backend("JACK", "", "")) {
+ error << _("NSM: The JACK backend is mandatory and can not be loaded.") << endmsg;
+ return;
+ }
+
if (!AudioEngine::instance()->running()) {
+ /* this auto-starts jackd with recent settings
+ * TODO: if Glib::file_test (path, Glib::FILE_TEST_IS_DIR)
+ * query sample-rate of the session and use it.
+ */
+ if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
+ float sr;
+ SampleFormat sf;
+ string pv;
+ if (0 == Session::get_info_from_path (Glib::build_filename (path, basename_nosuffix (path) + statefile_suffix), sr, sf, pv)) {
+ ARDOUR::AudioEngine::instance ()->set_sample_rate (sr);
+ }
+ }
if (AudioEngine::instance()->start()) {
+ error << string_compose (_("NSM: %1 cannot connect to the JACK server. Please start jackd first."), PROGRAM_NAME) << endmsg;
return;
}
}