I’m thinking of making a change to the way Cantabile prompts to save song files. Currently the model follows very closely the standard Windows document model where you have an open document (the song), and if you move to another document it prompts you to save.
I’m starting to realize this isn’t a good solution for Cantabile…
- The VST spec doesn’t include a concept of a “modified plugin”. Cantabile guess this by watching for parameter changed notifications, but it’s far from perfect: insiginificant changes in a plugin will often cause the song to be marked as modified when it shouldn’t and major changes in a plugin might fail to mark a song as modified when they should.
- If you’re not at the computer where Cantabile is running or if running on a headless machine, prompting to save a changed song is problematic.
Number 2 is about to become a bigger problem with the new network server API that I’m (still) working on.
So I’m thinking of changing things so that songs can be closed, without being saved and without losing any changes. This will work as follows:
- When you close a song (or Cantabile) you won’t be prompted to save changes
- When you re-open a song that was modified, it will come back in its exact same state and will still be marked as modified.
- To “go back” to the last saved version you use the File -> Revert command.
- If you have a song that you want to keep locked down to a specific version and never save transient changes then you can set File -> Song Options -> Mark Song Modified -> Never. (although that option could probably be replaced with something similar if I introduce these changes)
How it Works
- The song file will internally store two copies of the song - the working copy and the saved copy
- When you explicitly save a song file (ie: File -> Save or Save As), the saved copy will be updated from the working copy and the file written to disk.
- When a modified song is closed, the file will be rewritten to disk, with the working copy storing the song/plugins in their current state and the saved copy will be maintained from how the song was when it was loaded.
- When a song is reverted (File -> Revert) the working copy is discarded and replaced with the saved copy and then the file is reloaded.
- Files with working and saved versions will typically be twice the size
- Possible impact on song unload time as the song will always need to be written to disk (I think this will be negligible and would be surprised if anyone notices a change here)
- Non-standard convention that new users might not immediately grasp (although I have seen a similar approach in some other apps now eg: Sublime Text)
- If Windows wants to reboot due to update or for some other reason, Cantabile can cleanly shutdown and come back to where it was. Same if Cantabile needs to restart due to a significant change in Options.
- Solves issues around prompting to save when switching songs via bindings and via the new network API.
- Same mechanism could be used to store multiple previous versions of a song.
- Same approach would be used for set lists (and possibly racks)