50 static std::vector<uint8_t>
encode(
const std::vector<SyncDelta>& deltas);
53 static std::vector<SyncDelta>
decode(
const uint8_t* data,
size_t size);
72 std::vector<SyncDelta> pending_;
76 std::vector<std::pair<StateTree*, int>> property_listener_ids_;
77 std::vector<std::pair<StateTree*, int>> child_added_listener_ids_;
78 std::vector<std::pair<StateTree*, int>> child_removed_listener_ids_;
79 std::vector<std::pair<StateTree*, int>> child_moved_listener_ids_;
StateTreeSynchroniser()=default
void attach(StateTree::Ptr tree)
Attach to a tree and start recording changes.
std::vector< SyncDelta > take_deltas()
Get pending deltas since last call (clears the buffer).
static std::vector< SyncDelta > decode(const uint8_t *data, size_t size)
Decode binary deltas.
void detach()
Detach and stop recording.
static std::vector< uint8_t > encode(const std::vector< SyncDelta > &deltas)
Encode deltas as binary for transmission.
static void apply(StateTree &tree, const std::vector< SyncDelta > &deltas)
Apply deltas to a tree.
Reactive tree node — each node has a type name, properties, and children.
Definition state_tree.hpp:293
std::shared_ptr< StateTree > Ptr
Definition state_tree.hpp:295
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48
SyncDeltaType
Delta types for tree synchronization.
Definition state_tree_sync.hpp:16
@ ChildAdd
Definition state_tree_sync.hpp:19
@ ChildRemove
Definition state_tree_sync.hpp:20
@ ChildMove
Reorder within one parent: child_index -> int64 value.
Definition state_tree_sync.hpp:21
@ PropertySet
Definition state_tree_sync.hpp:17
@ PropertyRemove
Definition state_tree_sync.hpp:18
std::variant< std::monostate, bool, int64_t, double, std::string, PropertyArrayValue, PropertyObjectValue > PropertyValue
Property value — can hold scalar values plus immutable recursive arrays and string-keyed objects.
Definition state_tree.hpp:66
A single change to synchronize.
Definition state_tree_sync.hpp:25
std::string key
Definition state_tree_sync.hpp:28
SyncDeltaType type
Definition state_tree_sync.hpp:26
std::string path
Definition state_tree_sync.hpp:27
PropertyValue value
Definition state_tree_sync.hpp:29
int child_index
Definition state_tree_sync.hpp:30