mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Add pick-up mode and use it for knobs and faders
The pick up mode ignores new controller values until they match with the current setting of the stripable's ac
This commit is contained in:
parent
a0e75893e0
commit
dab2513d9f
2 changed files with 11 additions and 2 deletions
|
|
@ -444,6 +444,13 @@ LaunchControlXL::handle_button_message(Button* button, MIDI::EventTwoBytes* ev)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
LaunchControlXL::check_pick_up(Controller* controller, boost::shared_ptr<AutomationControl> ac)
|
||||
{
|
||||
/* returns false until the controller value matches with the current setting of the stripable's ac */
|
||||
return ( abs( controller->value() / 127.0 - ac->internal_to_interface(ac->get_value()) ) < 0.007875 );
|
||||
}
|
||||
|
||||
void
|
||||
LaunchControlXL::handle_knob_message (Knob* knob)
|
||||
{
|
||||
|
|
@ -462,7 +469,7 @@ LaunchControlXL::handle_knob_message (Knob* knob)
|
|||
ac = stripable[chan]->pan_azimuth_control();
|
||||
}
|
||||
|
||||
if (ac) {
|
||||
if (ac && check_pick_up(knob, ac)) {
|
||||
ac->set_value ( ac->interface_to_internal( knob->value() / 127.0), PBD::Controllable::UseGroup );
|
||||
}
|
||||
}
|
||||
|
|
@ -476,7 +483,7 @@ LaunchControlXL::handle_fader_message (Fader* fader)
|
|||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> ac = stripable[fader->id()]->gain_control();
|
||||
if (ac) {
|
||||
if (ac && check_pick_up(fader, ac)) {
|
||||
ac->set_value ( ac->interface_to_internal( fader->value() / 127.0), PBD::Controllable::UseGroup );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue