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

Method setFile

hi_scripting/scripting/api/ScriptingApiObjects.cpp:4465–4489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4463}
4464
4465void ScriptingObjects::ScriptingAudioSampleProcessor::setFile(String fileName)
4466{
4467 if (checkValidObject())
4468 {
4469
4470#if USE_BACKEND
4471 auto pool = audioSampleProcessor->getMainController()->getCurrentAudioSampleBufferPool();
4472
4473 if (!fileName.contains("{EXP::") && !pool->areAllFilesLoaded())
4474 {
4475 PoolReference ref(getScriptProcessor()->getMainController_(), fileName, FileHandlerBase::AudioFiles);
4476
4477 if (ref.getReferenceString().contains("{PROJECT_FOLDER}"))
4478 {
4479 reportScriptError("You must call Engine.loadAudioFilesIntoPool() before using this method");
4480 }
4481 }
4482
4483#endif
4484
4485 auto p = dynamic_cast<ProcessorWithExternalData*>(audioSampleProcessor.get());
4486 jassert(p != nullptr);
4487 p->getAudioFile(0)->fromBase64String(fileName);
4488 }
4489}
4490
4491String ScriptingObjects::ScriptingAudioSampleProcessor::getFilename()
4492{

Callers

nothing calls this directly

Calls 15

areAllFilesLoadedMethod · 0.80
getMainController_Method · 0.80
getReferenceStringMethod · 0.80
clearSequencesMethod · 0.80
loadMidiFileMethod · 0.80
getMainControllerMethod · 0.45
containsMethod · 0.45
getMethod · 0.45
fromBase64StringMethod · 0.45
getAudioFileMethod · 0.45

Tested by

no test coverage detected