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

Method bypassModule

src/override/Engine.cpp:883–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881
882
883void Engine::bypassModule(Module* module, bool bypassed) {
884 DISTRHO_SAFE_ASSERT_RETURN(module,);
885 if (module->isBypassed() == bypassed)
886 return;
887
888 std::lock_guard<SharedMutex> lock(internal->mutex);
889
890 // Clear outputs and set to 1 channel
891 for (Output& output : module->outputs) {
892 // This zeros all voltages, but the channel is set to 1 if connected
893 output.setChannels(0);
894 }
895 // Set bypassed state
896 module->setBypassed(bypassed);
897 if (bypassed) {
898 // Dispatch BypassEvent
899 Module::BypassEvent eBypass;
900 module->onBypass(eBypass);
901 }
902 else {
903 // Dispatch UnBypassEvent
904 Module::UnBypassEvent eUnBypass;
905 module->onUnBypass(eUnBypass);
906 }
907}
908
909
910json_t* Engine::moduleToJson(Module* module) {

Callers 1

bypassActionMethod · 0.80

Calls 1

setChannelsMethod · 0.45

Tested by

no test coverage detected