We have a plugin we want to move to JUCE, but there is a design issue I am struggling with, and wonder if JUCE can help resolve it somehow.
Our plugin needs to record audio information, which we want to write to external files when saving sessions data. What we’d like to do is write that data as it is recorded, and then when saving the session, simply write the location of that data to the session data, as some kind of relative path from a known user location perhaps.
One problem that I see from this idea is that the data is then not part of the session file that the host produces (and which gets our parameter data and potentially this external file path). That means that users have to know, when copying sessions to other machines or sharing them, that they need to copy that external data as well.
One solution to this is to write the data in the folder in which the session is written. However, we don’t know of a way to reliably determine where that data has been written, or if there is a specific folder for that session that isn’t shared with other sessions. (We could get around the issue of other sessions in that folder by writing to a sub-folder that has a unique ID for this particular session.) Is there a way using JUCE to know where the session is actually written to? I doubt it, given that there isn’t even a guarantee that a call to getStateInformation() is actually writing a session file in the first place!
A second problem comes from the ability for a user to select “Save As…” from their File menu. If they do that, we don’t appear to have any way to know that they have done that, and so what would happen is there would now be the original saved session and this new saved session, both of which would be related to the very same internal session ID and thus to the same external data. That would end up, potentially, with two now disjoint sessions both potentially using the same external data, and possibly modifying it, which would break one or both of the sessions. Is there any way to know that a session is being saved someplace new? Again, I highly doubt it, but I’m not familiar enough with JUCE’s wrappers to know if this issue has ever been addressed.
Do any of you write external data in this manner? How do you address these issues? Thanks for any advice!