Loading...
Searching...
No Matches
juce_ValueTreeSynchroniser.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API ValueTreeSynchroniser : private ValueTree::Listener
{
public:
ValueTreeSynchroniser (const ValueTree& tree);
~ValueTreeSynchroniser() override;
virtual void stateChanged (const void* encodedChange, size_t encodedChangeSize) = 0;
void sendFullSyncCallback();
static bool applyChange (ValueTree& target,
const void* encodedChangeData, size_t encodedChangeDataSize,
UndoManager* undoManager);
const ValueTree& getRoot() noexcept { return valueTree; }
private:
ValueTree valueTree;
void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
void valueTreeChildAdded (ValueTree&, ValueTree&) override;
void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
void valueTreeChildOrderChanged (ValueTree&, int, int) override;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ValueTreeSynchroniser)
};
} // namespace juce
juce::Identifier
Definition juce_Identifier.h:39
juce::UndoManager
Definition juce_UndoManager.h:52
juce::ValueTreeSynchroniser
Definition juce_ValueTreeSynchroniser.h:46
juce::ValueTreeSynchroniser::applyChange
static bool applyChange(ValueTree &target, const void *encodedChangeData, size_t encodedChangeDataSize, UndoManager *undoManager)
Definition juce_ValueTreeSynchroniser.cpp:161
juce::ValueTreeSynchroniser::getRoot
const ValueTree & getRoot() noexcept
Definition juce_ValueTreeSynchroniser.h:84
juce::ValueTreeSynchroniser::stateChanged
virtual void stateChanged(const void *encodedChange, size_t encodedChangeSize)=0
juce::ValueTreeSynchroniser::ValueTreeSynchroniser
ValueTreeSynchroniser(const ValueTree &tree)
Definition juce_ValueTreeSynchroniser.cpp:95
juce::ValueTreeSynchroniser::sendFullSyncCallback
void sendFullSyncCallback()
Definition juce_ValueTreeSynchroniser.cpp:105
juce::ValueTree::Listener
Definition juce_ValueTree.h:481
juce::ValueTree
Definition juce_ValueTree.h:72