mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 18:46:34 +01:00
Merge branch 'master' into windows+cc
Conflicts (hopefully resolved): gtk2_ardour/ardour_ui.cc
This commit is contained in:
commit
e466ce40ad
51 changed files with 1819 additions and 1369 deletions
|
|
@ -83,6 +83,7 @@ namespace {
|
|||
const char * const dummy_driver_command_line_name = X_("dummy");
|
||||
|
||||
// should we provide more "pretty" names like above?
|
||||
const char * const alsaint_midi_driver_name = X_("alsa");
|
||||
const char * const alsaseq_midi_driver_name = X_("seq");
|
||||
const char * const alsaraw_midi_driver_name = X_("raw");
|
||||
const char * const winmme_midi_driver_name = X_("winmme");
|
||||
|
|
@ -92,6 +93,8 @@ namespace {
|
|||
const char * const default_device_name = X_("Default");
|
||||
}
|
||||
|
||||
static ARDOUR::MidiOptions midi_options;
|
||||
|
||||
std::string
|
||||
get_none_string ()
|
||||
{
|
||||
|
|
@ -682,7 +685,7 @@ ARDOUR::JackCommandLineOptions::JackCommandLineOptions ()
|
|||
}
|
||||
|
||||
bool
|
||||
ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line)
|
||||
ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line, bool for_latency_measurement)
|
||||
{
|
||||
vector<string> args;
|
||||
|
||||
|
|
@ -740,6 +743,13 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
}
|
||||
#endif
|
||||
|
||||
if (options.driver == alsa_driver_name) {
|
||||
if (options.midi_driver == alsaint_midi_driver_name) {
|
||||
args.push_back ("-I");
|
||||
args.push_back ("alsa_midi");
|
||||
}
|
||||
}
|
||||
|
||||
string command_line_driver_name;
|
||||
|
||||
if (!get_jack_command_line_audio_driver_name (options.driver, command_line_driver_name)) {
|
||||
|
|
@ -811,7 +821,7 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
args.push_back ("-p");
|
||||
args.push_back (to_string (options.period_size, std::dec));
|
||||
|
||||
if (get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
|
||||
if (!for_latency_measurement && get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
|
||||
if (options.input_latency) {
|
||||
args.push_back ("-I");
|
||||
args.push_back (to_string (options.input_latency, std::dec));
|
||||
|
|
@ -846,10 +856,15 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
if (options.soft_mode) {
|
||||
args.push_back ("-s");
|
||||
}
|
||||
}
|
||||
|
||||
if (!options.midi_driver.empty() && options.midi_driver != get_none_string ()) {
|
||||
args.push_back ("-X");
|
||||
args.push_back (options.midi_driver);
|
||||
if (options.driver == alsa_driver_name || options.driver == coreaudio_driver_name) {
|
||||
|
||||
if (options.midi_driver != alsaint_midi_driver_name) {
|
||||
if (!options.midi_driver.empty() && options.midi_driver != get_none_string ()) {
|
||||
args.push_back ("-X");
|
||||
args.push_back (options.midi_driver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -900,3 +915,53 @@ ARDOUR::write_jack_config_file (const std::string& config_file_path, const strin
|
|||
jackdrc.close ();
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<string>
|
||||
ARDOUR::enumerate_midi_options ()
|
||||
{
|
||||
if (midi_options.empty()) {
|
||||
#ifdef HAVE_ALSA
|
||||
midi_options.push_back (make_pair (_("ALSA"), alsaint_midi_driver_name));
|
||||
midi_options.push_back (make_pair (_("(legacy) ALSA raw devices"), alsaraw_midi_driver_name));
|
||||
midi_options.push_back (make_pair (_("(legacy) ALSA sequencer"), alsaseq_midi_driver_name));
|
||||
#endif
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
/* Windows folks: what name makes sense here? Are there other
|
||||
choices as well ?
|
||||
*/
|
||||
midi_options.push_back (make_pair (_("Multimedia Extension"), winmme_midi_driver_name));
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
midi_options.push_back (make_pair (_("CoreMIDI"), coremidi_midi_driver_name));
|
||||
#endif
|
||||
}
|
||||
|
||||
vector<string> v;
|
||||
|
||||
v.push_back (get_none_string());
|
||||
|
||||
for (MidiOptions::const_iterator i = midi_options.begin(); i != midi_options.end(); ++i) {
|
||||
v.push_back (i->first);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR::set_midi_option (ARDOUR::JackCommandLineOptions& options, const string& opt)
|
||||
{
|
||||
if (opt.empty() || opt == get_none_string()) {
|
||||
options.midi_driver = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (MidiOptions::const_iterator i = midi_options.begin(); i != midi_options.end(); ++i) {
|
||||
if (i->first == opt) {
|
||||
options.midi_driver = i->second;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue