9 : m_kwidgetType(kwidgetType), m_kwidgetID(kwidgetID), m_kwidgetTree(
XmlType::Tag::kwidget),
10 m_paramTree(
XmlType::Tag::params), m_customParamTree(
XmlType::Tag::customParams),
11 m_childTree(
XmlType::Tag::kwidgets)
30 for (
auto& p : paramInfo)
60 std::unique_ptr<KwidgetGUI> gui =
createGUI();
71 v->updateAttachments();
72 v->noteOn(midiNoteNumber, velocity, voiceIdx);
98 p->getAttachment(paramID)->addModulator(modulatorPtr, depth, polarity);
123 p->getAttachment(paramID)->removeModulator(modulatorPtr);
142 p->getAttachment(paramID)->setModulatorDepth(modulatorPtr, depth);
162 p->getAttachment(paramID)->setModulatorPolarity(modulatorPtr, polarity);
170 if (m_parameterIDs.find(parameterID) == m_parameterIDs.end())
175 return m_parameters[m_parameterIDs.at(parameterID)].get();
180 if (m_parameterIDs.find(parameterID) == m_parameterIDs.end())
185 return m_parameters[m_parameterIDs.at(parameterID)];
218 static_assert(std::is_base_of<CustomParameterTree, T>::value,
"T must be a subclass of CustomParameterTree");
236 for (
auto& kParam : kParams)
238 kParam->notifyListeners();
274 auto kwidgetTree = newState.createCopy();
282 for (
const auto& param : paramTree)
284 auto paramID = param[id].toString();
285 auto tree =
m_paramTree.getChildWithProperty(
id, paramID);
288 tree.copyPropertiesAndChildrenFrom(param,
nullptr);
293 for (
const auto& param : customParamTree)
297 tree.copyPropertiesAndChildrenFrom(param,
nullptr);
300 for (
auto childTree : childParamTree)
348 if (child !=
nullptr)
362 return m_processors.getUnchecked(0)->getNumModulators();
396 StringArray identifier;
435 static_assert(std::is_base_of<CustomParameterTree, T>::value,
"T must be a subclass of CustomParameterTree");
446 std::unique_ptr<T> treeToCreate = std::make_unique<T>();
447 jassert(type == treeToCreate->getType());
465 std::function<
void(
float)> callback)
467 auto versionCheckCallback = [
this, callback, parameterVersion](
float newValue) {
485 if (k->getKwidgetID() == kwidgetID)
504 auto gui = k->createControls();
506 gui->setComponentID(k->getKwidgetID());
507 parentGui->addAndMakeVisible(gui.get());
A wrapper around juce::ValueTree designed to store custom plugin state (strings, arrays,...
Definition CustomParameter.h:9
const var & getValue() const
Definition CustomParameter.cpp:39
Definition CustomParameterTree.h:15
Polarity
Definition KAttachment.h:120
Internal Kwidget parameter that can receive changes from a GenericParameter.
Definition KParameter.h:17
float get() const
Definition KParameter.cpp:126
void set(float newValue)
Definition KParameter.cpp:128
void setAccessible(bool isAccessible)
Called by the resource to grant or deny access to clients.
Definition ResourceLock.cpp:54
int getVersionAsHexInteger(StringRef versionString)
Definition helpers.cpp:86
Definition AirAbsorptionFilter.cpp:2
A KParameter Listener which can be used to trigger a callback syncrhonously.
Definition KParameter.h:30
static const Identifier id
Definition XmlType.h:41
static const Identifier version
Definition XmlType.h:52
static const Identifier value
Definition XmlType.h:42
static const Identifier linkIndex
Definition XmlType.h:44
static const Identifier type
Definition XmlType.h:43
static const Identifier kwidgets
Definition XmlType.h:22
static const Identifier params
Definition XmlType.h:18
static const Identifier customParam
Definition XmlType.h:21
static const Identifier customParams
Definition XmlType.h:20
static const Identifier param
Definition XmlType.h:19
Common names for storing data in a ValueTree.
Definition XmlType.h:7