Browse Source

jsfx: compile the file once only during init

pull/1508/head
Jean Pierre Cimalando 4 years ago
parent
commit
623eb652a7
1 changed files with 9 additions and 14 deletions
  1. +9
    -14
      source/backend/plugin/CarlaPluginJSFX.cpp

+ 9
- 14
source/backend/plugin/CarlaPluginJSFX.cpp View File

@@ -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 // initialize the block size and sample rate
// loading the chunk can invoke @slider which makes computations based on these // loading the chunk can invoke @slider which makes computations based on these
fEffect->prepare(pData->engine->getSampleRate(), pData->engine->getBufferSize()); fEffect->prepare(pData->engine->getSampleRate(), pData->engine->getBufferSize());
@@ -910,9 +898,16 @@ public:


{ {
const CarlaScopedLocale csl; 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; return false;
} }
} }


Loading…
Cancel
Save