41 template <
typename Type>
45 return decibels > minusInfinityDb ? std::pow (Type (10.0), decibels * Type (0.05))
55 template <
typename Type>
59 return gain > Type() ?
jmax (minusInfinityDb,
static_cast<Type
> (std::log10 (gain)) * Type (20.0))
71 template <
typename Type>
73 int decimalPlaces = 2,
75 bool shouldIncludeSuffix =
true,
79 s.preallocateBytes (20);
81 if (decibels <= minusInfinityDb)
83 if (customMinusInfinityString.isEmpty())
86 s << customMinusInfinityString;
90 if (decibels >= Type())
93 if (decimalPlaces <= 0)
94 s << roundToInt (decibels);
96 s <<
String (decibels, decimalPlaces);
99 if (shouldIncludeSuffix)
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
static Type decibelsToGain(Type decibels, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Definition juce_Decibels.h:42
static Type gainToDecibels(Type gain, Type minusInfinityDb=Type(defaultMinusInfinitydB))
Definition juce_Decibels.h:56
static String toString(Type decibels, int decimalPlaces=2, Type minusInfinityDb=Type(defaultMinusInfinitydB), bool shouldIncludeSuffix=true, StringRef customMinusInfinityString={})
Definition juce_Decibels.h:72
@ defaultMinusInfinitydB
Definition juce_Decibels.h:107
Definition juce_String.h:53
Definition juce_StringRef.h:62
unsigned s
Definition inflate.c:1555
Definition carla_juce.cpp:31