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

Method customControlCallbackIdle

hi_scripting/scripting/ScriptProcessor.cpp:351–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350
351void ProcessorWithScriptingContent::customControlCallbackIdle(ScriptingApi::Content::ScriptComponent *component, const var& controllerValue, Result& r)
352{
353 ScopedValueSetter<bool> objectConstructorSetter(allowObjectConstructors, true);
354
355
356 getMainController_()->getDebugLogger().logParameterChange(thisAsJavascriptProcessor, component, controllerValue);
357
358 auto callback = component->getCustomControlCallback();
359
360 var fVar(callback);
361 var args[2] = { var(component), controllerValue };
362
363 if (auto scriptEngine = thisAsJavascriptProcessor->getScriptEngine())
364 {
365 LockHelpers::SafeLock sl(getMainController_(), LockHelpers::Type::ScriptLock);
366
367 scriptEngine->maximumExecutionTime = HiseJavascriptEngine::getDefaultTimeOut();
368
369#if ENABLE_SCRIPTING_BREAKPOINTS
370 thisAsJavascriptProcessor->breakpointWasHit(-1);
371#endif
372
373 scriptEngine->executeInlineFunction(fVar, args, &r);
374
375 BACKEND_ONLY(if (!r.wasOk()) debugError(dynamic_cast<Processor*>(this), r.getErrorMessage()));
376 }
377
378#if 0
379#if USE_BACKEND
380 if (!r.wasOk())
381 {
382 auto inlineF = dynamic_cast<HiseJavascriptEngine::RootObject::InlineFunction::Object*>(fVar.getObject());
383
384 if (inlineF != nullptr)
385 {
386 debugError(dynamic_cast<Processor*>(this), r.getErrorMessage());
387 }
388 }
389#endif
390#endif
391}
392
393ScriptBaseMidiProcessor::ScriptBaseMidiProcessor(MainController* mc, const String& id):
394 MidiProcessor(mc, id),

Callers 1

controlCallbackMethod · 0.80

Calls 11

varFunction · 0.85
getDefaultTimeOutFunction · 0.85
logParameterChangeMethod · 0.80
getScriptEngineMethod · 0.80
breakpointWasHitMethod · 0.80
executeInlineFunctionMethod · 0.80
ifFunction · 0.50
wasOkMethod · 0.45
getErrorMessageMethod · 0.45
getObjectMethod · 0.45

Tested by

no test coverage detected