summaryrefslogtreecommitdiff
path: root/libs/surfaces/generic_midi/gmcp_gui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-13 21:53:50 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-13 21:53:50 +0000
commit72642335d13b57ac270f6c4a1cc90cebd9bf6590 (patch)
treeb543cb6fec72f050c21e447dbdf99aef8932b1d9 /libs/surfaces/generic_midi/gmcp_gui.cc
parent1c2951e0eaff278833c8f90bab20afb7c80175c7 (diff)
Slightly tweaked patch from royvegard to add optional threshold for catch-up of non motorised controls in generic MIDI surfaces (#4828).
git-svn-id: svn://localhost/ardour2/branches/3.0@12716 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/generic_midi/gmcp_gui.cc')
-rw-r--r--libs/surfaces/generic_midi/gmcp_gui.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc
index 807e4bba22..e36562311b 100644
--- a/libs/surfaces/generic_midi/gmcp_gui.cc
+++ b/libs/surfaces/generic_midi/gmcp_gui.cc
@@ -46,10 +46,13 @@ private:
Gtk::Adjustment bank_adjustment;
Gtk::SpinButton bank_spinner;
Gtk::CheckButton motorised_button;
+ Gtk::Adjustment threshold_adjustment;
+ Gtk::SpinButton threshold_spinner;
void binding_changed ();
void bank_changed ();
void motorised_changed ();
+ void threshold_changed ();
};
using namespace PBD;
@@ -86,6 +89,8 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
, bank_adjustment (1, 1, 100, 1, 10)
, bank_spinner (bank_adjustment)
, motorised_button ("Motorised")
+ , threshold_adjustment (1, 1, 127, 1, 10)
+ , threshold_spinner (threshold_adjustment)
{
vector<string> popdowns;
popdowns.push_back (_("Reset All"));
@@ -140,7 +145,20 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
motorised_button.show ();
+ threshold_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &GMCPGUI::threshold_changed));
+
+ label = manage (new Label (_("Threshold:")));
+ label->set_alignment (0, 0.5);
+ table->attach (*label, 0, 1, n, n + 1);
+ table->attach (threshold_spinner, 1, 2, n, n + 1);
+ ++n;
+
+ threshold_spinner.show ();
+ label->show ();
+
pack_start (*table, false, false);
+
+ binding_changed ();
}
GMCPGUI::~GMCPGUI ()
@@ -166,6 +184,7 @@ GMCPGUI::binding_changed ()
if (str == x->name) {
cp.load_bindings (x->path);
motorised_button.set_active (cp.motorised ());
+ threshold_adjustment.set_value (cp.threshold ());
break;
}
}
@@ -177,3 +196,9 @@ GMCPGUI::motorised_changed ()
{
cp.set_motorised (motorised_button.get_active ());
}
+
+void
+GMCPGUI::threshold_changed ()
+{
+ cp.set_threshold (threshold_adjustment.get_value());
+}