Corrected a bug with getNumActiveVoices()
This commit is contained in:
parent
508cdd729a
commit
ed474de713
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<Opcode>& members) final;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue