Added the number of log elements in the message

This commit is contained in:
Paul Fd 2020-02-27 10:27:42 +01:00
parent 3b9683e66f
commit 3346bbee28
2 changed files with 11 additions and 10 deletions

View file

@ -65,7 +65,7 @@ sfz::Logger::~Logger()
<< prefix
<< "_file_log.csv";
fs::path fileLogPath{ fs::current_path() / fileLogFilename.str() };
std::cout << "Logging file times to " << fileLogPath.filename() << '\n';
std::cout << "Logging " << fileTimes.size() << " file times to " << fileLogPath.filename() << '\n';
std::ofstream loadLogFile { fileLogPath.native() };
loadLogFile << "WaitDuration,LoadDuration,FileSize,FileName" << '\n';
for (auto& time: fileTimes)
@ -81,7 +81,7 @@ sfz::Logger::~Logger()
<< prefix
<< "_callback_log.csv";
fs::path callbackLogPath{ fs::current_path() / callbackLogFilename.str() };
std::cout << "Logging callback times to " << callbackLogPath.filename() << '\n';
std::cout << "Logging " << callbackTimes.size() << " callback times to " << callbackLogPath.filename() << '\n';
std::ofstream callbackLogFile { callbackLogPath.native() };
callbackLogFile << "Dispatch,RenderMethod,Data,Amplitude,Filters,Panning,NumVoices,NumSamples" << '\n';
for (auto& time: callbackTimes)

View file

@ -410,21 +410,22 @@ void sfz::Synth::setSampleRate(float sampleRate) noexcept
void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
{
ScopedFTZ ftz;
if (freeWheeling)
resources.filePool.waitForBackgroundLoading();
AtomicGuard callbackGuard { inCallback };
if (!canEnterCallback)
return;
CallbackBreakdown callbackBreakdown;
int numActiveVoices { 0 };
{ // Main render block
ScopedLogger logger { callbackBreakdown.renderMethod };
buffer.fill(0.0f);
resources.filePool.cleanupPromises();
if (freeWheeling)
resources.filePool.waitForBackgroundLoading();
AtomicGuard callbackGuard { inCallback };
if (!canEnterCallback)
return;
auto tempSpan = AudioSpan<float>(tempBuffer).first(buffer.getNumFrames());
for (auto& voice : voices) {