|
Gin
|
Listens to ValueTree changes using lambda functions instead of virtual methods. More...
#include <gin_valuetreeutilities.h>
Inherits juce::ValueTree::Listener.
Public Member Functions | |
| LambdaValueTreeListener (juce::ValueTree v_) | |
| Creates a listener for the specified ValueTree. | |
Public Attributes | |
| std::function< void()> | onChanged |
| Called whenever any change occurs to the ValueTree. | |
| std::function< void(juce::ValueTree &, const juce::Identifier &)> | onValueTreePropertyChanged |
| Called when a property value changes. | |
| std::function< void(juce::ValueTree &, juce::ValueTree &)> | onValueTreeChildAdded |
| Called when a child is added. | |
| std::function< void(juce::ValueTree &, juce::ValueTree &, int)> | onValueTreeChildRemoved |
| Called when a child is removed. | |
| std::function< void(juce::ValueTree &, int, int)> | onValueTreeChildOrderChanged |
| Called when children are reordered. | |
| std::function< void(juce::ValueTree &)> | onValueTreeParentChanged |
| Called when the parent changes. | |
| std::function< void(juce::ValueTree &)> | onValueTreeRedirected |
| Called when the tree is redirected to a different shared state. | |
Listens to ValueTree changes using lambda functions instead of virtual methods.
This class provides a more convenient way to listen to ValueTree changes by setting std::function callbacks rather than overriding virtual methods. You can set only the callbacks you're interested in.
Example usage:
| LambdaValueTreeListener::LambdaValueTreeListener | ( | juce::ValueTree | v_ | ) |
Creates a listener for the specified ValueTree.
| v_ | The ValueTree to listen to |
| std::function<void ()> LambdaValueTreeListener::onChanged |
Called whenever any change occurs to the ValueTree.
| std::function<void (juce::ValueTree&, const juce::Identifier&)> LambdaValueTreeListener::onValueTreePropertyChanged |
Called when a property value changes.
Parameters: (tree, property identifier)
| std::function<void (juce::ValueTree&, juce::ValueTree&)> LambdaValueTreeListener::onValueTreeChildAdded |
Called when a child is added.
Parameters: (parent tree, child that was added)
| std::function<void (juce::ValueTree&, juce::ValueTree&, int)> LambdaValueTreeListener::onValueTreeChildRemoved |
Called when a child is removed.
Parameters: (parent tree, child that was removed, index)
| std::function<void (juce::ValueTree&, int, int)> LambdaValueTreeListener::onValueTreeChildOrderChanged |
Called when children are reordered.
Parameters: (tree, old index, new index)
| std::function<void (juce::ValueTree&)> LambdaValueTreeListener::onValueTreeParentChanged |
Called when the parent changes.
Parameters: (tree whose parent changed)
| std::function<void (juce::ValueTree&)> LambdaValueTreeListener::onValueTreeRedirected |
Called when the tree is redirected to a different shared state.
Parameters: (tree)