21#include <pluginterfaces/vst/ivstaudioprocessor.h>
30using namespace Steinberg;
31using namespace Steinberg::Vst;
33#define BIT_SET(a,b) ((a) |= (static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b)))
34#define BIT_CLEAR(a,b) ((a) &= ~(static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b)))
35#define BIT_TEST(a,b) (((a) & (static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b))) != 0)
39constexpr T
bitSet(T a,
int bit) {
return a | (
static_cast<std::make_unsigned_t<T>
>(1) << bit); }
43constexpr T
bitClear(T a,
int bit) {
return a & ~(
static_cast<std::make_unsigned_t<T>
>(1) << bit); }
47constexpr bool bitTest(T a,
int bit) {
return (a & (
static_cast<std::make_unsigned_t<T>
>(1) << bit)) != 0; }
54template<std::
floating_po
int SampleType>
84template<std::
floating_po
int SampleType>
87 return static_cast<SampleType
>(std::pow(10.0, valueInDb / 20.0));
93template<std::
floating_po
int SampleType>
96 return std::log10(valueInSample) * 20.0;
SampleType getSampleSilentThreshold() noexcept
constexpr bool bitTest(T a, int bit)
Test if bit bit is set in a.
Definition AudioUtils.h:47
bool isSilent(Sample32 value)
Definition AudioUtils.h:64
constexpr Sample64 getSampleSilentThreshold< Sample64 >() noexcept
Definition AudioUtils.h:59
SampleType dbToSample(double valueInDb)
Definition AudioUtils.h:85
constexpr Sample32 Sample32SilentThreshold
Definition AudioUtils.h:50
constexpr Sample64 Sample64SilentThreshold
Definition AudioUtils.h:51
double sampleToDb(SampleType valueInSample)
Definition AudioUtils.h:94
constexpr T bitClear(T a, int bit)
Clears bit bit in a.
Definition AudioUtils.h:43
constexpr T bitSet(T a, int bit)
Sets bit bit in a.
Definition AudioUtils.h:39