OpenShot Audio Library | OpenShotAudio: juce_ValueTreeSynchroniser.h Source File

OpenShot Audio Library | OpenShotAudio 1.0.0

Loading...
Searching...
No Matches
juce_ValueTreeSynchroniser.h
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
29//==============================================================================
45 class JUCE_API ValueTreeSynchroniser : private ValueTree::Listener
46{
47public:
54 ValueTreeSynchroniser (const ValueTree& tree);
55
57 ~ValueTreeSynchroniser() override;
58
64 virtual void stateChanged (const void* encodedChange, size_t encodedChangeSize) = 0;
65
71 void sendFullSyncCallback();
72
79 static bool applyChange (ValueTree& target,
80 const void* encodedChangeData, size_t encodedChangeDataSize,
81 UndoManager* undoManager);
82
84 const ValueTree& getRoot() noexcept { return valueTree; }
85
86private:
87 ValueTree valueTree;
88
89 void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
90 void valueTreeChildAdded (ValueTree&, ValueTree&) override;
91 void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
92 void valueTreeChildOrderChanged (ValueTree&, int, int) override;
93
94 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ValueTreeSynchroniser)
95};
96
97} // 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