MCPcopy Create free account
hub / github.com/christophhart/HISE / init

Method init

hi_scripting/scripting/api/ScriptModulationMatrix.cpp:797–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797void ScriptModulationMatrix::TargetDataBase::init(const var& json)
798{
799 auto p = parent.get();
800
801 verifyProperty(json, MatrixIds::ID);
802
803 modId = json[MatrixIds::ID].toString();
804
805 verifyProperty(json, MatrixIds::Target);
806
807 auto targetId = json[MatrixIds::Target].toString();
808
809 processor = ProcessorHelpers::getFirstProcessorWithName(p->getMainController()->getMainSynthChain(), targetId);
810
811 verifyExists(processor.get(), MatrixIds::Target);
812
813 verifyProperty(json, MatrixIds::Component);
814
815 componentId = json[MatrixIds::Component].toString();
816
817 sc = var(p->getScriptProcessor()->getScriptingContent()->getComponentWithName(componentId));
818
819 verifyExists(sc.getObject(), MatrixIds::Component);
820
821 if (auto comp = dynamic_cast<ScriptComponent*>(sc.getObject()))
822 {
823 r.rng.start = comp->getScriptObjectProperty(ScriptComponent::Properties::min);
824 r.rng.end = comp->getScriptObjectProperty(ScriptComponent::Properties::max);
825
826 if (comp->hasProperty("middlePosition"))
827 {
828 auto mp = comp->getScriptObjectProperty(ScriptingApi::Content::ScriptSlider::middlePosition);
829
830 if (r.rng.getRange().contains(mp))
831 r.rng.setSkewForCentre(mp);
832 }
833
834 if (comp->hasProperty("stepSize"))
835 r.rng.interval = comp->getScriptObjectProperty("stepSize");
836 if (dynamic_cast<ScriptingApi::Content::ScriptComboBox*>(comp))
837 r.rng.interval = 1.0;
838 }
839
840
841}
842
843hise::MacroControlledObject::ModulationPopupData::Ptr ScriptModulationMatrix::TargetDataBase::getModulationData()
844{

Callers

nothing calls this directly

Calls 15

varFunction · 0.85
getScriptingContentMethod · 0.80
initFunction · 0.50
StringClass · 0.50
getMethod · 0.45
toStringMethod · 0.45
getMainSynthChainMethod · 0.45
getMainControllerMethod · 0.45
getComponentWithNameMethod · 0.45
getScriptProcessorMethod · 0.45
getObjectMethod · 0.45

Tested by

no test coverage detected