mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 01:26:31 +01:00
remove "medium-length" press concept from faderport code and GUI
This commit is contained in:
parent
3b4df61d83
commit
daf02e8c73
4 changed files with 22 additions and 47 deletions
|
|
@ -714,9 +714,7 @@ void
|
||||||
FaderPort::Button::invoke (FaderPort::ButtonState bs, bool press)
|
FaderPort::Button::invoke (FaderPort::ButtonState bs, bool press)
|
||||||
{
|
{
|
||||||
if (!press) {
|
if (!press) {
|
||||||
if (long_press == 1) {
|
if (long_press) {
|
||||||
bs = FaderPort::ButtonState (bs | LongishPress);
|
|
||||||
} else if (long_press == 2) {
|
|
||||||
bs = FaderPort::ButtonState (bs | LongPress);
|
bs = FaderPort::ButtonState (bs | LongPress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -753,16 +751,14 @@ FaderPort::Button::do_timing (bool press)
|
||||||
{
|
{
|
||||||
if (press) {
|
if (press) {
|
||||||
pressed_at = get_microseconds ();
|
pressed_at = get_microseconds ();
|
||||||
long_press = 0;
|
long_press = false;
|
||||||
} else {
|
} else {
|
||||||
if (pressed_at > 0) {
|
if (pressed_at > 0) {
|
||||||
const ARDOUR::microseconds_t delta = ARDOUR::get_microseconds () - pressed_at;
|
const ARDOUR::microseconds_t delta = ARDOUR::get_microseconds () - pressed_at;
|
||||||
if (delta < 500000) {
|
if (delta < 1000000) {
|
||||||
long_press = 0;
|
long_press = false;
|
||||||
} else if (delta < 1000000) {
|
|
||||||
long_press = 1;
|
|
||||||
} else {
|
} else {
|
||||||
long_press = 2;
|
long_press = true;
|
||||||
}
|
}
|
||||||
pressed_at = 0;
|
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 ("plain"), ButtonState (0)));
|
||||||
state_pairs.push_back (make_pair (string ("shift"), ShiftDown));
|
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));
|
state_pairs.push_back (make_pair (string ("long"), LongPress));
|
||||||
|
|
||||||
on_press.clear ();
|
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 ("plain"), ButtonState (0)));
|
||||||
state_pairs.push_back (make_pair (string ("shift"), ShiftDown));
|
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));
|
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) {
|
for (vector<state_pair_t>::const_iterator sp = state_pairs.begin(); sp != state_pairs.end(); ++sp) {
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
|
||||||
RewindDown = 0x2,
|
RewindDown = 0x2,
|
||||||
StopDown = 0x4,
|
StopDown = 0x4,
|
||||||
UserDown = 0x8,
|
UserDown = 0x8,
|
||||||
LongishPress = 0x10,
|
LongPress = 0x10
|
||||||
LongPress = 0x20
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void set_action (ButtonID, std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
|
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)
|
, led_on (false)
|
||||||
, flash (false)
|
, flash (false)
|
||||||
, pressed_at (0)
|
, pressed_at (0)
|
||||||
, long_press (0)
|
, long_press (false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void set_action (std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
|
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 led_on;
|
||||||
bool flash;
|
bool flash;
|
||||||
ARDOUR::microseconds_t pressed_at;
|
ARDOUR::microseconds_t pressed_at;
|
||||||
int long_press;
|
bool long_press;
|
||||||
|
|
||||||
struct ToDo {
|
struct ToDo {
|
||||||
ActionType type;
|
ActionType type;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ FaderPort::build_gui ()
|
||||||
FPGUI::FPGUI (FaderPort& p)
|
FPGUI::FPGUI (FaderPort& p)
|
||||||
: fp (p)
|
: fp (p)
|
||||||
, table (2, 5)
|
, table (2, 5)
|
||||||
, action_table (4, 5)
|
, action_table (4, 4)
|
||||||
, ignore_active_change (false)
|
, ignore_active_change (false)
|
||||||
{
|
{
|
||||||
set_border_width (12);
|
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[0], FaderPort::ButtonState(0));
|
||||||
build_mix_action_combo (mix_combo[1], FaderPort::ShiftDown);
|
build_mix_action_combo (mix_combo[1], FaderPort::ShiftDown);
|
||||||
build_mix_action_combo (mix_combo[2], FaderPort::LongishPress);
|
build_mix_action_combo (mix_combo[2], FaderPort::LongPress);
|
||||||
build_mix_action_combo (mix_combo[3], FaderPort::LongPress);
|
|
||||||
|
|
||||||
build_proj_action_combo (proj_combo[0], FaderPort::ButtonState(0));
|
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[1], FaderPort::ShiftDown);
|
||||||
build_proj_action_combo (proj_combo[2], FaderPort::LongishPress);
|
build_proj_action_combo (proj_combo[2], FaderPort::LongPress);
|
||||||
build_proj_action_combo (proj_combo[3], FaderPort::LongPress);
|
|
||||||
|
|
||||||
build_trns_action_combo (trns_combo[0], FaderPort::ButtonState(0));
|
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[1], FaderPort::ShiftDown);
|
||||||
build_trns_action_combo (trns_combo[2], FaderPort::LongishPress);
|
build_trns_action_combo (trns_combo[2], FaderPort::LongPress);
|
||||||
build_trns_action_combo (trns_combo[3], FaderPort::LongPress);
|
|
||||||
|
|
||||||
action_table.set_row_spacings (4);
|
action_table.set_row_spacings (4);
|
||||||
action_table.set_col_spacings (6);
|
action_table.set_col_spacings (6);
|
||||||
|
|
@ -148,18 +145,15 @@ FPGUI::FPGUI (FaderPort& p)
|
||||||
l = manage (new Gtk::Label (_("Button")));
|
l = manage (new Gtk::Label (_("Button")));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
action_table.attach (*l, 0, 1, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
action_table.attach (*l, 0, 1, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
||||||
l = manage (new Gtk::Label (_("Press")));
|
l = manage (new Gtk::Label (_("Normal Press/Release Action")));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (0.5, 0.5);
|
||||||
action_table.attach (*l, 1, 2, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
action_table.attach (*l, 1, 2, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
||||||
l = manage (new Gtk::Label (_("Shift")));
|
l = manage (new Gtk::Label (_("Shift-Press Action")));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (0.5, 0.5);
|
||||||
action_table.attach (*l, 2, 3, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
action_table.attach (*l, 2, 3, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
||||||
l = manage (new Gtk::Label (_("Medium")));
|
l = manage (new Gtk::Label (_("Long Press Action")));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (0.5, 0.5);
|
||||||
action_table.attach (*l, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
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++;
|
action_row++;
|
||||||
|
|
||||||
l = manage (new Gtk::Label (_("Mix")));
|
l = manage (new Gtk::Label (_("Mix")));
|
||||||
|
|
@ -177,10 +171,6 @@ FPGUI::FPGUI (FaderPort& p)
|
||||||
align->set (0.0, 0.5);
|
align->set (0.0, 0.5);
|
||||||
align->add (mix_combo[2]);
|
align->add (mix_combo[2]);
|
||||||
action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
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++;
|
action_row++;
|
||||||
|
|
||||||
l = manage (new Gtk::Label (_("Proj")));
|
l = manage (new Gtk::Label (_("Proj")));
|
||||||
|
|
@ -198,10 +188,6 @@ FPGUI::FPGUI (FaderPort& p)
|
||||||
align->set (0.0, 0.5);
|
align->set (0.0, 0.5);
|
||||||
align->add (proj_combo[2]);
|
align->add (proj_combo[2]);
|
||||||
action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
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++;
|
action_row++;
|
||||||
|
|
||||||
l = manage (new Gtk::Label (_("Trns")));
|
l = manage (new Gtk::Label (_("Trns")));
|
||||||
|
|
@ -219,10 +205,6 @@ FPGUI::FPGUI (FaderPort& p)
|
||||||
align->set (0.0, 0.5);
|
align->set (0.0, 0.5);
|
||||||
align->add (trns_combo[2]);
|
align->add (trns_combo[2]);
|
||||||
action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
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++;
|
action_row++;
|
||||||
|
|
||||||
table.attach (action_table, 0, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
table.attach (action_table, 0, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,10 @@ private:
|
||||||
* functionality from a small, curated set of options.
|
* functionality from a small, curated set of options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Gtk::ComboBox mix_combo[4];
|
Gtk::ComboBox mix_combo[3];
|
||||||
Gtk::ComboBox proj_combo[4];
|
Gtk::ComboBox proj_combo[3];
|
||||||
Gtk::ComboBox trns_combo[4];
|
Gtk::ComboBox trns_combo[3];
|
||||||
Gtk::ComboBox user_combo[4];
|
Gtk::ComboBox user_combo[3];
|
||||||
|
|
||||||
void update_port_combos ();
|
void update_port_combos ();
|
||||||
PBD::ScopedConnection connection_change_connection;
|
PBD::ScopedConnection connection_change_connection;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue