mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Allowed an AudioProcessorValueTreeState to manage RangedAudioParameter subclasses
This commit is contained in:
parent
768139a298
commit
1f63493031
14 changed files with 1249 additions and 389 deletions
|
|
@ -175,19 +175,14 @@ public:
|
|||
//==============================================================================
|
||||
JuceDemoPluginAudioProcessor()
|
||||
: AudioProcessor (getBusesProperties()),
|
||||
state (*this, nullptr)
|
||||
state (*this, nullptr, "state",
|
||||
{ std::make_unique<AudioParameterFloat> ("gain", "Gain", NormalisableRange<float> (0.0f, 1.0f), 0.9f),
|
||||
std::make_unique<AudioParameterFloat> ("delay", "Delay Feedback", NormalisableRange<float> (0.0f, 1.0f), 0.5f) })
|
||||
{
|
||||
lastPosInfo.resetToDefault();
|
||||
|
||||
// This creates our parameters
|
||||
state.createAndAddParameter ("gain", "Gain", {}, {}, 0.9f, {}, {});
|
||||
state.createAndAddParameter ("delay", "Delay Feedback", {}, {}, 0.5f, {}, {});
|
||||
|
||||
state.state = ValueTree ("state", {},
|
||||
{
|
||||
// add a sub-tree to store the state of our UI
|
||||
{"uiState", {{"width", 400}, {"height", 200}}, {}}
|
||||
});
|
||||
// Add a sub-tree to store the state of our UI
|
||||
state.state.addChild ({ "uiState", { { "width", 400 }, { "height", 200 } }, {} }, -1, nullptr);
|
||||
|
||||
initialiseSynth();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,17 +152,9 @@ public:
|
|||
: AudioProcessor (BusesProperties()
|
||||
.withInput ("Input", AudioChannelSet::stereo(), true)
|
||||
.withOutput ("Output", AudioChannelSet::stereo(), true)),
|
||||
parameters (*this, nullptr)
|
||||
parameters (*this, nullptr, "InterAppAudioEffect",
|
||||
{ std::make_unique<AudioParameterFloat> ("gain", "Gain", NormalisableRange<float> (0.0f, 1.0f), 1.0f / 3.14f) })
|
||||
{
|
||||
parameters.createAndAddParameter ("gain",
|
||||
"Gain",
|
||||
{},
|
||||
NormalisableRange<float> (0.0f, 1.0f),
|
||||
(float) (1.0 / 3.14),
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
parameters.state = ValueTree (Identifier ("InterAppAudioEffect"));
|
||||
}
|
||||
|
||||
~IAAEffectProcessor() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue