|
Gin
|
Asynchronous ValueTree listener using lambda functions. More...
#include <gin_valuetreeutilities.h>
Inherits juce::ValueTree::Listener.
Public Member Functions | |
| AsyncLambdaValueTreeListener (juce::ValueTree &v_) | |
| Creates an async listener for the specified ValueTree. | |
| ~AsyncLambdaValueTreeListener () override | |
| Destructor. | |
Public Attributes | |
| std::function< void(const juce::ValueTree &, const juce::Identifier &)> | onValueTreePropertyChanged |
| Called asynchronously when a property value changes. | |
| std::function< void(const juce::ValueTree &, const juce::ValueTree &)> | onValueTreeChildAdded |
| Called asynchronously when a child is added. | |
| std::function< void(const juce::ValueTree &, const juce::ValueTree &, int)> | onValueTreeChildRemoved |
| Called asynchronously when a child is removed. | |
| std::function< void(const juce::ValueTree &, int, int)> | onValueTreeChildOrderChanged |
| Called asynchronously when children are reordered. | |
| std::function< void(const juce::ValueTree &)> | onValueTreeParentChanged |
| Called asynchronously when the parent changes. | |
| std::function< void(const juce::ValueTree &)> | onValueTreeRedirected |
| Called asynchronously when the tree is redirected to a different shared state. | |
Asynchronous ValueTree listener using lambda functions.
Similar to LambdaValueTreeListener, but all callbacks are executed asynchronously on the message thread using juce::MessageManager::callAsync(). This makes it safe to update UI components from the callbacks without worrying about thread safety.
The callbacks receive const references to prevent accidental modification of the ValueTree from the async callbacks.
Example usage:
| AsyncLambdaValueTreeListener::AsyncLambdaValueTreeListener | ( | juce::ValueTree & | v_ | ) |
Creates an async listener for the specified ValueTree.
| v_ | The ValueTree to listen to |
|
override |
Destructor.
Removes this listener from the ValueTree.
| std::function<void (const juce::ValueTree&, const juce::Identifier&)> AsyncLambdaValueTreeListener::onValueTreePropertyChanged |
Called asynchronously when a property value changes.
Parameters: (tree, property identifier)
| std::function<void (const juce::ValueTree&, const juce::ValueTree&)> AsyncLambdaValueTreeListener::onValueTreeChildAdded |
Called asynchronously when a child is added.
Parameters: (parent tree, child that was added)
| std::function<void (const juce::ValueTree&, const juce::ValueTree&, int)> AsyncLambdaValueTreeListener::onValueTreeChildRemoved |
Called asynchronously when a child is removed.
Parameters: (parent tree, child that was removed, index)
| std::function<void (const juce::ValueTree&, int, int)> AsyncLambdaValueTreeListener::onValueTreeChildOrderChanged |
Called asynchronously when children are reordered.
Parameters: (tree, old index, new index)
Called asynchronously when the parent changes.
Parameters: (tree whose parent changed)
Called asynchronously when the tree is redirected to a different shared state.
Parameters: (tree)