| 795 | } |
| 796 | |
| 797 | void 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 | |
| 843 | hise::MacroControlledObject::ModulationPopupData::Ptr ScriptModulationMatrix::TargetDataBase::getModulationData() |
| 844 | { |
nothing calls this directly
no test coverage detected