| @@ -9,9 +9,4 @@ | |||||
| #include "water/water.h" | #include "water/water.h" | ||||
| // #include <juce_audio_basics/juce_audio_basics.h> | |||||
| // #include <juce_audio_formats/juce_audio_formats.h> | |||||
| // #include <juce_audio_processors/juce_audio_processors.h> | |||||
| // #include <juce_gui_basics/juce_gui_basics.h> | |||||
| #endif // SFZCOMMON_H_INCLUDED | #endif // SFZCOMMON_H_INCLUDED | ||||
| @@ -24,6 +24,6 @@ void dbgprintf(const char *msg, ...) | |||||
| va_end(args); | va_end(args); | ||||
| } | } | ||||
| #endif // JUCE_DEBUG | |||||
| #endif // DEBUG | |||||
| } | } | ||||
| @@ -117,6 +117,6 @@ void Sample::checkIfZeroed(const char *where) | |||||
| dbgprintf("Buffer zeroed at %s! (%lu zeros)", where, zero); | dbgprintf("Buffer zeroed at %s! (%lu zeros)", where, zero); | ||||
| } | } | ||||
| } | } | ||||
| #endif // JUCE_DEBUG | |||||
| #endif // DEBUG | |||||
| } | } | ||||
| @@ -21,7 +21,6 @@ class Sample | |||||
| { | { | ||||
| public: | public: | ||||
| explicit Sample(const water::File &fileIn) : file_(fileIn), buffer_(nullptr), sampleRate_(0), sampleLength_(0), loopStart_(0), loopEnd_(0) {} | explicit Sample(const water::File &fileIn) : file_(fileIn), buffer_(nullptr), sampleRate_(0), sampleLength_(0), loopStart_(0), loopEnd_(0) {} | ||||
| //explicit Sample(double sampleRateIn) : buffer_(nullptr), sampleRate_(sampleRateIn), sampleLength_(0), loopStart_(0), loopEnd_(0) {} | |||||
| virtual ~Sample(); | virtual ~Sample(); | ||||
| bool load(); | bool load(); | ||||
| @@ -74,9 +74,11 @@ | |||||
| decibel value lower than minusInfinityDb will return a gain of 0. | decibel value lower than minusInfinityDb will return a gain of 0. | ||||
| */ | */ | ||||
| static inline | static inline | ||||
| float decibelsToGain (const float decibels, const float minusInfinityDb = -100.0f) | |||||
| float decibelsToGain (const double decibels, const double minusInfinityDb = -100.0) | |||||
| { | { | ||||
| return decibels > minusInfinityDb ? std::pow (10.0f, decibels * 0.05f) : 0.0f; | |||||
| return decibels > minusInfinityDb | |||||
| ? static_cast<float>(std::pow(10.0, decibels * 0.05)) | |||||
| : 0.0f; | |||||
| } | } | ||||
| //===================================================================================================================== | //===================================================================================================================== | ||||