} else if (str == _("Playback/Recording on 2 Devices")) {
+ string input_device = get_device_name (driver, input_device_combo.get_active_text());
+ string output_device = get_device_name (driver, output_device_combo.get_active_text());
+
+ if (input_device.empty() || output_device.empty()) {
+ cmd.clear ();
+ return;
+ }
+
cmd.push_back ("-C");
- cmd.push_back (get_device_name (driver, input_device_combo.get_active_text()));
+ cmd.push_back (input_device);
cmd.push_back ("-P");
- cmd.push_back (get_device_name (driver, output_device_combo.get_active_text()));
-
+ cmd.push_back (output_device);
+
} else if (str == _("Playback only")) {
cmd.push_back ("-P");
} else if (str == _("Recording only")) {
if (using_alsa) {
if (audio_mode_combo.get_active_text() != _("Playback/Recording on 2 Devices")) {
+
+ string device = get_device_name (driver, interface_combo.get_active_text());
+ if (device.empty()) {
+ cmd.clear ();
+ return;
+ }
+
cmd.push_back ("-d");
- cmd.push_back (get_device_name (driver, interface_combo.get_active_text()));
+ cmd.push_back (device);
}
if (hw_meter_button.get_active()) {
#ifdef __APPLE__
// note: older versions of the CoreAudio JACK backend use -n instead of -d here
+
+ string device = get_device_name (driver, interface_combo.get_active_text());
+ if (device.empty()) {
+ cmd.clear ();
+ return;
+ }
+
cmd.push_back ("-d");
- cmd.push_back (get_device_name (driver, interface_combo.get_active_text()));
+ cmd.push_back (device);
#endif
} else if (using_oss) {
std::string cwd = "/tmp";
build_command_line (args);
+
+ if (args.empty()) {
+ return 1; // try again
+ }
Glib::ustring jackdrc_path = Glib::get_home_dir();
jackdrc_path += "/.jackdrc";
error << string_compose (_("cannot open JACK rc file %1 to store parameters"), jackdrc_path) << endmsg;
return -1;
}
-
+ cerr << "JACK COMMAND: ";
for (vector<string>::iterator i = args.begin(); i != args.end(); ++i) {
+ cerr << (*i) << ' ';
jackdrc << (*i) << ' ';
}
+ cerr << endl;
jackdrc << endl;
jackdrc.close ();
vector<string>& strings = devices[driver];
- if (strings.empty()) {
+ if (strings.empty() && driver != "FFADO" && driver != "Dummy") {
error << string_compose (_("No devices found for driver \"%1\""), driver) << endmsg;
return;
}
interface_combo.set_active_text (strings.front());
input_device_combo.set_active_text (strings.front());
output_device_combo.set_active_text (strings.front());
- }
+ }
if (driver == "ALSA") {
soft_mode_button.set_sensitive (true);
_NSGetExecutablePath (execpath, &pathsz);
- Glib::ustring path (Glib::path_get_dirname (execpath));
+ string path (Glib::path_get_dirname (execpath));
path += "/jackd";
if (Glib::file_test (path, FILE_TEST_EXISTS)) {
PathScanner scanner;
vector<string *> *jack_servers;
std::map<string,int> un;
-
- path = getenv ("PATH");
+ char *p;
+ bool need_minimal_path = false;
+
+ p = getenv ("PATH");
+
+ if (p && *p) {
+ path = p;
+ } else {
+ need_minimal_path = true;
+ }
+
+#ifdef __APPLE__
+ // many mac users don't have PATH set up to include
+ // likely installed locations of JACK
+ need_minimal_path = true;
+#endif
+
+ if (need_minimal_path) {
+ if (path.empty()) {
+ path = "/usr/bin:/bin:/usr/local/bin:/opt/local/bin";
+ } else {
+ path += ":/usr/local/bin:/opt/local/bin";
+ }
+ }
+
+#ifdef __APPLE__
+ // push it back into the environment so that auto-started JACK can find it.
+ // XXX why can't we just expect OS X users to have PATH set correctly? we can't ...
+ setenv ("PATH", path.c_str(), 1);
+#endif
jack_servers = scanner (path, jack_server_filter, 0, false, true);
vector<string>::iterator n;
vector<string>::iterator i;
+ if (human_readable.empty()) {
+ /* this can happen if the user's .ardourrc file has a device name from
+ another computer system in it
+ */
+ MessageDialog msg (_("You need to choose an audio device first."));
+ msg.run ();
+ return string();
+ }
+
if (backend_devs.empty()) {
return human_readable;
}
}
if (i == devices[driver].end()) {
- fatal << string_compose (_("programming error: %1"), "true hardware name for ID missing") << endmsg;
- /*NOTREACHED*/
+ warning << string_compose (_("Audio device \"%1\" not known on this computer."), human_readable) << endmsg;
}
- /* keep gcc happy */
-
return string();
}
clist = root.children();
for (citer = clist.begin(); citer != clist.end(); ++citer) {
-
+ if ( prop && (prop->value() == "FFADO" ))
+ continue;
child = *citer;
prop = child->property ("val");