summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour_ui.cc77
-rw-r--r--gtk2_ardour/engine_dialog.cc68
-rw-r--r--gtk2_ardour/engine_dialog.h1
-rw-r--r--libs/ardour/ardour/profile.h4
4 files changed, 102 insertions, 48 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index bfe2c145e6..fe0a089344 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -2086,43 +2086,59 @@ ARDOUR_UI::new_session (Glib::ustring predetermined_path, bool have_engine)
load_session (session_path, session_name, &template_name);
} else {
-
+
uint32_t cchns;
uint32_t mchns;
AutoConnectOption iconnect;
AutoConnectOption oconnect;
-
- if (new_session_dialog->create_control_bus()) {
- cchns = (uint32_t) new_session_dialog->control_channel_count();
- } else {
+ uint32_t nphysin;
+ uint32_t nphysout;
+
+ if (Profile->get_sae()) {
+
cchns = 0;
- }
-
- if (new_session_dialog->create_master_bus()) {
- mchns = (uint32_t) new_session_dialog->master_channel_count();
- } else {
- mchns = 0;
- }
-
- if (new_session_dialog->connect_inputs()) {
+ mchns = 2;
iconnect = AutoConnectPhysical;
- } else {
- iconnect = AutoConnectOption (0);
- }
-
- /// @todo some minor tweaks.
-
- if (new_session_dialog->connect_outs_to_master()) {
oconnect = AutoConnectMaster;
- } else if (new_session_dialog->connect_outs_to_physical()) {
- oconnect = AutoConnectPhysical;
+ nphysin = 0; // use all available
+ nphysout = 0; // use all available
+
} else {
- oconnect = AutoConnectOption (0);
- }
-
- uint32_t nphysin = (uint32_t) new_session_dialog->input_limit_count();
- uint32_t nphysout = (uint32_t) new_session_dialog->output_limit_count();
-
+
+ /* get settings from advanced section of NSD */
+
+ if (new_session_dialog->create_control_bus()) {
+ cchns = (uint32_t) new_session_dialog->control_channel_count();
+ } else {
+ cchns = 0;
+ }
+
+ if (new_session_dialog->create_master_bus()) {
+ mchns = (uint32_t) new_session_dialog->master_channel_count();
+ } else {
+ mchns = 0;
+ }
+
+ if (new_session_dialog->connect_inputs()) {
+ iconnect = AutoConnectPhysical;
+ } else {
+ iconnect = AutoConnectOption (0);
+ }
+
+ /// @todo some minor tweaks.
+
+ if (new_session_dialog->connect_outs_to_master()) {
+ oconnect = AutoConnectMaster;
+ } else if (new_session_dialog->connect_outs_to_physical()) {
+ oconnect = AutoConnectPhysical;
+ } else {
+ oconnect = AutoConnectOption (0);
+ }
+
+ nphysin = (uint32_t) new_session_dialog->input_limit_count();
+ nphysout = (uint32_t) new_session_dialog->output_limit_count();
+ }
+
if (build_session (session_path,
session_name,
cchns,
@@ -2132,7 +2148,7 @@ ARDOUR_UI::new_session (Glib::ustring predetermined_path, bool have_engine)
nphysin,
nphysout,
engine->frame_rate() * 60 * 5)) {
-
+
response = Gtk::RESPONSE_NONE;
new_session_dialog->reset ();
continue;
@@ -2970,6 +2986,7 @@ ARDOUR_UI::setup_profile ()
if (getenv ("ARDOUR_SAE")) {
Profile->set_sae ();
+ Profile->set_single_package ();
}
}
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 970525411d..908f5d222a 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -4,6 +4,7 @@
#include <glibmm.h>
+#include <ardour/profile.h>
#include <jack/jack.h>
#include <gtkmm/stock.h>
@@ -197,24 +198,7 @@ EngineControl::EngineControl ()
strings.clear ();
- if (Glib::file_test ("/usr/bin/jackd", FILE_TEST_EXISTS)) {
- strings.push_back ("/usr/bin/jackd");
- }
- if (Glib::file_test ("/usr/local/bin/jackd", FILE_TEST_EXISTS)) {
- strings.push_back ("/usr/local/bin/jackd");
- }
- if (Glib::file_test ("/opt/bin/jackd", FILE_TEST_EXISTS)) {
- strings.push_back ("/opt/bin/jackd");
- }
- if (Glib::file_test ("/usr/bin/jackdmp", FILE_TEST_EXISTS)) {
- strings.push_back ("/usr/bin/jackd");
- }
- if (Glib::file_test ("/usr/local/bin/jackdmp", FILE_TEST_EXISTS)) {
- strings.push_back ("/usr/local/bin/jackd");
- }
- if (Glib::file_test ("/opt/bin/jackdmp", FILE_TEST_EXISTS)) {
- strings.push_back ("/opt/bin/jackd");
- }
+ find_jack_servers (strings);
if (strings.empty()) {
fatal << _("No JACK server found anywhere on this system. Please install JACK and restart") << endmsg;
@@ -587,3 +571,51 @@ EngineControl::audio_mode_changed ()
output_device_combo.set_sensitive (true);
}
}
+
+void
+EngineControl::find_jack_servers (vector<string>& strings)
+{
+#ifdef __APPLE
+ if (Profile->get_single_package()) {
+
+ /* this magic lets us finds the path to the OSX bundle, and then
+ we infer JACK's location from there
+ */
+
+ CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,
+ kCFURLPOSIXPathStyle);
+ std::string path = CFStringGetCStringPtr(macPath,
+ CFStringGetSystemEncoding());
+ CFRelease(pluginRef);
+ CFRelease(macPath);
+
+ path += '/jackd';
+
+ if (Glib::file_test (path, FILE_TEST_EXISTS)) {
+ strings.push_back ();
+ } else {
+ warning << _("JACK appears to be missing from the Ardour bundle") << endmsg;
+ }
+#endif
+
+ if (Glib::file_test ("/usr/bin/jackd", FILE_TEST_EXISTS)) {
+ strings.push_back ("/usr/bin/jackd");
+ }
+ if (Glib::file_test ("/usr/local/bin/jackd", FILE_TEST_EXISTS)) {
+ strings.push_back ("/usr/local/bin/jackd");
+ }
+ if (Glib::file_test ("/opt/bin/jackd", FILE_TEST_EXISTS)) {
+ strings.push_back ("/opt/bin/jackd");
+ }
+ if (Glib::file_test ("/usr/bin/jackdmp", FILE_TEST_EXISTS)) {
+ strings.push_back ("/usr/bin/jackd");
+ }
+ if (Glib::file_test ("/usr/local/bin/jackdmp", FILE_TEST_EXISTS)) {
+ strings.push_back ("/usr/local/bin/jackd");
+ }
+ if (Glib::file_test ("/opt/bin/jackdmp", FILE_TEST_EXISTS)) {
+ strings.push_back ("/opt/bin/jackd");
+ }
+
+}
diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h
index 14eb56fc9a..2b04a7cbdb 100644
--- a/gtk2_ardour/engine_dialog.h
+++ b/gtk2_ardour/engine_dialog.h
@@ -94,6 +94,7 @@ class EngineControl : public Gtk::VBox {
void redisplay_latency ();
uint32_t get_rate();
void audio_mode_changed ();
+ void find_jack_servers (std::vector<std::string>&);
};
#endif /* __gtk2_ardour_engine_dialog_h__ */
diff --git a/libs/ardour/ardour/profile.h b/libs/ardour/ardour/profile.h
index 4257607887..b016063c4d 100644
--- a/libs/ardour/ardour/profile.h
+++ b/libs/ardour/ardour/profile.h
@@ -30,6 +30,7 @@ class RuntimeProfile {
enum Element {
SmallScreen,
SAE,
+ SinglePackage,
LastElement
};
@@ -42,6 +43,9 @@ class RuntimeProfile {
void set_sae () { bits[SAE] = true; }
bool get_sae () const { return bits[SAE]; }
+ void set_single_package () { bits[SinglePackage] = true; }
+ bool get_single_package () const { return bits[SinglePackage]; }
+
private:
boost::dynamic_bitset<uint64_t> bits;