GenericUI: don't add all inputs to automation vector
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 4b47fe1baf079482e692a4f8384df3acce0c4d26..4f03e92a49205f2c337e9c4a30037357c353343a 100644 (file)
@@ -53,7 +53,7 @@
 #include "engine_dialog.h"
 #include "gui_thread.h"
 #include "utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtk;
@@ -1596,12 +1596,7 @@ EngineControl::output_device_changed ()
 string
 EngineControl::bufsize_as_string (uint32_t sz)
 {
-       /* Translators: "samples" is always plural here, so no
-          need for plural+singular forms.
-        */
-       char buf[64];
-       snprintf (buf, sizeof (buf), "%u %s", sz, P_("sample", "samples", sz));
-       return buf;
+       return string_compose (P_("%1 sample", "%1 samples", sz), sz);
 }
 
 string
@@ -1974,8 +1969,6 @@ EngineControl::set_state (const XMLNode& root)
        XMLNode const * grandchild;
        XMLProperty const * prop = NULL;
 
-       fprintf (stderr, "EngineControl::set_state\n");
-
        if (root.name() != "AudioMIDISetup") {
                return false;
        }
@@ -2242,7 +2235,9 @@ EngineControl::set_current_state (const State& state)
        device_combo.set_active_text (state->device);
        input_device_combo.set_active_text (state->input_device);
        output_device_combo.set_active_text (state->output_device);
-       sample_rate_combo.set_active_text (rate_as_string (state->sample_rate));
+       if (!_desired_sample_rate) {
+               sample_rate_combo.set_active_text (rate_as_string (state->sample_rate));
+       }
        set_active_text_if_present (buffer_size_combo, bufsize_as_string (state->buffer_size));
        set_active_text_if_present (nperiods_combo, nperiods_as_string (state->n_periods));
        input_latency.set_value (state->input_latency);