Trying to make tidy happy
This commit is contained in:
parent
fb190340a3
commit
0c68e40cc4
3 changed files with 22 additions and 7 deletions
|
|
@ -70,7 +70,8 @@ sfz::Logger::~Logger()
|
||||||
loadLogFile << time.waitDuration.count() << ','
|
loadLogFile << time.waitDuration.count() << ','
|
||||||
<< time.loadDuration.count() << ','
|
<< time.loadDuration.count() << ','
|
||||||
<< time.fileSize << ','
|
<< time.fileSize << ','
|
||||||
<< time.filename << '\n';
|
<< "disabled" << '\n';
|
||||||
|
// << time.filename << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!callbackTimes.empty()) {
|
if (!callbackTimes.empty()) {
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,25 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class ModifierArray : public std::array<T, (size_t)Mod::sentinel> {
|
class ModifierArray {
|
||||||
public:
|
public:
|
||||||
T& operator[](sfz::Mod idx) { return this->std::array<T, (size_t)Mod::sentinel>::operator[](static_cast<size_t>(idx)); }
|
using ContainerType = typename std::array<T, (size_t)Mod::sentinel>;
|
||||||
const T& operator[](sfz::Mod idx) const { return this->std::array<T, (size_t)Mod::sentinel>::operator[](static_cast<size_t>(idx)); }
|
using iterator = typename ContainerType::iterator;
|
||||||
|
using const_iterator = typename ContainerType::const_iterator;
|
||||||
|
ModifierArray() = default;
|
||||||
|
ModifierArray(T val)
|
||||||
|
{
|
||||||
|
std::fill(underlying.begin(), underlying.end(), val);
|
||||||
|
}
|
||||||
|
ModifierArray(std::array<T, (size_t)Mod::sentinel>&& array) : underlying(array) {}
|
||||||
|
T& operator[](sfz::Mod idx) { return underlying.operator[](static_cast<size_t>(idx)); }
|
||||||
|
const T& operator[](sfz::Mod idx) const { return underlying.operator[](static_cast<size_t>(idx)); }
|
||||||
|
iterator begin() { return underlying.begin(); }
|
||||||
|
iterator end() { return underlying.end(); }
|
||||||
|
const_iterator begin() const { return underlying.begin(); }
|
||||||
|
const_iterator end() const { return underlying.end(); }
|
||||||
|
private:
|
||||||
|
ContainerType underlying {};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,7 +57,7 @@ public:
|
||||||
* Should fail at compile time if you update the modifiers but not this.
|
* Should fail at compile time if you update the modifiers but not this.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static const ModifierArray<Mod> allModifiers = {{
|
static const ModifierArray<Mod> allModifiers {{
|
||||||
Mod::amplitude,
|
Mod::amplitude,
|
||||||
Mod::pan,
|
Mod::pan,
|
||||||
Mod::width,
|
Mod::width,
|
||||||
|
|
|
||||||
|
|
@ -845,8 +845,7 @@ void sfz::Voice::resetSmoothers() noexcept
|
||||||
for (auto& mod : allModifiers) {
|
for (auto& mod : allModifiers) {
|
||||||
const auto resetValue = [mod] {
|
const auto resetValue = [mod] {
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
case Mod::volume:
|
case Mod::volume: // fallthrough
|
||||||
return 1.0f;
|
|
||||||
case Mod::pitch:
|
case Mod::pitch:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue