Hi all, I was wondering if anybody could offer any advice for using ValueTrees as the SourceDetails::description var member?
My use case is that I have a music library stored as a ValueTree in a similar way to the juce demo. When I drag from the library table to my player components these need to access the related tree items to load the file and modify properties and child trees to edit thing such as loop and cue points.
At the moment I have this working with an incredibly ugly hack by storing the parent tree’s address as a pointer_sized_int var and then an array of ID’s which relate to the child tree’s IDs. When this is dropped I have to dynamic_cast the address back to a ValueTree and then search the tree for the desired children. This not only looks hideous but is pretty slow and probably quite unsafe.
Is there anybody doing this type of thing? What would be ideal would be some var constructors to hold ValueTrees but I understand these aren’t really primitive types. Getting access to the underlying ValueTree::SharedObject would also make this possible using the existing var(ReferenceCountedObject *object) constructor but again is not really how the ValueTree is intended to be used.
Any pointers would be much appreciated.