| 349 | |
| 350 | |
| 351 | void 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 | |
| 393 | ScriptBaseMidiProcessor::ScriptBaseMidiProcessor(MainController* mc, const String& id): |
| 394 | MidiProcessor(mc, id), |
no test coverage detected