Remove the template description XMLNode before saving the template
[ardour.git] / libs / surfaces / generic_midi / gmcp_gui.cc
index 427ed1d32778711fde96ebec482180d6a4aa69b5..1fb83a111f37a950c8d9b97b9f295bb1930e9907 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "generic_midi_control_protocol.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 class GMCPGUI : public Gtk::VBox
 {
@@ -54,6 +54,7 @@ private:
        Gtk::ComboBoxText map_combo;
        Gtk::Adjustment bank_adjustment;
        Gtk::SpinButton bank_spinner;
+       Gtk::CheckButton feedback_enable;
        Gtk::CheckButton motorised_button;
        Gtk::Adjustment threshold_adjustment;
        Gtk::SpinButton threshold_spinner;
@@ -65,7 +66,8 @@ private:
        void bank_changed ();
        void motorised_changed ();
        void threshold_changed ();
-       
+       void toggle_feedback_enable ();
+
        void update_port_combos ();
        PBD::ScopedConnection connection_change_connection;
        void connection_handler ();
@@ -128,9 +130,11 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
        : cp (p)
        , bank_adjustment (1, 1, 100, 1, 10)
        , bank_spinner (bank_adjustment)
-       , motorised_button ("Motorised")
+       , feedback_enable (_("Enable Feedback"))
+       , motorised_button (_("Motorised"))
        , threshold_adjustment (p.threshold(), 1, 127, 1, 10)
        , threshold_spinner (threshold_adjustment)
+       , ignore_active_change (false)
 {
        vector<string> popdowns;
        popdowns.push_back (_("Reset All"));
@@ -179,7 +183,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
        table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
        table->attach (output_combo, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
        n++;
-       
+
        //MIDI binding file selector...
        label = manage (new Label (_("MIDI Bindings:")));
        label->set_alignment (0, 0.5);
@@ -201,6 +205,12 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
        bank_spinner.show ();
        label->show ();
 
+       feedback_enable.signal_toggled().connect (sigc::mem_fun (*this, &GMCPGUI::toggle_feedback_enable));
+       table->attach (feedback_enable, 0, 2, n, n + 1);
+       ++n;
+       feedback_enable.show ();
+       feedback_enable.set_active (p.get_feedback ());
+
        motorised_button.signal_toggled().connect (sigc::mem_fun (*this, &GMCPGUI::motorised_changed));
        table->attach (motorised_button, 0, 2, n, n + 1);
        ++n;
@@ -265,6 +275,12 @@ GMCPGUI::binding_changed ()
        }
 }
 
+void
+GMCPGUI::toggle_feedback_enable ()
+{
+       cp.set_feedback (feedback_enable.get_active ());
+}
+
 void
 GMCPGUI::motorised_changed ()
 {