diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 09:23:02 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 09:23:08 -0500 |
commit | daf02e8c73e98b5ef265825024eb5d6fbbecbcc9 (patch) | |
tree | 858ea7d5f480b63e2670d776edb67c6bb1db2eb5 | |
parent | 3b4df61d83909fd8015407efe791a80d0893f3b7 (diff) |
remove "medium-length" press concept from faderport code and GUI
-rw-r--r-- | libs/surfaces/faderport/faderport.cc | 16 | ||||
-rw-r--r-- | libs/surfaces/faderport/faderport.h | 7 | ||||
-rw-r--r-- | libs/surfaces/faderport/gui.cc | 38 | ||||
-rw-r--r-- | libs/surfaces/faderport/gui.h | 8 |
4 files changed, 22 insertions, 47 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index 19dbfe83ce..5a0b0edb0b 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -714,9 +714,7 @@ void FaderPort::Button::invoke (FaderPort::ButtonState bs, bool press) { if (!press) { - if (long_press == 1) { - bs = FaderPort::ButtonState (bs | LongishPress); - } else if (long_press == 2) { + if (long_press) { bs = FaderPort::ButtonState (bs | LongPress); } } @@ -753,16 +751,14 @@ FaderPort::Button::do_timing (bool press) { if (press) { pressed_at = get_microseconds (); - long_press = 0; + long_press = false; } else { if (pressed_at > 0) { const ARDOUR::microseconds_t delta = ARDOUR::get_microseconds () - pressed_at; - if (delta < 500000) { - long_press = 0; - } else if (delta < 1000000) { - long_press = 1; + if (delta < 1000000) { + long_press = false; } else { - long_press = 2; + long_press = true; } pressed_at = 0; } @@ -873,7 +869,6 @@ FaderPort::Button::set_state (XMLNode const& node) state_pairs.push_back (make_pair (string ("plain"), ButtonState (0))); state_pairs.push_back (make_pair (string ("shift"), ShiftDown)); - state_pairs.push_back (make_pair (string ("longish"), LongishPress)); state_pairs.push_back (make_pair (string ("long"), LongPress)); on_press.clear (); @@ -914,7 +909,6 @@ FaderPort::Button::get_state () const state_pairs.push_back (make_pair (string ("plain"), ButtonState (0))); state_pairs.push_back (make_pair (string ("shift"), ShiftDown)); - state_pairs.push_back (make_pair (string ("longish"), LongishPress)); state_pairs.push_back (make_pair (string ("long"), LongPress)); for (vector<state_pair_t>::const_iterator sp = state_pairs.begin(); sp != state_pairs.end(); ++sp) { diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h index 2c08b9f847..dd64700bf2 100644 --- a/libs/surfaces/faderport/faderport.h +++ b/libs/surfaces/faderport/faderport.h @@ -151,8 +151,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq RewindDown = 0x2, StopDown = 0x4, UserDown = 0x8, - LongishPress = 0x10, - LongPress = 0x20 + LongPress = 0x10 }; void set_action (ButtonID, std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0)); @@ -217,7 +216,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq , led_on (false) , flash (false) , pressed_at (0) - , long_press (0) + , long_press (false) {} void set_action (std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0)); @@ -241,7 +240,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq bool led_on; bool flash; ARDOUR::microseconds_t pressed_at; - int long_press; + bool long_press; struct ToDo { ActionType type; diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc index 4014d0a8e3..593b3554e3 100644 --- a/libs/surfaces/faderport/gui.cc +++ b/libs/surfaces/faderport/gui.cc @@ -80,7 +80,7 @@ FaderPort::build_gui () FPGUI::FPGUI (FaderPort& p) : fp (p) , table (2, 5) - , action_table (4, 5) + , action_table (4, 4) , ignore_active_change (false) { set_border_width (12); @@ -124,18 +124,15 @@ FPGUI::FPGUI (FaderPort& p) build_mix_action_combo (mix_combo[0], FaderPort::ButtonState(0)); build_mix_action_combo (mix_combo[1], FaderPort::ShiftDown); - build_mix_action_combo (mix_combo[2], FaderPort::LongishPress); - build_mix_action_combo (mix_combo[3], FaderPort::LongPress); + build_mix_action_combo (mix_combo[2], FaderPort::LongPress); build_proj_action_combo (proj_combo[0], FaderPort::ButtonState(0)); build_proj_action_combo (proj_combo[1], FaderPort::ShiftDown); - build_proj_action_combo (proj_combo[2], FaderPort::LongishPress); - build_proj_action_combo (proj_combo[3], FaderPort::LongPress); + build_proj_action_combo (proj_combo[2], FaderPort::LongPress); build_trns_action_combo (trns_combo[0], FaderPort::ButtonState(0)); build_trns_action_combo (trns_combo[1], FaderPort::ShiftDown); - build_trns_action_combo (trns_combo[2], FaderPort::LongishPress); - build_trns_action_combo (trns_combo[3], FaderPort::LongPress); + build_trns_action_combo (trns_combo[2], FaderPort::LongPress); action_table.set_row_spacings (4); action_table.set_col_spacings (6); @@ -148,18 +145,15 @@ FPGUI::FPGUI (FaderPort& p) l = manage (new Gtk::Label (_("Button"))); l->set_alignment (1.0, 0.5); action_table.attach (*l, 0, 1, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - l = manage (new Gtk::Label (_("Press"))); - l->set_alignment (1.0, 0.5); + l = manage (new Gtk::Label (_("Normal Press/Release Action"))); + l->set_alignment (0.5, 0.5); action_table.attach (*l, 1, 2, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - l = manage (new Gtk::Label (_("Shift"))); - l->set_alignment (1.0, 0.5); + l = manage (new Gtk::Label (_("Shift-Press Action"))); + l->set_alignment (0.5, 0.5); action_table.attach (*l, 2, 3, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - l = manage (new Gtk::Label (_("Medium"))); - l->set_alignment (1.0, 0.5); + l = manage (new Gtk::Label (_("Long Press Action"))); + l->set_alignment (0.5, 0.5); action_table.attach (*l, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - l = manage (new Gtk::Label (_("Long"))); - l->set_alignment (1.0, 0.5); - action_table.attach (*l, 4, 5, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); action_row++; l = manage (new Gtk::Label (_("Mix"))); @@ -177,10 +171,6 @@ FPGUI::FPGUI (FaderPort& p) align->set (0.0, 0.5); align->add (mix_combo[2]); action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - align = manage (new Alignment); - align->set (0.0, 0.5); - align->add (mix_combo[3]); - action_table.attach (*align, 4, 5, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); action_row++; l = manage (new Gtk::Label (_("Proj"))); @@ -198,10 +188,6 @@ FPGUI::FPGUI (FaderPort& p) align->set (0.0, 0.5); align->add (proj_combo[2]); action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - align = manage (new Alignment); - align->set (0.0, 0.5); - align->add (proj_combo[3]); - action_table.attach (*align, 4, 5, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); action_row++; l = manage (new Gtk::Label (_("Trns"))); @@ -219,10 +205,6 @@ FPGUI::FPGUI (FaderPort& p) align->set (0.0, 0.5); align->add (trns_combo[2]); action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); - align = manage (new Alignment); - align->set (0.0, 0.5); - align->add (trns_combo[3]); - action_table.attach (*align, 4, 5, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); action_row++; table.attach (action_table, 0, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); diff --git a/libs/surfaces/faderport/gui.h b/libs/surfaces/faderport/gui.h index 62580ded6f..4df3f286c1 100644 --- a/libs/surfaces/faderport/gui.h +++ b/libs/surfaces/faderport/gui.h @@ -58,10 +58,10 @@ private: * functionality from a small, curated set of options. */ - Gtk::ComboBox mix_combo[4]; - Gtk::ComboBox proj_combo[4]; - Gtk::ComboBox trns_combo[4]; - Gtk::ComboBox user_combo[4]; + Gtk::ComboBox mix_combo[3]; + Gtk::ComboBox proj_combo[3]; + Gtk::ComboBox trns_combo[3]; + Gtk::ComboBox user_combo[3]; void update_port_combos (); PBD::ScopedConnection connection_change_connection; |