Open miguel-negrao opened 11 years ago
I suppose this could be a feature of USession. Btw, it is possible to make Udef files auto-load at score opening. They have to be in the same folder as the score file. But of course, once loaded, they won't be replaced anymore.
I could imagine a re-write of the usession file format; instead of a single usession file, we could perhaps create a folder with an index file (perhaps an usession file), separate .uscore files for all UScores that are in the Session, and separate .scd files (perhaps in subfolders) for all Udefs and UMapDefs used in those scores that are not in the default library. For that we would need to allow links in the usession file format, which probably isn't that hard to do.
And then of course, USession should auto-load all enclosed Udef/UMapDef files when opening the session file, regardless of them being already defined or not.
Ok, I didn't know about the udef auto-loading, that is already super useful. Yes, I guess it does make sense to save it USession since then you have your score there but also other things that you might want together with it. I wonder thought if it's easier to save just as one text file with one compile string, with all the extra items stored inside the USession or with a folder with separate files.
Since the objective would be anyway to keep a version of session including all assets has it was at a moment in time, having it all in one string makes it more difficult to accidentally alter the udefs regarding that version. It's also easier to move one file around then a directory. Altering the udef files on disk would alter a saved version of the session, which is not what you expect of documents, if you alter a document (say in word or logic) the original is only altered once you do "save". On the other hand with a single file it might be less convenient to alter the udefs since the text has to first be copied onto a new text window, although I saw in the list that Scott is working on Document support the IDE, so that might be easy to do in the future. I don't have a strong opinion either way.
When a score depends on user generated Udefs it would be convenient to be able to save the Udefs with the score, to record the full state of the piece at a certain moment in time. As a piece evolves Udefs will change, so that would make it easier to go back to a previous version.There are also other resources that could be interesting to save with the score, such as customized functions to generate gui controls, scripts, etc, perhaps it could just be a general placeholder for any type of object.