JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_AudioProcessorParameterWithID.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
35{
36public:
37 ParameterID() = default;
38
49 template <typename StringLike, typename = DisableIfSameOrDerived<ParameterID, StringLike>>
50 ParameterID (StringLike&& identifier, int versionHint = 0)
51 : paramID (std::forward<StringLike> (identifier)), version (versionHint) {}
52
54 auto getParamID() const { return paramID; }
55
57 auto getVersionHint() const { return version; }
58
59private:
60 String paramID;
61 int version = 0;
62};
63
71{
73
74public:
76
78 [[nodiscard]] auto withLabel (String x) const { return withMember (*this, &This::label, std::move (x)); }
79
81 [[nodiscard]] auto withCategory (Category x) const { return withMember (*this, &This::category, std::move (x)); }
82
84 [[nodiscard]] auto withMeta (bool x) const { return withMember (*this, &This::meta, std::move (x)); }
85
87 [[nodiscard]] auto withAutomatable (bool x) const { return withMember (*this, &This::automatable, std::move (x)); }
88
90 [[nodiscard]] auto withInverted (bool x) const { return withMember (*this, &This::inverted, std::move (x)); }
91
93 [[nodiscard]] auto getLabel() const { return label; }
94
96 [[nodiscard]] auto getCategory() const { return category; }
97
99 [[nodiscard]] auto getMeta() const { return meta; }
100
102 [[nodiscard]] auto getAutomatable() const { return automatable; }
103
105 [[nodiscard]] auto getInverted() const { return inverted; }
106
107private:
108 String label;
110 bool meta = false, automatable = true, inverted = false;
111};
112
113//==============================================================================
122{
123public:
140 AudioProcessorParameterWithID (const ParameterID& parameterID,
141 const String& parameterName,
142 const AudioProcessorParameterWithIDAttributes& attributes = {});
143
152 [[deprecated ("Prefer the signature taking an Attributes argument")]]
154 const String& parameterName,
155 const String& parameterLabel,
156 Category parameterCategory = AudioProcessorParameter::genericParameter)
157 : AudioProcessorParameterWithID (parameterID,
158 parameterName,
159 AudioProcessorParameterWithIDAttributes().withLabel (parameterLabel)
160 .withCategory (parameterCategory))
161 {
162 }
163
166
169
172
175
176 String getName (int) const override;
177 String getLabel() const override;
178 Category getCategory() const override;
179
180 String getParameterID() const override { return paramID; }
181 bool isMetaParameter() const override { return meta; }
182 bool isAutomatable() const override { return automatable; }
183 bool isOrientationInverted() const override { return inverted; }
184
185private:
186 bool meta = false, automatable = true, inverted = false;
187
189};
190
191} // namespace juce
An instance of this class may be passed to the constructor of an AudioProcessorParameterWithID to set...
auto withLabel(String x) const
An optional label for the parameter's value.
auto withCategory(Category x) const
The semantics of this parameter.
auto getLabel() const
An optional label for the parameter's value.
auto getCategory() const
The semantics of this parameter.
This abstract base class is used by some AudioProcessorParameter helper classes.
bool isOrientationInverted() const override
This can be overridden to tell the host that this parameter operates in the reverse direction.
AudioProcessorParameterWithID(const ParameterID &parameterID, const String &parameterName, const String &parameterLabel, Category parameterCategory=AudioProcessorParameter::genericParameter)
The creation of this object requires providing a name and ID which will be constant for its lifetime.
const String label
Provides access to the parameter's label.
const String name
Provides access to the parameter's name.
String getParameterID() const override
Returns an ID that is unique to this parameter.
bool isAutomatable() const override
Returns true if the host can automate this parameter.
const String paramID
Provides access to the parameter's ID string.
const Category category
Provides access to the parameter's category.
bool isMetaParameter() const override
Should return true if this parameter is a "meta" parameter.
@ genericParameter
If your parameter is not a meter then you should use this category.
Combines a parameter ID and a version hint.
ParameterID(StringLike &&identifier, int versionHint=0)
Constructs an instance.
The JUCE String class!
Definition juce_String.h:53
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.
Object withMember(Object copy, Member OtherObject::*member, Other &&value)
Copies an object, sets one of the copy's members to the specified value, and then returns the copy.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
A parameter with functions that are useful for plugin hosts.