mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Remember I/O ports used for latency measurement
This commit is contained in:
parent
ace8a0d7b9
commit
fe8df2eeae
2 changed files with 45 additions and 16 deletions
|
|
@ -750,6 +750,8 @@ EngineControl::disable_latency_tab ()
|
|||
void
|
||||
EngineControl::enable_latency_tab ()
|
||||
{
|
||||
State state = get_saved_state_for_currently_displayed_backend_and_device ();
|
||||
|
||||
vector<string> outputs;
|
||||
vector<string> inputs;
|
||||
|
||||
|
|
@ -780,32 +782,41 @@ EngineControl::enable_latency_tab ()
|
|||
lm_preamble.show ();
|
||||
}
|
||||
|
||||
unsigned int j = 0;
|
||||
unsigned int n = 0;
|
||||
lm_output_channel_list->clear ();
|
||||
for (vector<string>::const_iterator i = outputs.begin(); i != outputs.end(); ++i) {
|
||||
for (vector<string>::const_iterator i = outputs.begin(); i != outputs.end(); ++i, ++j) {
|
||||
Gtk::TreeModel::iterator iter = lm_output_channel_list->append ();
|
||||
Gtk::TreeModel::Row row = *iter;
|
||||
row[lm_output_channel_cols.port_name] = *i;
|
||||
std::string pn = ARDOUR::AudioEngine::instance()->get_pretty_name_by_name (*i);
|
||||
if (pn.empty()) {
|
||||
pn = (*i).substr ((*i).find (':') + 1);
|
||||
}
|
||||
row[lm_output_channel_cols.pretty_name] = pn;
|
||||
row[lm_output_channel_cols.port_name] = *i;
|
||||
std::string pn = ARDOUR::AudioEngine::instance()->get_pretty_name_by_name (*i);
|
||||
if (pn.empty()) {
|
||||
pn = (*i).substr ((*i).find (':') + 1);
|
||||
}
|
||||
row[lm_output_channel_cols.pretty_name] = pn;
|
||||
if (state && state->lm_output == *i) {
|
||||
n = j;
|
||||
}
|
||||
}
|
||||
lm_output_channel_combo.set_active (0);
|
||||
lm_output_channel_combo.set_active (n);
|
||||
lm_output_channel_combo.set_sensitive (true);
|
||||
|
||||
j = n = 0;
|
||||
lm_input_channel_list->clear ();
|
||||
for (vector<string>::const_iterator i = inputs.begin(); i != inputs.end(); ++i) {
|
||||
for (vector<string>::const_iterator i = inputs.begin(); i != inputs.end(); ++i, ++j) {
|
||||
Gtk::TreeModel::iterator iter = lm_input_channel_list->append ();
|
||||
Gtk::TreeModel::Row row = *iter;
|
||||
row[lm_input_channel_cols.port_name] = *i;
|
||||
std::string pn = ARDOUR::AudioEngine::instance()->get_pretty_name_by_name (*i);
|
||||
if (pn.empty()) {
|
||||
pn = (*i).substr ((*i).find (':') + 1);
|
||||
}
|
||||
row[lm_input_channel_cols.pretty_name] = pn;
|
||||
row[lm_input_channel_cols.port_name] = *i;
|
||||
std::string pn = ARDOUR::AudioEngine::instance()->get_pretty_name_by_name (*i);
|
||||
if (pn.empty()) {
|
||||
pn = (*i).substr ((*i).find (':') + 1);
|
||||
}
|
||||
row[lm_input_channel_cols.pretty_name] = pn;
|
||||
if (state && state->lm_input == *i) {
|
||||
n = j;
|
||||
}
|
||||
}
|
||||
lm_input_channel_combo.set_active (0);
|
||||
lm_input_channel_combo.set_active (n);
|
||||
lm_input_channel_combo.set_sensitive (true);
|
||||
|
||||
lm_measure_button.set_sensitive (true);
|
||||
|
|
@ -2013,6 +2024,8 @@ EngineControl::get_state ()
|
|||
node->set_property ("output-latency", (*i)->output_latency);
|
||||
node->set_property ("input-channels", (*i)->input_channels);
|
||||
node->set_property ("output-channels", (*i)->output_channels);
|
||||
node->set_property ("lm-input", (*i)->lm_input);
|
||||
node->set_property ("lm-output", (*i)->lm_output);
|
||||
node->set_property ("active", (*i)->active);
|
||||
node->set_property ("use-buffered-io", (*i)->use_buffered_io);
|
||||
node->set_property ("midi-option", (*i)->midi_option);
|
||||
|
|
@ -2117,6 +2130,12 @@ EngineControl::set_state (const XMLNode& root)
|
|||
state->n_periods = 0;
|
||||
}
|
||||
|
||||
if (!grandchild->get_property ("lm-input", state->lm_input) ||
|
||||
!grandchild->get_property ("lm-output", state->lm_output)) {
|
||||
state->lm_input = "";
|
||||
state->lm_output = "";
|
||||
}
|
||||
|
||||
state->midi_devices.clear();
|
||||
XMLNode* midinode;
|
||||
if ((midinode = ARDOUR::find_named_node (*grandchild, "MIDIDevices")) != 0) {
|
||||
|
|
@ -3183,6 +3202,14 @@ EngineControl::use_latency_button_clicked ()
|
|||
|
||||
input_latency_adjustment.set_value (one_way);
|
||||
output_latency_adjustment.set_value (one_way);
|
||||
|
||||
State state = get_saved_state_for_currently_displayed_backend_and_device ();
|
||||
if (state) {
|
||||
state->lm_input = lm_input_channel_combo.get_active ()->get_value (lm_input_channel_cols.port_name);
|
||||
state->lm_output = lm_output_channel_combo.get_active ()->get_value (lm_output_channel_cols.port_name);
|
||||
post_push ();
|
||||
}
|
||||
|
||||
if (backend->can_change_systemic_latency_when_running ()) {
|
||||
backend->set_systemic_input_latency (one_way);
|
||||
backend->set_systemic_output_latency (one_way);
|
||||
|
|
|
|||
|
|
@ -248,6 +248,8 @@ private:
|
|||
bool use_buffered_io;
|
||||
std::string midi_option;
|
||||
std::vector<MidiDeviceSettings> midi_devices;
|
||||
std::string lm_input;
|
||||
std::string lm_output;
|
||||
time_t lru;
|
||||
|
||||
StateStruct()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue