Cleaned up the voice source fetching
This commit is contained in:
parent
49bf4c229f
commit
a37e0fd71c
1 changed files with 5 additions and 2 deletions
|
|
@ -344,7 +344,9 @@ void sfz::Voice::processStereo(AudioSpan<float> buffer) noexcept
|
||||||
void sfz::Voice::fillWithData(AudioSpan<float> buffer) noexcept
|
void sfz::Voice::fillWithData(AudioSpan<float> buffer) noexcept
|
||||||
{
|
{
|
||||||
auto source { [&]() {
|
auto source { [&]() {
|
||||||
if (region->canUsePreloadedData() || !dataReady)
|
if (region->canUsePreloadedData())
|
||||||
|
return AudioSpan<const float>(*region->preloadedData);
|
||||||
|
else if (!dataReady)
|
||||||
return AudioSpan<const float>(*region->preloadedData);
|
return AudioSpan<const float>(*region->preloadedData);
|
||||||
else
|
else
|
||||||
return AudioSpan<const float>(*fileData);
|
return AudioSpan<const float>(*fileData);
|
||||||
|
|
@ -483,8 +485,9 @@ void sfz::Voice::reset() noexcept
|
||||||
|
|
||||||
void sfz::Voice::garbageCollect() noexcept
|
void sfz::Voice::garbageCollect() noexcept
|
||||||
{
|
{
|
||||||
if (state == State::idle && region == nullptr)
|
if (state == State::idle && region == nullptr) {
|
||||||
fileData.reset();
|
fileData.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sfz::Voice::expectFileData(unsigned ticket)
|
void sfz::Voice::expectFileData(unsigned ticket)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue