@@ -106,10 +106,10 @@ Examples: | |||||
std::string getExtension(const std::string& path); | std::string getExtension(const std::string& path); | ||||
/** Compresses the contents of a folder (recursively) to an archive. | /** Compresses the contents of a folder (recursively) to an archive. | ||||
Currently supports the "ustar zstd" format (.tar.zst) | |||||
Uses the Unix Standard TAR + Zstandard format (.tar.zst). | |||||
An equivalent shell command is | An equivalent shell command is | ||||
tar -cf archivePath --zstd -C folderPath . | |||||
ZSTD_CLEVEL=1 tar -cf archivePath --zstd -C folderPath . | |||||
*/ | */ | ||||
void archiveFolder(const std::string& archivePath, const std::string& folderPath, int compressionLevel = 1); | void archiveFolder(const std::string& archivePath, const std::string& folderPath, int compressionLevel = 1); | ||||
/** Extracts an archive into a folder. | /** Extracts an archive into a folder. | ||||
@@ -505,6 +505,7 @@ void ModuleWidget::onHoverKey(const event::HoverKey& e) { | |||||
void ModuleWidget::onDragStart(const event::DragStart& e) { | void ModuleWidget::onDragStart(const event::DragStart& e) { | ||||
if (e.button == GLFW_MOUSE_BUTTON_LEFT) { | if (e.button == GLFW_MOUSE_BUTTON_LEFT) { | ||||
internal->dragPos = APP->scene->rack->mousePos.minus(box.pos); | internal->dragPos = APP->scene->rack->mousePos.minus(box.pos); | ||||
DEBUG("drag (%f, %f)", VEC_ARGS(internal->dragPos)); | |||||
APP->scene->rack->updateModuleOldPositions(); | APP->scene->rack->updateModuleOldPositions(); | ||||
} | } | ||||
} | } | ||||
@@ -352,7 +352,7 @@ static void Engine_stepModulesWorker(Engine* that, int threadId) { | |||||
// Stop CPU timer | // Stop CPU timer | ||||
if (cpuMeter) { | if (cpuMeter) { | ||||
double endTime = system::getTime(); | double endTime = system::getTime(); | ||||
float duration = (endTime - startTime) / 1e9; | |||||
float duration = endTime - startTime; | |||||
// Smooth CPU time | // Smooth CPU time | ||||
const float cpuTau = 2.f /* seconds */; | const float cpuTau = 2.f /* seconds */; | ||||
@@ -571,6 +571,7 @@ void Engine::step(int frames) { | |||||
if (internal->sampleRate != settings::sampleRate) { | if (internal->sampleRate != settings::sampleRate) { | ||||
internal->sampleRate = settings::sampleRate; | internal->sampleRate = settings::sampleRate; | ||||
internal->sampleTime = 1.f / internal->sampleRate; | internal->sampleTime = 1.f / internal->sampleRate; | ||||
// Trigger SampleRateChangeEvent | |||||
Module::SampleRateChangeEvent e; | Module::SampleRateChangeEvent e; | ||||
e.sampleRate = internal->sampleRate; | e.sampleRate = internal->sampleRate; | ||||
e.sampleTime = internal->sampleTime; | e.sampleTime = internal->sampleTime; | ||||
@@ -594,6 +595,11 @@ void Engine::step(int frames) { | |||||
} | } | ||||
yieldWorkers(); | yieldWorkers(); | ||||
double endTime = system::getTime(); | |||||
float duration = endTime - internal->stepTime; | |||||
float stepDuration = internal->stepFrames * internal->sampleTime; | |||||
DEBUG("%d %f / %f = %f%%", internal->stepFrames, duration, stepDuration, duration / stepDuration * 100.f); | |||||
} | } | ||||