13
0

Faderport: map automation indicator LEDs

This commit is contained in:
Ben Loftis 2015-12-02 20:06:29 -06:00
parent 16a100703b
commit 20facc4d18
2 changed files with 39 additions and 0 deletions

View File

@ -1028,6 +1028,7 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
boost::shared_ptr<AutomationControl> control = _current_route->gain_control (); boost::shared_ptr<AutomationControl> control = _current_route->gain_control ();
if (control) { if (control) {
control->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_gain, this), this); control->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_gain, this), this);
control->alist()->automation_state_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_auto, this), this);
} }
boost::shared_ptr<MonitorProcessor> mp = _current_route->monitor_control(); boost::shared_ptr<MonitorProcessor> mp = _current_route->monitor_control();
@ -1041,6 +1042,42 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
map_route_state (); map_route_state ();
} }
void
FaderPort::map_auto ()
{
boost::shared_ptr<AutomationControl> control = _current_route->gain_control ();
const AutoState as = control->automation_state ();
switch (as) {
case ARDOUR::Play:
get_button (FP_Read).set_led_state (_output_port, true);
get_button (FP_Write).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;
case ARDOUR::Write:
get_button (FP_Read).set_led_state (_output_port, false);
get_button (FP_Write).set_led_state (_output_port, true);
get_button (FP_Touch).set_led_state (_output_port, false);
get_button (FP_Off).set_led_state (_output_port, false);
break;
case ARDOUR::Touch:
get_button (FP_Read).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_Off).set_led_state (_output_port, false);
break;
case ARDOUR::Off:
get_button (FP_Read).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_Off).set_led_state (_output_port, true);
break;
}
}
void void
FaderPort::map_cut () FaderPort::map_cut ()
{ {
@ -1154,6 +1191,7 @@ FaderPort::map_route_state ()
map_recenable (); map_recenable ();
map_gain (); map_gain ();
map_cut (); map_cut ();
map_auto ();
} }
} }

View File

@ -295,6 +295,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
void map_recenable (); void map_recenable ();
void map_gain (); void map_gain ();
void map_cut (); void map_cut ();
void map_auto ();
void parameter_changed (std::string); void parameter_changed (std::string);
/* operations (defined in operations.cc) */ /* operations (defined in operations.cc) */