JUCE
Classes | Public Member Functions | List of all members
AudioProcessorParameterGroup Class Reference

A class encapsulating a group of AudioProcessorParameters and nested AudioProcessorParameterGroups. More...

Classes

class  AudioProcessorParameterNode
 A child of an AudioProcessorParameterGroup. More...
 

Public Member Functions

 AudioProcessorParameterGroup ()
 Creates an empty AudioProcessorParameterGroup with no name or ID. More...
 
 AudioProcessorParameterGroup (String groupID, String groupName, String subgroupSeparator)
 Creates an empty AudioProcessorParameterGroup. More...
 
template<typename ParameterOrGroup >
 AudioProcessorParameterGroup (String groupID, String groupName, String subgroupSeparator, std::unique_ptr< ParameterOrGroup > child)
 Creates an AudioProcessorParameterGroup with a single child. More...
 
template<typename ParameterOrGroup , typename... Args>
 AudioProcessorParameterGroup (String groupID, String groupName, String subgroupSeparator, std::unique_ptr< ParameterOrGroup > firstChild, Args &&... remainingChildren)
 Creates an AudioProcessorParameterGroup with multiple children. More...
 
 AudioProcessorParameterGroup (AudioProcessorParameterGroup &&)
 Once a group has been added to an AudioProcessor don't try to mutate it by moving or swapping it - this will crash most hosts. More...
 
AudioProcessorParameterGroupoperator= (AudioProcessorParameterGroup &&)
 Once a group has been added to an AudioProcessor don't try to mutate it by moving or swapping it - this will crash most hosts. More...
 
 ~AudioProcessorParameterGroup ()
 Destructor. More...
 
String getID () const
 Returns the group's ID. More...
 
String getName () const
 Returns the group's name. More...
 
String getSeparator () const
 Returns the group's separator string. More...
 
const AudioProcessorParameterGroupgetParent () const noexcept
 Returns the parent of the group, or nullptr if this is a top-level group. More...
 
void setName (String newName)
 Changes the name of the group. More...
 
const AudioProcessorParameterNode *const * begin () const noexcept
 
const AudioProcessorParameterNode *const * end () const noexcept
 
Array< const AudioProcessorParameterGroup * > getSubgroups (bool recursive) const
 Returns all subgroups of this group. More...
 
Array< AudioProcessorParameter * > getParameters (bool recursive) const
 Returns all the parameters in this group. More...
 
Array< const AudioProcessorParameterGroup * > getGroupsForParameter (AudioProcessorParameter *) const
 Searches this group recursively for a parameter and returns a depth ordered list of the groups it belongs to. More...
 
template<typename ParameterOrGroup >
void addChild (std::unique_ptr< ParameterOrGroup > child)
 Adds a child to the group. More...
 
template<typename ParameterOrGroup , typename... Args>
void addChild (std::unique_ptr< ParameterOrGroup > firstChild, Args &&... remainingChildren)
 Adds multiple parameters or sub-groups to this group. More...
 

Detailed Description

A class encapsulating a group of AudioProcessorParameters and nested AudioProcessorParameterGroups.

This class is predominantly write-only; there are methods for adding group members but none for removing them. Ultimately you will probably want to add a fully constructed group to an AudioProcessor.

See also
AudioProcessor::addParameterGroup

Constructor & Destructor Documentation

◆ AudioProcessorParameterGroup() [1/5]

AudioProcessorParameterGroup::AudioProcessorParameterGroup ( )

Creates an empty AudioProcessorParameterGroup with no name or ID.

◆ AudioProcessorParameterGroup() [2/5]

AudioProcessorParameterGroup::AudioProcessorParameterGroup ( String  groupID,
String  groupName,
String  subgroupSeparator 
)

Creates an empty AudioProcessorParameterGroup.

Parameters
groupIDA unique identifier for the group. Keep it basic; don't use any special characters like "." and avoid pure integer strings which could collide with legacy parameter IDs.
groupNameThe group's name, which will be displayed in the host.
subgroupSeparatorA separator string to use between the name of this group and the name of any subgroups if this group is flattened. AUv3 and VST3 plug-ins can have multiple layers of nested subgroups, but AU plug-ins cannot have any subgroups.

◆ AudioProcessorParameterGroup() [3/5]

template<typename ParameterOrGroup >
AudioProcessorParameterGroup::AudioProcessorParameterGroup ( String  groupID,
String  groupName,
String  subgroupSeparator,
std::unique_ptr< ParameterOrGroup >  child 
)

Creates an AudioProcessorParameterGroup with a single child.

Parameters
groupIDA unique identifier for the group. Keep it basic; don't use any special characters like "." and avoid pure integer strings which could collide with legacy parameter IDs.
groupNameThe group's name, which will be displayed in the host.
subgroupSeparatorA separator string to use between the name of this group and the name of any subgroups if this group is flattened. AUv3 and VST3 plug-ins can have multiple layers of nested subgroups, but AU plug-ins cannot have any subgroups.
childAn AudioProcessorParameter or an AudioProcessorParameterGroup to add to the group.

References addChild().

◆ AudioProcessorParameterGroup() [4/5]

