Browse Source

Revise Param documentation. Fix Param::getDisplayValue() formula for logarithmic bases.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
3634059dcd
2 changed files with 3 additions and 4 deletions
  1. +2
    -3
      include/engine/Param.hpp
  2. +1
    -1
      src/app/ParamQuantity.cpp

+ 2
- 3
include/engine/Param.hpp View File

@@ -37,11 +37,10 @@ struct Param {
*/
std::string label;
/** The numerical unit of measurement appended to the value.
Use a space before non-abbreviations to separate the numerical value.
e.g. " semitones", "Hz", "%", "V"
Use a space before units to separate the numerical value from the number (e.g. " semitones", " Hz", " V"), unless the unit should have no space (e.g. "%", "º").
*/
std::string unit;
/** Set to 0 for linear, nonzero for exponential. */
/** Set to 0 for linear, positive for exponential, negative for logarithmic. */
float displayBase = 0.f;
float displayMultiplier = 1.f;
float displayOffset = 0.f;


+ 1
- 1
src/app/ParamQuantity.cpp View File

@@ -85,7 +85,7 @@ void ParamQuantity::setDisplayValue(float displayValue) {
}
else if (displayBase < 0.f) {
// Logarithmic
v = std::pow(displayBase, v);
v = std::pow(-displayBase, v);
}
else {
// Exponential


Loading…
Cancel
Save