Storing and loading objects in ValueTree

Well, I didn't really have any plans for anything along those lines. It'd be easy enough to create a virtual class, e.g. "Serialisable" which your ReferenceCountedObjects could inherit, which would have a method to write itself to a stream, but re-creating those when re-loading would require a lot more messing-about with factory objects and version/error handling.

My general approach in apps like Tracktion is to simply not have ReferenceCountedObjects in the ValueTree - we treat the ValueTree as a direct representation of the saved file contents, so any data that we want to save needs to go into the tree in the format it'll be saved in - i.e. plain old strings/arrays/numbers etc. Then we have temporary classes that wrap parts of the ValueTree and create objects based on this data which we work with, saving their state to/from the ValueTree when necessary.