123 template <
typename It>
128 template <
typename... Items>
131 template <
typename It,
typename = Val
idIfIterator<It>>
134 template <
typename... Items>
135 void add (std::unique_ptr<Items>... items)
146 template <
typename It,
typename = Val
idIfIterator<It>>
150 std::transform (std::make_move_iterator (
begin),
151 std::make_move_iterator (
end),
174 virtual void visit (std::unique_ptr<RangedAudioParameter>)
const = 0;
175 virtual void visit (std::unique_ptr<AudioProcessorParameterGroup>)
const = 0;
184 template <
typename Contents>
196 template <
typename Item>
197 std::unique_ptr<ParameterStorageBase> operator() (std::unique_ptr<Item> item)
const
207 std::vector<std::unique_ptr<ParameterStorageBase>>
parameters;
312 [[deprecated (
"This function is deprecated and will be removed in a future version of JUCE! "
313 "See the method docs for a code example of the replacement methods.")]]
315 const String& parameterName,
319 std::function<
String (
float)> valueToTextFunction,
320 std::function<
float (
const String&)> textToValueFunction,
321 bool isMetaParameter =
false,
322 bool isAutomatableParameter =
true,
323 bool isDiscrete =
false,
325 bool isBoolean =
false);
478 const String& parameterName,
483 [[deprecated (
"Prefer the signature taking an Attributes argument")]]
485 const String& parameterName,
488 float defaultParameterValue,
489 std::function<
String (
float)> valueToTextFunction,
490 std::function<
float (
const String&)> textToValueFunction,
492 bool isAutomatableParameter =
true,
499 defaultParameterValue,
501 .withStringFromValueFunction ([valueToTextFunction] (float
v,
int) {
return valueToTextFunction (
v); })
502 .withValueFromStringFunction (std::move (textToValueFunction))
503 .withMeta (isMetaParameter)
504 .withAutomatable (isAutomatableParameter)
505 .withDiscrete (isDiscrete)
506 .withCategory (parameterCategory)
507 .withBoolean (isBoolean))
511 float getDefaultValue()
const override;
512 int getNumSteps()
const override;
514 bool isDiscrete()
const override;
515 bool isBoolean()
const override;
529 #if ! JUCE_AUDIOPROCESSOR_NO_GUI
543 const String& parameterID,
569 const String& parameterID,
590 const String& parameterID,
622 [[deprecated (
"This method was introduced to allow you to use AudioProcessorValueTreeState parameters in "
623 "an AudioProcessorParameterGroup, but there is now a much nicer way to achieve this. See the "
624 "method docs for a code example.")]]
626 float, std::function<
String (
float)>, std::function<
float (
const String&)>,
631 friend struct ParameterAdapterTests;
#define final
Definition DistrhoDefines.h:74
uint8_t a
Definition Spc_Cpu.h:141
Definition juce_AudioParameterFloat.h:33
AudioParameterFloat(const ParameterID ¶meterID, const String ¶meterName, NormalisableRange< float > normalisableRange, float defaultValue, const AudioParameterFloatAttributes &attributes={})
Definition juce_AudioParameterFloat.cpp:29
Definition juce_AudioProcessor.h:46
Category
Definition juce_AudioProcessorParameter.h:231
@ genericParameter
Definition juce_AudioProcessorParameter.h:232
bool isMetaParameter() const override
Definition juce_AudioProcessorParameterWithID.h:177
std::unique_ptr< ComboBoxParameterAttachment > attachment
Definition juce_AudioProcessorValueTreeState.h:573
ComboBoxAttachment(AudioProcessorValueTreeState &stateToUse, const String ¶meterID, ComboBox &combo)
Definition juce_AudioProcessorValueTreeState.cpp:496
Definition juce_AudioProcessorValueTreeState.cpp:66
bool isBoolean() const override
Definition juce_AudioProcessorValueTreeState.cpp:51
Parameter(const ParameterID ¶meterID, const String ¶meterName, const String &labelText, NormalisableRange< float > valueRange, float defaultParameterValue, std::function< String(float)> valueToTextFunction, std::function< float(const String &)> textToValueFunction, bool isMetaParameter=false, bool isAutomatableParameter=true, bool isDiscrete=false, AudioProcessorParameter::Category parameterCategory=AudioProcessorParameter::genericParameter, bool isBoolean=false)
Definition juce_AudioProcessorValueTreeState.h:484
bool isDiscrete() const override
Definition juce_AudioProcessorValueTreeState.cpp:50
const bool discrete
Definition juce_AudioProcessorValueTreeState.h:523
std::atomic< float > lastValue
Definition juce_AudioProcessorValueTreeState.h:524
Parameter(const ParameterID ¶meterID, const String ¶meterName, NormalisableRange< float > valueRange, float defaultValue, const AudioProcessorValueTreeStateParameterAttributes &attributes={})
Definition juce_AudioProcessorValueTreeState.cpp:31
std::function< void()> onValueChanged
Definition juce_AudioProcessorValueTreeState.h:520
const float unsnappedDefault
Definition juce_AudioProcessorValueTreeState.h:522
const bool boolean
Definition juce_AudioProcessorValueTreeState.h:523
Definition juce_AudioProcessorValueTreeState.h:120
void add(It begin, It end)
Definition juce_AudioProcessorValueTreeState.h:147
decltype(std::next(std::declval< It >())) ValidIfIterator
Definition juce_AudioProcessorValueTreeState.h:124
ParameterLayout(ParameterLayout &&other) noexcept
Definition juce_AudioProcessorValueTreeState.h:157
void add(std::unique_ptr< Items >... items)
Definition juce_AudioProcessorValueTreeState.h:135
std::vector< std::unique_ptr< ParameterStorageBase > > parameters
Definition juce_AudioProcessorValueTreeState.h:207
friend class AudioProcessorValueTreeState
Definition juce_AudioProcessorValueTreeState.h:205
ParameterLayout(std::unique_ptr< Items >... items)
Definition juce_AudioProcessorValueTreeState.h:129
void swap(ParameterLayout &other) noexcept
Definition juce_AudioProcessorValueTreeState.h:162
void add()
Definition juce_AudioProcessorValueTreeState.h:203
ParameterLayout(It begin, It end)
Definition juce_AudioProcessorValueTreeState.h:132
ParameterLayout(const ParameterLayout &other)=delete
SliderAttachment(AudioProcessorValueTreeState &stateToUse, const String ¶meterID, Slider &slider)
Definition juce_AudioProcessorValueTreeState.cpp:489
std::unique_ptr< SliderParameterAttachment > attachment
Definition juce_AudioProcessorValueTreeState.h:547
void valueTreePropertyChanged(ValueTree &, const Identifier &) override
Definition juce_AudioProcessorValueTreeState.cpp:437
Value getParameterAsValue(StringRef parameterID) const
Definition juce_AudioProcessorValueTreeState.cpp:351
UndoManager *const undoManager
Definition juce_AudioProcessorValueTreeState.h:417
RangedAudioParameter * getParameter(StringRef parameterID) const noexcept
Definition juce_AudioProcessorValueTreeState.cpp:368
void updateParameterConnectionsToChildTrees()
Definition juce_AudioProcessorValueTreeState.cpp:412
void addParameterAdapter(RangedAudioParameter &)
Definition juce_AudioProcessorValueTreeState.cpp:328
AudioProcessor & processor
Definition juce_AudioProcessorValueTreeState.h:405
RangedAudioParameter * createAndAddParameter(const String ¶meterID, const String ¶meterName, const String &labelText, NormalisableRange< float > valueRange, float defaultValue, std::function< String(float)> valueToTextFunction, std::function< float(const String &)> textToValueFunction, bool isMetaParameter=false, bool isAutomatableParameter=true, bool isDiscrete=false, AudioProcessorParameter::Category parameterCategory=AudioProcessorParameter::genericParameter, bool isBoolean=false)
Definition juce_AudioProcessorValueTreeState.cpp:279
void addParameterListener(StringRef parameterID, Listener *listener)
Definition juce_AudioProcessorValueTreeState.cpp:339
NormalisableRange< float > getParameterRange(StringRef parameterID) const noexcept
Definition juce_AudioProcessorValueTreeState.cpp:360
AudioProcessorValueTreeState(AudioProcessor &processorToConnectTo, UndoManager *undoManagerToUse, const Identifier &valueTreeType, ParameterLayout parameterLayout)
Definition juce_AudioProcessorValueTreeState.cpp:209
void valueTreeRedirected(ValueTree &) override
Definition juce_AudioProcessorValueTreeState.cpp:449
void setNewState(ValueTree)
Definition juce_AudioProcessorValueTreeState.cpp:401
void replaceState(const ValueTree &newState)
Definition juce_AudioProcessorValueTreeState.cpp:391
bool flushParameterValuesToValueTree()
Definition juce_AudioProcessorValueTreeState.cpp:455
void removeParameterListener(StringRef parameterID, Listener *listener)
Definition juce_AudioProcessorValueTreeState.cpp:345
std::unique_ptr< RangedAudioParameter > createParameter(const String &, const String &, const String &, NormalisableRange< float >, float, std::function< String(float)>, std::function< float(const String &)>, bool, bool, bool, AudioProcessorParameter::Category, bool)
void valueTreeChildAdded(ValueTree &, ValueTree &) override
Definition juce_AudioProcessorValueTreeState.cpp:443
std::map< StringRef, std::unique_ptr< ParameterAdapter >, StringRefLessThan > adapterTable
Definition juce_AudioProcessorValueTreeState.h:653
void timerCallback() override
Definition juce_AudioProcessorValueTreeState.cpp:467
CriticalSection valueTreeChanging
Definition juce_AudioProcessorValueTreeState.h:655
ValueTree copyState()
Definition juce_AudioProcessorValueTreeState.cpp:384
const Identifier valueType
Definition juce_AudioProcessorValueTreeState.h:646
ValueTree state
Definition juce_AudioProcessorValueTreeState.h:414
ParameterAdapter * getParameterAdapter(StringRef) const
Definition juce_AudioProcessorValueTreeState.cpp:333
std::atomic< float > * getRawParameterValue(StringRef parameterID) const noexcept
Definition juce_AudioProcessorValueTreeState.cpp:376
Definition juce_AudioProcessorValueTreeState.h:37
AudioParameterFloatAttributes::Category Category
Definition juce_AudioProcessorValueTreeState.h:41
AudioParameterFloatAttributes attributes
Definition juce_AudioProcessorValueTreeState.h:79
JUCE_NODISCARD auto withLabel(String x) const
Definition juce_AudioProcessorValueTreeState.h:49
bool boolean
Definition juce_AudioProcessorValueTreeState.h:80
JUCE_NODISCARD const auto & getAudioParameterFloatAttributes() const
Definition juce_AudioProcessorValueTreeState.h:72
JUCE_NODISCARD auto withDiscrete(bool x) const
Definition juce_AudioProcessorValueTreeState.h:63
JUCE_NODISCARD auto withMeta(bool x) const
Definition juce_AudioProcessorValueTreeState.h:53
bool discrete
Definition juce_AudioProcessorValueTreeState.h:80
JUCE_NODISCARD auto withCategory(Category x) const
Definition juce_AudioProcessorValueTreeState.h:51
JUCE_NODISCARD const auto & getDiscrete() const
Definition juce_AudioProcessorValueTreeState.h:74
JUCE_NODISCARD const auto & getBoolean() const
Definition juce_AudioProcessorValueTreeState.h:76
JUCE_NODISCARD auto withInverted(bool x) const
Definition juce_AudioProcessorValueTreeState.h:57
JUCE_NODISCARD auto withValueFromStringFunction(ValueFromString x) const
Definition juce_AudioProcessorValueTreeState.h:47
JUCE_NODISCARD auto withAutomatable(bool x) const
Definition juce_AudioProcessorValueTreeState.h:55
AudioProcessorValueTreeStateParameterAttributes This
Definition juce_AudioProcessorValueTreeState.h:38
JUCE_NODISCARD auto withStringFromValueFunction(StringFromValue x) const
Definition juce_AudioProcessorValueTreeState.h:45
AudioParameterFloatAttributes::ValueFromString ValueFromString
Definition juce_AudioProcessorValueTreeState.h:40
JUCE_NODISCARD auto withBoolean(bool x) const
Definition juce_AudioProcessorValueTreeState.h:69
AudioParameterFloatAttributes::StringFromValue StringFromValue
Definition juce_AudioProcessorValueTreeState.h:39
Definition juce_ComboBox.h:49
Definition juce_CriticalSection.h:43
Definition juce_Identifier.h:39
Definition juce_NormalisableRange.h:40
Definition juce_AudioProcessorParameterWithID.h:33
std::function< float(const String &)> ValueFromString
Definition juce_RangedAudioParameter.h:49
AudioProcessorParameter::Category Category
Definition juce_RangedAudioParameter.h:46
std::function< String(float, int)> StringFromValue
Definition juce_RangedAudioParameter.h:48
Definition juce_RangedAudioParameter.h:98
Definition juce_Slider.h:54
Definition juce_String.h:53
Definition juce_StringRef.h:62
Timer() noexcept
Definition juce_Timer.cpp:316
Definition juce_UndoManager.h:52
Definition juce_Value.h:51
Definition juce_ValueTree.h:479
Definition juce_ValueTree.h:72
unsigned v[N_MAX]
Definition inflate.c:1584
unsigned x[BMAX+1]
Definition inflate.c:1586
#define JUCE_NODISCARD
Definition juce_CompilerSupport.h:108
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Object withMember(Object copy, Member OtherObject::*member, Member &&value)
Definition juce_Functional.h:89
RangedDirectoryIterator end(const RangedDirectoryIterator &)
Definition juce_RangedDirectoryIterator.h:184
@ valueChanged
Definition juce_AccessibilityEvent.h:44
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
@ slider
Definition juce_AccessibilityRole.h:43
@ button
Definition juce_AccessibilityRole.h:38
RangedDirectoryIterator begin(const RangedDirectoryIterator &it)
Definition juce_RangedDirectoryIterator.h:179
Definition juce_Uuid.h:141
Definition juce_AudioProcessorValueTreeState.h:350
virtual void parameterChanged(const String ¶meterID, float newValue)=0
virtual ~Listener()=default
Definition juce_AudioProcessorValueTreeState.h:195
Definition juce_AudioProcessorValueTreeState.h:179
virtual ~ParameterStorageBase()=default
virtual void accept(const Visitor &visitor)=0
Definition juce_AudioProcessorValueTreeState.h:186
ParameterStorage(std::unique_ptr< Contents > input)
Definition juce_AudioProcessorValueTreeState.h:187
std::unique_ptr< Contents > contents
Definition juce_AudioProcessorValueTreeState.h:191
void accept(const Visitor &visitor) override
Definition juce_AudioProcessorValueTreeState.h:189
Definition juce_AudioProcessorValueTreeState.h:167
virtual void visit(std::unique_ptr< RangedAudioParameter >) const =0
virtual void visit(std::unique_ptr< AudioProcessorParameterGroup >) const =0
virtual ~Visitor()=default
Definition juce_AudioProcessorValueTreeState.h:649
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396