13
0

faderport: long press on fader mode buttons switches fader automation to manual/off; off button is never sent an LED state message to avoid fader disabling

This commit is contained in:
Paul Davis 2015-12-14 14:42:12 -05:00
parent e928edca32
commit ff76ef86b4

View File

@ -152,8 +152,11 @@ FaderPort::FaderPort (Session& s)
get_button (Undo).set_flash (true); get_button (Undo).set_flash (true);
get_button (FP_Read).set_action (boost::bind (&FaderPort::read, this), true); get_button (FP_Read).set_action (boost::bind (&FaderPort::read, this), true);
get_button (FP_Read).set_action (boost::bind (&FaderPort::off, this), false, LongPress);
get_button (FP_Write).set_action (boost::bind (&FaderPort::write, this), true); get_button (FP_Write).set_action (boost::bind (&FaderPort::write, this), true);
get_button (FP_Write).set_action (boost::bind (&FaderPort::off, this), false, LongPress);
get_button (FP_Touch).set_action (boost::bind (&FaderPort::touch, this), true); get_button (FP_Touch).set_action (boost::bind (&FaderPort::touch, this), true);
get_button (FP_Touch).set_action (boost::bind (&FaderPort::off, this), false, LongPress);
get_button (FP_Off).set_action (boost::bind (&FaderPort::off, this), true); get_button (FP_Off).set_action (boost::bind (&FaderPort::off, this), true);
get_button (Play).set_action (boost::bind (&BasicUI::transport_play, this, true), true); get_button (Play).set_action (boost::bind (&BasicUI::transport_play, this, true), true);
@ -1123,11 +1126,9 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
void void
FaderPort::map_auto () FaderPort::map_auto ()
{ {
/* December 14th 2015: setting the LED states of these buttons /* Under no circumstances send a message to "enable" the LED state of
interferes with fader operation. * the Off button, because this will disable the fader.
*/ */
return;
boost::shared_ptr<AutomationControl> control = _current_route->gain_control (); boost::shared_ptr<AutomationControl> control = _current_route->gain_control ();
const AutoState as = control->automation_state (); const AutoState as = control->automation_state ();
@ -1137,25 +1138,21 @@ FaderPort::map_auto ()
get_button (FP_Read).set_led_state (_output_port, true); get_button (FP_Read).set_led_state (_output_port, true);
get_button (FP_Write).set_led_state (_output_port, false); get_button (FP_Write).set_led_state (_output_port, false);
get_button (FP_Touch).set_led_state (_output_port, false); get_button (FP_Touch).set_led_state (_output_port, false);
get_button (FP_Off).set_led_state (_output_port, false);
break; break;
case ARDOUR::Write: case ARDOUR::Write:
get_button (FP_Read).set_led_state (_output_port, false); get_button (FP_Read).set_led_state (_output_port, false);
get_button (FP_Write).set_led_state (_output_port, true); get_button (FP_Write).set_led_state (_output_port, true);
get_button (FP_Touch).set_led_state (_output_port, false); get_button (FP_Touch).set_led_state (_output_port, false);
get_button (FP_Off).set_led_state (_output_port, false);
break; break;
case ARDOUR::Touch: case ARDOUR::Touch:
get_button (FP_Read).set_led_state (_output_port, false); get_button (FP_Read).set_led_state (_output_port, false);
get_button (FP_Write).set_led_state (_output_port, false); get_button (FP_Write).set_led_state (_output_port, false);
get_button (FP_Touch).set_led_state (_output_port, true); get_button (FP_Touch).set_led_state (_output_port, true);
get_button (FP_Off).set_led_state (_output_port, false);
break; break;
case ARDOUR::Off: case ARDOUR::Off:
get_button (FP_Read).set_led_state (_output_port, false); get_button (FP_Read).set_led_state (_output_port, false);
get_button (FP_Write).set_led_state (_output_port, false); get_button (FP_Write).set_led_state (_output_port, false);
get_button (FP_Touch).set_led_state (_output_port, false); get_button (FP_Touch).set_led_state (_output_port, false);
get_button (FP_Off).set_led_state (_output_port, true);
break; break;
} }