// // Created by versustune on 13.06.20. // #ifndef VENO_VENOMATRIX_H #define VENO_VENOMATRIX_H #include #include #include #include "Modulator.h" #include "ModulateValue.h" #include "JuceHeader.h" // class that modulate everything :D struct VeNoMatrixTarget { std::string name; std::string source; float amount = 0; // always 0 to 1 <-- apply amount to modulator std::string toString() const; static VeNoMatrixTarget* fromString(const std::string& value); }; //@todo rebuild to new unlimited implementation! // and make compatible with the value class that is used for saving and sync the ValueTree... class VeNoMatrix { public: explicit VeNoMatrix (const std::string& processId); ~VeNoMatrix (); void updateSlots (); void addModulator (const std::string& name, Modulator* modulator); void addModulateValue (const std::string& name, ModulateValue* modulateValue); void removeModulator (const std::string& name); void removeModulateValue (const std::string& name); void setMatrixModulation(const std::string& name, const std::string& source, float amount); std::unique_ptr saveMatrixToXML(); void getMatrixFromXML(std::unique_ptr& xml); private: std::unordered_map m_modulators; //all sources std::unordered_map m_modulationValues; std::unordered_map m_slots; std::string m_processId; protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VeNoMatrix) }; #endif //VENO_VENOMATRIX_H