add nascent poly-phonic pressure to automation menu for MIDI tracks
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 6f6d31ff182b3ab044953679c23a47667f471d85..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
@@ -1900,7 +1895,7 @@ EngineControl::maybe_display_saved_state ()
 XMLNode&
 EngineControl::get_state ()
 {
-       LocaleGuard lg ();
+       LocaleGuard lg;
 
        XMLNode* root = new XMLNode ("AudioMIDISetup");
        std::string path;
@@ -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);
@@ -2367,6 +2362,8 @@ EngineControl::push_state_to_backend (bool start)
                        change_channels = true;
                        change_latency = true;
                        change_midi = true;
+                       change_buffered_io = backend->can_use_buffered_io();
+                       change_channels = true;
                        change_nperiods = backend->can_set_period_size() && get_popdown_string_count (nperiods_combo) > 0;
                }
 
@@ -2428,7 +2425,7 @@ EngineControl::push_state_to_backend (bool start)
        if (change_driver || change_device || change_channels || change_nperiods ||
                        (change_latency && !backend->can_change_systemic_latency_when_running ()) ||
                        (change_rate && !backend->can_change_sample_rate_when_running()) ||
-                       change_midi ||
+                       change_midi || change_buffered_io ||
                        (change_bufsize && !backend->can_change_buffer_size_when_running())) {
                restart_required = true;
        } else {