MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / ShouldDimModule

Method ShouldDimModule

Source/ModularSynth.cpp:1816–1840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1814}
1815
1816bool ModularSynth::ShouldDimModule(IDrawableModule* module)
1817{
1818 if (TheSynth->GetGroupSelectedModules().empty() == false)
1819 {
1820 if (!VectorContains(module->GetModuleParent(), TheSynth->GetGroupSelectedModules()))
1821 return true;
1822 }
1823
1824 if (PatchCable::sActivePatchCable &&
1825 (PatchCable::sActivePatchCable->GetConnectionType() != kConnectionType_Modulator && PatchCable::sActivePatchCable->GetConnectionType() != kConnectionType_UIControl && PatchCable::sActivePatchCable->GetConnectionType() != kConnectionType_ValueSetter) &&
1826 !PatchCable::sActivePatchCable->IsValidTarget(module))
1827 {
1828 return true;
1829 }
1830
1831 if (TheSynth->GetHeldSample() != nullptr && !module->CanDropSample())
1832 return true;
1833
1834 if (ScriptModule::sHasLoadedUntrustedScript &&
1835 dynamic_cast<ScriptModule*>(module) == nullptr &&
1836 dynamic_cast<ScriptWarningPopup*>(module) == nullptr)
1837 return true;
1838
1839 return false;
1840}
1841
1842void ModularSynth::RegisterPatchCable(PatchCable* cable)
1843{

Callers 1

DrawFrameMethod · 0.80

Calls 7

VectorContainsFunction · 0.85
emptyMethod · 0.80
GetModuleParentMethod · 0.80
GetHeldSampleMethod · 0.80
GetConnectionTypeMethod · 0.45
IsValidTargetMethod · 0.45
CanDropSampleMethod · 0.45

Tested by

no test coverage detected