45 template <
typename Type>
59 template <
typename Type>
63 return gain > Type() ? jmax (
minusInfinityDb,
static_cast<Type
> (std::log10 (gain)) * Type (20.0))
75 template <
typename Type>
83 s.preallocateBytes (20);
94 if (decibels >= Type())
97 if (decimalPlaces <= 0)
98 s << roundToInt (decibels);
100 s << String (decibels, decimalPlaces);
103 if (shouldIncludeSuffix)
111 enum { defaultMinusInfinitydB = -100 };
Holds a resizable array of primitive or copy-by-value objects.
bool isEmpty() const noexcept
Returns true if the array is empty, false otherwise.
This class contains some helpful static methods for dealing with decibel values.
static Type decibelsToGain(Type decibels, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Converts a dBFS value to its equivalent gain level.
static Type gainToDecibels(Type gain, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Converts a gain level into a dBFS value.
static String toString(Type decibels, int decimalPlaces=2, Type minusInfinityDb=Type(defaultMinusInfinitydB), bool shouldIncludeSuffix=true, StringRef customMinusInfinityString={})
Converts a decibel reading to a string.
A simple class for holding temporary references to a string literal or String.