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

Function uiIdle

src/CardinalUI.cpp:538–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536 }
537
538 void uiIdle() override
539 {
540 #ifdef DPF_RUNTIME_TESTING
541 if (inSelfTest)
542 {
543 context->window->step();
544 return;
545 }
546
547 if (context->plugin->isSelfTestInstance())
548 {
549 inSelfTest = true;
550
551 Application& app(getApp());
552
553 const ScopedContext sc(this);
554
555 context->patch->clear();
556 app.idle();
557
558 const rack::math::Vec mousePos(getWidth()/2,getHeight()/2);
559 context->event->handleButton(mousePos, GLFW_MOUSE_BUTTON_LEFT, GLFW_RELEASE, 0x0);
560 context->event->handleHover(mousePos, rack::math::Vec(0,0));
561 app.idle();
562
563 for (rack::plugin::Plugin* p : rack::plugin::plugins)
564 {
565 for (rack::plugin::Model* m : p->models)
566 {
567 d_stdout(">>>>>>>>>>>>>>>>> LOADING module %s : %s", p->slug.c_str(), m->slug.c_str());
568 rack::engine::Module* const module = m->createModule();
569 DISTRHO_SAFE_ASSERT_CONTINUE(module != nullptr);
570
571 rack::CardinalPluginModelHelper* const helper = dynamic_cast<rack::CardinalPluginModelHelper*>(m);
572 DISTRHO_SAFE_ASSERT_CONTINUE(helper != nullptr);
573
574 d_stdout(">>>>>>>>>>>>>>>>> LOADING moduleWidget %s : %s", p->slug.c_str(), m->slug.c_str());
575 rack::app::ModuleWidget* const moduleWidget = helper->createModuleWidget(module);
576 DISTRHO_SAFE_ASSERT_CONTINUE(moduleWidget != nullptr);
577
578 d_stdout(">>>>>>>>>>>>>>>>> ADDING TO ENGINE %s : %s", p->slug.c_str(), m->slug.c_str());
579 context->engine->addModule(module);
580
581 d_stdout(">>>>>>>>>>>>>>>>> ADDING TO RACK VIEW %s : %s", p->slug.c_str(), m->slug.c_str());
582 context->scene->rack->addModuleAtMouse(moduleWidget);
583
584 for (int i=5; --i>=0;)
585 app.idle();
586
587 d_stdout(">>>>>>>>>>>>>>>>> REMOVING FROM RACK VIEW %s : %s", p->slug.c_str(), m->slug.c_str());
588 context->scene->rack->removeModule(moduleWidget);
589 app.idle();
590
591 d_stdout(">>>>>>>>>>>>>>>>> DELETING module + moduleWidget %s : %s", p->slug.c_str(), m->slug.c_str());
592 delete moduleWidget;
593
594 app.idle();
595 }

Callers

nothing calls this directly

Calls 10

VecClass · 0.85
c_strMethod · 0.80
createModuleWidgetMethod · 0.80
addModuleMethod · 0.80
stepBlockMethod · 0.80
stepMethod · 0.45
isSelfTestInstanceMethod · 0.45
clearMethod · 0.45
createModuleMethod · 0.45
removeModuleMethod · 0.45

Tested by

no test coverage detected