template<typename ParameterOrGroup , typename... Args>
AudioProcessorParameterGroup::AudioProcessorParameterGroup ( String  groupID,
String  groupName,
String  subgroupSeparator,
std::unique_ptr< ParameterOrGroup >  firstChild,
Args &&...  remainingChildren 
)

Creates an AudioProcessorParameterGroup with multiple children.

Parameters
groupIDA unique identifier for the group. Keep it basic; don't use any special characters like "." and avoid pure integer strings which could collide with legacy parameter IDs.
groupNameThe group's name, which will be displayed in the host.
subgroupSeparatorA separator string to use between the name of this group and the name of any subgroups if this group is flattened. AUv3 and VST3 plug-ins can have multiple layers of nested subgroups, but AU plug-ins cannot have any subgroups.
firstChildAn AudioProcessorParameter or an AudioProcessorParameterGroup to add to the group.
remainingChildrenA list of more AudioProcessorParameters or AudioProcessorParameterGroups to add to the group.

References addChild(), AudioProcessorParameterGroup::AudioProcessorParameterNode::AudioProcessorParameterGroup, begin(), end(), getGroupsForParameter(), getID(), getName(), getParameters(), AudioProcessorParameterGroup::AudioProcessorParameterNode::getParent(), getSeparator(), getSubgroups(), operator=(), setName(), and ~AudioProcessorParameterGroup().

◆ AudioProcessorParameterGroup() [5/5]

AudioProcessorParameterGroup::AudioProcessorParameterGroup ( AudioProcessorParameterGroup &&  )

Once a group has been added to an AudioProcessor don't try to mutate it by moving or swapping it - this will crash most hosts.

◆ ~AudioProcessorParameterGroup()

AudioProcessorParameterGroup::~AudioProcessorParameterGroup ( )

Destructor.

Referenced by AudioProcessorParameterGroup().

Member Function Documentation

◆ operator=()

AudioProcessorParameterGroup& AudioProcessorParameterGroup::operator= ( AudioProcessorParameterGroup &&  )

Once a group has been added to an AudioProcessor don't try to mutate it by moving or swapping it - this will crash most hosts.

Referenced by AudioProcessorParameterGroup().

◆ getID()

String AudioProcessorParameterGroup::getID ( ) const

Returns the group's ID.

Referenced by AudioProcessorParameterGroup().

◆ getName()

String AudioProcessorParameterGroup::getName ( ) const

Returns the group's name.

Referenced by AudioProcessorParameterGroup().

◆ getSeparator()

String AudioProcessorParameterGroup::getSeparator ( ) const

Returns the group's separator string.

Referenced by AudioProcessorParameterGroup().

◆ getParent()

const AudioProcessorParameterGroup* AudioProcessorParameterGroup::getParent ( ) const
noexcept

Returns the parent of the group, or nullptr if this is a top-level group.

◆ setName()

void AudioProcessorParameterGroup::setName ( String  newName)

Changes the name of the group.

If you do this after the group has been added to an AudioProcessor, call updateHostDisplay() to inform the host of the change. Not all hosts support dynamic group name changes.

Referenced by AudioProcessorParameterGroup().

◆ begin()

const AudioProcessorParameterNode* const* AudioProcessorParameterGroup::begin ( ) const
noexcept

◆ end()

const AudioProcessorParameterNode* const* AudioProcessorParameterGroup::end ( ) const
noexcept

◆ getSubgroups()

Array<const AudioProcessorParameterGroup*> AudioProcessorParameterGroup::getSubgroups ( bool  recursive) const

Returns all subgroups of this group.

Parameters
recursiveIf this is true then this method will fetch all nested subgroups using a depth first search.

Referenced by AudioProcessorParameterGroup().

◆ getParameters()

Array<AudioProcessorParameter*> AudioProcessorParameterGroup::getParameters ( bool  recursive) const

Returns all the parameters in this group.

Parameters
recursiveIf this is true then this method will fetch all nested parameters using a depth first search.

Referenced by addChild(), and AudioProcessorParameterGroup().

◆ getGroupsForParameter()

Array<const AudioProcessorParameterGroup*> AudioProcessorParameterGroup::getGroupsForParameter ( AudioProcessorParameter ) const

Searches this group recursively for a parameter and returns a depth ordered list of the groups it belongs to.

Referenced by AudioProcessorParameterGroup().

◆ addChild() [1/2]

template<typename ParameterOrGroup >
void AudioProcessorParameterGroup::addChild ( std::unique_ptr< ParameterOrGroup >  child)

Adds a child to the group.

Do not add children to a group which has itself already been added to the AudioProcessor - the new elements will be ignored.

Referenced by addChild(), and AudioProcessorParameterGroup().

◆ addChild() [2/2]

template<typename ParameterOrGroup , typename... Args>
void AudioProcessorParameterGroup::addChild ( std::unique_ptr< ParameterOrGroup >  firstChild,
Args &&...  remainingChildren 
)

Adds multiple parameters or sub-groups to this group.

Do not add children to a group which has itself already been added to the AudioProcessor - the new elements will be ignored.

References addChild(), getParameters(), JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR, and JUCE_DEPRECATED_WITH_BODY.


The documentation for this class was generated from the following file: