Handle wide chars on windows
This commit is contained in:
parent
a29f07a27f
commit
5a21c52164
1 changed files with 5 additions and 5 deletions
|
|
@ -108,7 +108,7 @@ absl::optional<sfz::FilePool::FileInformation> sfz::FilePool::getFileInformation
|
|||
if (!fs::exists(file))
|
||||
return {};
|
||||
|
||||
SndfileHandle sndFile(file.c_str());
|
||||
SndfileHandle sndFile(file.string().c_str());
|
||||
if (sndFile.channels() != 1 && sndFile.channels() != 2) {
|
||||
DBG("Missing logic for " << sndFile.channels() << " channels, discarding sample " << filename);
|
||||
return {};
|
||||
|
|
@ -135,7 +135,7 @@ bool sfz::FilePool::preloadFile(const std::string& filename, uint32_t maxOffset)
|
|||
if (!fs::exists(file))
|
||||
return false;
|
||||
|
||||
SndfileHandle sndFile(file.c_str());
|
||||
SndfileHandle sndFile(file.string().c_str());
|
||||
if (sndFile.channels() != 1 && sndFile.channels() != 2)
|
||||
return false;
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ void sfz::FilePool::setPreloadSize(uint32_t preloadSize) noexcept
|
|||
const auto numFrames = preloadedFile.second.preloadedData->getNumFrames() / static_cast<int>(oversamplingFactor);
|
||||
const uint32_t maxOffset = numFrames > this->preloadSize ? numFrames - this->preloadSize : 0;
|
||||
fs::path file { rootDirectory / std::string(preloadedFile.first) };
|
||||
SndfileHandle sndFile(file.c_str());
|
||||
SndfileHandle sndFile(file.string().c_str());
|
||||
preloadedFile.second.preloadedData = readFromFile<float>(sndFile, preloadSize + maxOffset, oversamplingFactor);
|
||||
}
|
||||
this->preloadSize = preloadSize;
|
||||
|
|
@ -248,7 +248,7 @@ void sfz::FilePool::loadingThread() noexcept
|
|||
[[maybe_unused]] const auto waitDurationMillis = std::chrono::duration<double,std::milli>(waitDuration).count();
|
||||
|
||||
fs::path file { rootDirectory / std::string(promise->filename) };
|
||||
SndfileHandle sndFile(file.c_str());
|
||||
SndfileHandle sndFile(file.string().c_str());
|
||||
if (sndFile.error() != 0) {
|
||||
DBG("[sfizz] libsndfile errored for " << promise->filename << " with message " << sndFile.strError());
|
||||
continue;
|
||||
|
|
@ -328,7 +328,7 @@ void sfz::FilePool::setOversamplingFactor(sfz::Oversampling factor) noexcept
|
|||
const auto numFrames = preloadedFile.second.preloadedData->getNumFrames() / static_cast<int>(this->oversamplingFactor);
|
||||
const uint32_t maxOffset = numFrames > this->preloadSize ? numFrames - this->preloadSize : 0;
|
||||
fs::path file { rootDirectory / std::string(preloadedFile.first) };
|
||||
SndfileHandle sndFile(file.c_str());
|
||||
SndfileHandle sndFile(file.string().c_str());
|
||||
preloadedFile.second.preloadedData = readFromFile<float>(sndFile, preloadSize + maxOffset, factor);
|
||||
preloadedFile.second.sampleRate *= samplerateChange;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue