diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-13 17:47:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-13 17:47:39 +0000 |
commit | c0bb288ff148274bd258562b0c718aa5e009cca0 (patch) | |
tree | bbc0c9f9c2757e73d01e5fe2e10e7812a96ebd5b /libs/ardour/ardour | |
parent | 55c7a3bf01ddbc22620eccbf682f5094e6be97e3 (diff) |
change handling of MIDI gain so that we present a linear fader spanning 0..127. this is based on the realization that we actually have no idea what the MIDI receiver will do with velocity and/or CC #7 values, and so trying to pretend that we can provide some kind of dB value in the display or the behaviour of the fader is completely wrong; ALSO: fix keyboard entry of fader levels for non EN locales (#5027)
git-svn-id: svn://localhost/ardour2/branches/3.0@13480 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/amp.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index 46dbdba227..dcffb1bcdb 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -102,7 +102,17 @@ public: } std::string value_as_string (boost::shared_ptr<AutomationControl>) const; - + + static const float max_gain_coefficient; + + inline static float gain_coefficient_to_midi_velocity_factor (gain_t v) { + return (v/max_gain_coefficient); + } + + inline static gain_t midi_velocity_factor_to_gain_coefficient (float v) { + return v * max_gain_coefficient; + } + private: bool _denormal_protection; bool _apply_gain; |