gogins / silencio

Algorithmic composition for Csound in Lua and JavaScript.
2 stars 0 forks source link

Persist user interface parameters to filesystem #3

Closed gogins closed 8 years ago

gogins commented 8 years ago

For HTML5 user interfaces based on anything like dat.gui, persist JavaScript parameters to the filesystem as a backup in case localstore is corrupt, needs to be duplicated, or does not exist.

gogins commented 8 years ago

Done. Four functions in Silencio: save to local filesystem, restore from local filesystem (parameterized on whether values are strings or objects); save dat.gui state to local filesystem, restore dat.gui state from local storage if it exists, the local filesystem if the file exists, or a default parameters object.

gogins commented 8 years ago

Oops, it didn't work to save parameters for dat.gui from local storage, there is no guarantee of correct data in there until the window is unloading. Changed to use gui.getSaveObject() which seems to work.