Storing tree-like data in PropertiesFile


#1

Hi everyone,

I have a bunch of data all stored in ValueTrees (I have some recursive “tree-like” classes) which I save in files, when you press “save” button.
I would like to save all of them in files every few seconds (the interval doesn´t matter) without pressing any button, so when I close my app and reopen all changes shall restore.

I have seen PropertiesFile class to do that work, but I realized it can not handle tree-like data in an easy way. I thought of using a ValueTree, create an XML, and save the XML in the PropertiesFile, all in real time, but I have read in another post that a ValueTree is not recommended to use in real time.

Any help?

Thanks a lot,

Oscar


#2

When people talk about “real time” it is often in the context of processing audio on the audio thread. Code that you write for audio processing in “real time” does have restrictions that need to be abided by in order to provide glitch free audio processing and ValueTrees and their features aren’t (afaik) well suited for that context. But talking “real time” as in a general experience from the user’s point of view, like on the fly type auto saving is not particularly a problem for ValueTrees.


#3

Thanks a lot,

Oscar