summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-12-28 22:59:15 +0100
committerRobin Gareus <robin@gareus.org>2016-12-28 22:59:15 +0100
commitd1e869f96d69072e2e441427e3c6f70d22b72ddd (patch)
treed131b28ee09e9590b350f320cf1fb5687317d2e7 /libs/surfaces
parente1846c79a9292d4e58527aa1d2a33119ea966902 (diff)
Move "Feedback" option to control-portocol settings
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/generic_midi/gmcp_gui.cc17
-rw-r--r--libs/surfaces/osc/osc_gui.cc14
-rw-r--r--libs/surfaces/osc/osc_gui.h2
3 files changed, 31 insertions, 2 deletions
diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc
index 3c2479b622..1fb83a111f 100644
--- a/libs/surfaces/generic_midi/gmcp_gui.cc
+++ b/libs/surfaces/generic_midi/gmcp_gui.cc
@@ -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,6 +66,7 @@ private:
void bank_changed ();
void motorised_changed ();
void threshold_changed ();
+ void toggle_feedback_enable ();
void update_port_combos ();
PBD::ScopedConnection connection_change_connection;
@@ -128,7 +130,8 @@ 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)
@@ -202,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;
@@ -267,6 +276,12 @@ GMCPGUI::binding_changed ()
}
void
+GMCPGUI::toggle_feedback_enable ()
+{
+ cp.set_feedback (feedback_enable.get_active ());
+}
+
+void
GMCPGUI::motorised_changed ()
{
cp.set_motorised (motorised_button.get_active ());
diff --git a/libs/surfaces/osc/osc_gui.cc b/libs/surfaces/osc/osc_gui.cc
index 4f976302f5..306baa95c4 100644
--- a/libs/surfaces/osc/osc_gui.cc
+++ b/libs/surfaces/osc/osc_gui.cc
@@ -266,11 +266,14 @@ OSC_GUI::OSC_GUI (OSC& p)
fbtable->set_col_spacings (6);
fbtable->set_border_width (12);
- // show our url
label = manage (new Gtk::Label(_("Select Desired Types of Feedback")));
fbtable->attach (*label, 0, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
++fn;
+ feedback_enable.add (*manage (new Label (_("Enable Feedback"))));
+ fbtable->attach (feedback_enable, 0, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
+ ++fn;
+
label = manage (new Gtk::Label(_("Feedback Value:")));
label->set_alignment(1, .5);
fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
@@ -369,6 +372,7 @@ OSC_GUI::OSC_GUI (OSC& p)
// set strips and feedback from loaded default values
reshow_values ();
// connect signals
+ feedback_enable.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::toggle_feedback_enable));
audio_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets));
midi_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets));
audio_buses.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets));
@@ -601,6 +605,8 @@ OSC_GUI::reshow_values ()
//hp_gui.set_active (false); // we don't have this yet (Mixbus wants)
select_fb.set_active(def_feedback & 8192);
+ feedback_enable.set_active (cp.get_feedback ());
+
calculate_strip_types ();
calculate_feedback ();
}
@@ -694,6 +700,12 @@ OSC_GUI::calculate_strip_types ()
}
void
+OSC_GUI::toggle_feedback_enable ()
+{
+ cp.set_feedback (feedback_enable.get_active ());
+}
+
+void
OSC_GUI::set_bitsets ()
{
if (preset_busy) {
diff --git a/libs/surfaces/osc/osc_gui.h b/libs/surfaces/osc/osc_gui.h
index ae3640c1ee..2b73be49a7 100644
--- a/libs/surfaces/osc/osc_gui.h
+++ b/libs/surfaces/osc/osc_gui.h
@@ -92,6 +92,7 @@ private:
uint32_t def_feedback;
void calculate_feedback ();
Gtk::Label current_feedback;
+ Gtk::CheckButton feedback_enable;
Gtk::CheckButton strip_buttons_button;
Gtk::CheckButton strip_control_button;
Gtk::CheckButton ssid_as_path;
@@ -108,6 +109,7 @@ private:
Gtk::CheckButton select_fb;
int fbvalue;
void set_bitsets ();
+ void toggle_feedback_enable ();