Careful with outer loop points and endings
This commit is contained in:
parent
97870c2989
commit
916e269bf6
1 changed files with 2 additions and 2 deletions
|
|
@ -177,7 +177,7 @@ absl::optional<sfz::FilePool::FileInformation> sfz::FilePool::getFileInformation
|
||||||
}
|
}
|
||||||
|
|
||||||
FileInformation returnedValue;
|
FileInformation returnedValue;
|
||||||
returnedValue.end = static_cast<uint32_t>(sndFile.frames());
|
returnedValue.end = static_cast<uint32_t>(sndFile.frames()) - 1;
|
||||||
returnedValue.sampleRate = static_cast<double>(sndFile.samplerate());
|
returnedValue.sampleRate = static_cast<double>(sndFile.samplerate());
|
||||||
returnedValue.numChannels = sndFile.channels();
|
returnedValue.numChannels = sndFile.channels();
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ absl::optional<sfz::FilePool::FileInformation> sfz::FilePool::getFileInformation
|
||||||
sndFile.command(SFC_GET_INSTRUMENT, &instrumentInfo, sizeof(instrumentInfo));
|
sndFile.command(SFC_GET_INSTRUMENT, &instrumentInfo, sizeof(instrumentInfo));
|
||||||
if (instrumentInfo.loop_count > 0) {
|
if (instrumentInfo.loop_count > 0) {
|
||||||
returnedValue.loopBegin = instrumentInfo.loops[0].start;
|
returnedValue.loopBegin = instrumentInfo.loops[0].start;
|
||||||
returnedValue.loopEnd = instrumentInfo.loops[0].end;
|
returnedValue.loopEnd = min(returnedValue.end, instrumentInfo.loops[0].end - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnedValue;
|
return returnedValue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue