20 #include <pluginterfaces/vst/ivstaudioprocessor.h> 23 #include <type_traits> 28 using namespace Steinberg;
29 using namespace Steinberg::Vst;
31 #define BIT_SET(a,b) ((a) |= (static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b))) 32 #define BIT_CLEAR(a,b) ((a) &= ~(static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b))) 33 #define BIT_TEST(a,b) (((a) & (static_cast<std::make_unsigned_t<decltype(a)>>(1)<<(b))) != 0) 37 constexpr T
bitSet(T a,
int bit) {
return a | (
static_cast<std::make_unsigned_t<T>
>(1) << bit); }
41 constexpr T
bitClear(T a,
int bit) {
return a & ~(
static_cast<std::make_unsigned_t<T>
>(1) << bit); }
45 constexpr
bool bitTest(T a,
int bit) {
return (a & (
static_cast<std::make_unsigned_t<T>
>(1) << bit)) != 0; }
52 template<
typename SampleType>
82 template<
typename SampleType>
85 return static_cast<SampleType>(std::pow(10.0, valueInDb / 20.0));
91 template<
typename SampleType>
94 return std::log10(valueInSample) * 20.0;
SampleType dbToSample(double valueInDb)
Definition: AudioUtils.h:83
constexpr Sample64 getSampleSilentThreshold< Sample64 >() noexcept
Definition: AudioUtils.h:57
SampleType getSampleSilentThreshold() noexcept
bool isSilent(Sample32 value)
Definition: AudioUtils.h:62
constexpr Sample32 Sample32SilentThreshold
Definition: AudioUtils.h:48
constexpr T bitSet(T a, int bit)
Sets bit bit in a
Definition: AudioUtils.h:37
constexpr Sample64 Sample64SilentThreshold
Definition: AudioUtils.h:49
double sampleToDb(SampleType valueInSample)
Definition: AudioUtils.h:92
constexpr T bitClear(T a, int bit)
Clears bit bit in a
Definition: AudioUtils.h:41
constexpr bool bitTest(T a, int bit)
Test if bit bit is set in a
Definition: AudioUtils.h:45