X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nonlinear_fader.cpp;h=4892c6770517b5a8d465fcf9949a808e8332da47;hb=5d98f9d0c02273509a56ae1ba33d63b272023535;hp=b548c29493206bc6f5a3569ffc657f55f4178550;hpb=adaf88f2a3544bfd62bcdafa9b11d190f6658010;p=nageru diff --git a/nonlinear_fader.cpp b/nonlinear_fader.cpp index b548c29..4892c67 100644 --- a/nonlinear_fader.cpp +++ b/nonlinear_fader.cpp @@ -1,15 +1,18 @@ +#include "nonlinear_fader.h" + #include #include -#include -#include -#include - -#include #include +#include +#include #include -#include +#include +#include +#include +#include -#include "nonlinear_fader.h" +class QPaintEvent; +class QWidget; using namespace std; @@ -17,8 +20,11 @@ namespace { vector> fader_control_points = { // The main area is from +6 to -12 dB (18 dB), and we use half the slider range for it. + // Adjust slightly so that the MIDI controller value of 106 becomes exactly 0.0 dB + // (cf. map_controller_to_float()); otherwise, we'd miss ever so slightly, which is + // really frustrating. { 6.0, 1.0 }, - { -12.0, 0.5 }, + { -12.0, 1.0 - (1.0 - 106.5/127.0) * 3.0 }, // About 0.492. // -12 to -21 is half the range (9 dB). Halve. { -21.0, 0.325 },