13
0

LCXL: Make the pan fix nice again

This commit is contained in:
Jan Lentfer 2020-02-12 21:05:27 +01:00
parent c321bc82bb
commit 260e7ad5a9
3 changed files with 5 additions and 15 deletions

View File

@ -879,9 +879,8 @@ LaunchControlXL::knob_pan(uint8_t n)
} }
if (ac && check_pick_up_rev(knob, ac)) { if (ac && check_pick_up(knob, ac, true)) {
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("knob->value: '%1'\n", (int) knob->value())); ac->set_value (ac->interface_to_internal((knob->value() / 127.0), true), PBD::Controllable::UseGroup);
ac->set_value (ac->interface_to_internal ((127 - knob->value()) / 127.0), PBD::Controllable::UseGroup);
} }
} }

View File

@ -614,17 +614,10 @@ LaunchControlXL::handle_button_message(boost::shared_ptr<Button> button, MIDI::E
bool 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 */ /* 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 ); return (abs (controller->value() / 127.0 - ac->internal_to_interface(ac->get_value(), rotary)) < 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);
} }
void void

View File

@ -495,9 +495,7 @@ private:
void connect_to_parser(); void connect_to_parser();
void handle_button_message(boost::shared_ptr<Button> button, MIDI::EventTwoBytes *); 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(boost::shared_ptr<Controller> controller, boost::shared_ptr<ARDOUR::AutomationControl> ac, bool rotary = false);
bool check_pick_up_rev(boost::shared_ptr<Controller> controller, boost::shared_ptr<ARDOUR::AutomationControl> ac);
void handle_midi_controller_message(MIDI::Parser &, MIDI::EventTwoBytes *, MIDI::channel_t chan); 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); void handle_midi_note_on_message(MIDI::Parser &, MIDI::EventTwoBytes *, MIDI::channel_t chan);