From 623eb652a7d8300a11f0ff5c72f1062dbfb7252c Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 1 Nov 2021 01:51:19 +0100 Subject: [PATCH] jsfx: compile the file once only during init --- source/backend/plugin/CarlaPluginJSFX.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/source/backend/plugin/CarlaPluginJSFX.cpp b/source/backend/plugin/CarlaPluginJSFX.cpp index 34766be08..d5c532a54 100644 --- a/source/backend/plugin/CarlaPluginJSFX.cpp +++ b/source/backend/plugin/CarlaPluginJSFX.cpp @@ -283,18 +283,6 @@ public: // --------------------------------------------------------------- - // TODO(jsfx) uncomment when implementing these features - const int compileFlags = 0 - //| JsusFx::kCompileFlag_CompileGraphicsSection - | JsusFx::kCompileFlag_CompileSerializeSection - ; - - { - const CarlaScopedLocale csl; - if (!fEffect->compile(*fPathLibrary, fFilename, compileFlags)) - carla_stderr("Failed to compile JSFX"); - } - // initialize the block size and sample rate // loading the chunk can invoke @slider which makes computations based on these fEffect->prepare(pData->engine->getSampleRate(), pData->engine->getBufferSize()); @@ -910,9 +898,16 @@ public: { const CarlaScopedLocale csl; - if (!fEffect->readHeader(*fPathLibrary, fFilename)) + + // TODO(jsfx) uncomment when implementing these features + const int compileFlags = 0 + //| JsusFx::kCompileFlag_CompileGraphicsSection + | JsusFx::kCompileFlag_CompileSerializeSection + ; + + if (!fEffect->compile(*fPathLibrary, fFilename, compileFlags)) { - pData->engine->setLastError("Cannot read the JSFX header"); + pData->engine->setLastError("Failed to compile JSFX"); return false; } }