MCPcopy Create free account
hub / github.com/christophhart/HISE / loadAudioFilesIntoPool

Method loadAudioFilesIntoPool

hi_scripting/scripting/api/ScriptingApi.cpp:3197–3228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3195}
3196
3197var ScriptingApi::Engine::loadAudioFilesIntoPool()
3198{
3199#if USE_BACKEND
3200
3201 HiseJavascriptEngine::TimeoutExtender xt(dynamic_cast<JavascriptProcessor*>(getScriptProcessor())->getScriptEngine());
3202
3203 auto pool = getScriptProcessor()->getMainController_()->getCurrentAudioSampleBufferPool();
3204
3205 if(!pool->areAllFilesLoaded())
3206 pool->loadAllFilesFromProjectFolder();
3207
3208#endif
3209
3210 auto mc = getScriptProcessor()->getMainController_();
3211
3212 auto poolToLoad = mc->getSampleManager().getProjectHandler().pool.get();
3213
3214 if(FullInstrumentExpansion::isEnabled(mc))
3215 {
3216 if(auto e = mc->getExpansionHandler().getCurrentExpansion())
3217 poolToLoad = e->pool;
3218 }
3219
3220 auto allList = poolToLoad->getAudioSampleBufferPool().getListOfAllReferences(true);
3221
3222 Array<var> ar;
3223
3224 for (auto& ref : allList)
3225 ar.add(ref.getReferenceString());
3226
3227 return var(ar);
3228}
3229
3230var ScriptingApi::Engine::loadAudioFileIntoBufferArray(String audioFileReference)
3231{

Callers 1

IRLogic.jsFile · 0.80

Calls 11

varFunction · 0.85
getScriptEngineMethod · 0.80
getMainController_Method · 0.80
areAllFilesLoadedMethod · 0.80
getReferenceStringMethod · 0.80
getMethod · 0.45
getCurrentExpansionMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected