MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / widgetCreated

Method widgetCreated

plugins/Cardinal/src/Carla.cpp:558–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556 }
557
558 void widgetCreated()
559 {
560 if (module == nullptr || module->pcontext == nullptr || module->fCarlaHostHandle == nullptr)
561 return;
562
563 const CarlaHostHandle handle = module->fCarlaHostHandle;
564 const CardinalPluginContext* const pcontext = module->pcontext;
565
566 char winIdStr[24];
567 std::snprintf(winIdStr, sizeof(winIdStr), "%llx", (ulonglong)pcontext->nativeWindowId);
568
569 module->fCarlaHostDescriptor.uiParentId = pcontext->nativeWindowId;
570 carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr);
571
572 if (pcontext->window != nullptr)
573 carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_UI_SCALE, pcontext->window->pixelRatio*1000, nullptr);
574
575 if (! idleCallbackActive)
576 idleCallbackActive = pcontext->addIdleCallback(this);
577
578 module->fUI = this;
579 }
580
581 void widgetDestroyed()
582 {

Callers

nothing calls this directly

Calls 1

addIdleCallbackMethod · 0.45

Tested by

no test coverage detected