MCPcopy Create free account
hub / github.com/VCVRack/Rack / setMasterModule_NoLock

Method setMasterModule_NoLock

src/engine/Engine.cpp:611–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609
610
611void Engine::setMasterModule_NoLock(Module* module) {
612 if (module == internal->masterModule)
613 return;
614
615 if (internal->masterModule) {
616 // Dispatch UnsetMasterEvent
617 Module::UnsetMasterEvent e;
618 internal->masterModule->onUnsetMaster(e);
619 }
620
621 internal->masterModule = module;
622
623 if (internal->masterModule) {
624 // Dispatch SetMasterEvent
625 Module::SetMasterEvent e;
626 internal->masterModule->onSetMaster(e);
627 }
628
629 // Wake up fallback thread if master module was unset
630 if (!internal->masterModule) {
631 internal->fallbackCv.notify_all();
632 }
633}
634
635
636Module* Engine::getMasterModule() {

Callers 1

onStopStreamMethod · 0.80

Calls 2

onUnsetMasterMethod · 0.80
onSetMasterMethod · 0.80

Tested by

no test coverage detected