diff options
author | Jan Lentfer <jan.lentfer@web.de> | 2020-02-12 21:05:27 +0100 |
---|---|---|
committer | Jan Lentfer <jan.lentfer@web.de> | 2020-02-12 21:37:52 +0100 |
commit | 260e7ad5a9349f1e73b168f5ca71da0f9a54ecdc (patch) | |
tree | dba4945c1dbaea7b1b1b95fcb928bfb866df3e35 /libs/surfaces/launch_control_xl | |
parent | c321bc82bb5c932f9df6cec82679476113a26e22 (diff) |
LCXL: Make the pan fix nice again
Diffstat (limited to 'libs/surfaces/launch_control_xl')
-rw-r--r-- | libs/surfaces/launch_control_xl/controllers.cc | 5 | ||||
-rw-r--r-- | libs/surfaces/launch_control_xl/launch_control_xl.cc | 11 | ||||
-rw-r--r-- | libs/surfaces/launch_control_xl/launch_control_xl.h | 4 |
3 files changed, 5 insertions, 15 deletions
diff --git a/libs/surfaces/launch_control_xl/controllers.cc b/libs/surfaces/launch_control_xl/controllers.cc index 4e93656618..aa881961af 100644 --- a/libs/surfaces/launch_control_xl/controllers.cc +++ b/libs/surfaces/launch_control_xl/controllers.cc @@ -879,9 +879,8 @@ LaunchControlXL::knob_pan(uint8_t n) } - if (ac && check_pick_up_rev(knob, ac)) { - DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("knob->value: '%1'\n", (int) knob->value())); - ac->set_value (ac->interface_to_internal ((127 - knob->value()) / 127.0), PBD::Controllable::UseGroup); + if (ac && check_pick_up(knob, ac, true)) { + ac->set_value (ac->interface_to_internal((knob->value() / 127.0), true), PBD::Controllable::UseGroup); } } diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index 0fd5cca763..925aae7bbb 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -614,17 +614,10 @@ LaunchControlXL::handle_button_message(boost::shared_ptr<Button> button, MIDI::E bool -LaunchControlXL::check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<AutomationControl> ac) +LaunchControlXL::check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<AutomationControl> ac, bool rotary) { /* 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 ); -} - -bool -LaunchControlXL::check_pick_up_rev (boost::shared_ptr<Controller> controller, boost::shared_ptr<AutomationControl> ac) -{ - /* returns false until 127 minus the controller value matches with the current setting of the stripable's ac */ - return (abs ((127 - controller->value()) / 127.0 - ac->internal_to_interface (ac->get_value())) < 0.007875); + return (abs (controller->value() / 127.0 - ac->internal_to_interface(ac->get_value(), rotary)) < 0.007875); } void diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.h b/libs/surfaces/launch_control_xl/launch_control_xl.h index af041a302c..920b640fcf 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.h +++ b/libs/surfaces/launch_control_xl/launch_control_xl.h @@ -495,9 +495,7 @@ private: void connect_to_parser(); void handle_button_message(boost::shared_ptr<Button> button, MIDI::EventTwoBytes *); - bool check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<ARDOUR::AutomationControl> ac); - bool check_pick_up_rev(boost::shared_ptr<Controller> controller, boost::shared_ptr<ARDOUR::AutomationControl> ac); - + bool check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<ARDOUR::AutomationControl> ac, bool rotary = false); void handle_midi_controller_message(MIDI::Parser &, MIDI::EventTwoBytes *, MIDI::channel_t chan); void handle_midi_note_on_message(MIDI::Parser &, MIDI::EventTwoBytes *, MIDI::channel_t chan); |