diff --git a/sfizz/Synth.cpp b/sfizz/Synth.cpp index 721f6b70..fc79c512 100644 --- a/sfizz/Synth.cpp +++ b/sfizz/Synth.cpp @@ -293,13 +293,14 @@ sfz::Voice* sfz::Synth::findFreeVoice() noexcept return {}; } -void sfz::Synth::getNumActiveVoices() const noexcept +int sfz::Synth::getNumActiveVoices() const noexcept { auto activeVoices { 0 }; for (const auto& voice : voices) { if (!voice->isFree()) activeVoices++; } + return activeVoices; } void sfz::Synth::garbageCollect() noexcept diff --git a/sfizz/Synth.h b/sfizz/Synth.h index 24fd9604..13c10e9e 100644 --- a/sfizz/Synth.h +++ b/sfizz/Synth.h @@ -59,7 +59,7 @@ public: void aftertouch(int delay, int channel, uint8_t aftertouch) noexcept; void tempo(int delay, float secondsPerQuarter) noexcept; - void getNumActiveVoices() const noexcept; + int getNumActiveVoices() const noexcept; void garbageCollect() noexcept; protected: void callback(absl::string_view header, const std::vector& members) final;