On 30.05.2025 20:38, Will Godfrey wrote:
I'm thinking of protecting against losing changed but unsaved instruments with
the following:
Start with a zeroed 64bit integer with one bit per part (we can potentially
have all possible 64 filled. Call it (say) partStatus.
Every time there is a part-level write set the bit for that part.
On a part reset or save of an individual part either externally, or to a bank,
clear the part's bit.
On a master reset, patch set or state load clear all bits.
If partStatus is non zero when wanting to shut down, warn there are changed
instruments and which ones they are, giving the option of abandoning the
shutdown.
Any thoughts?
I think this is a good idea.
As for the implementation, I would recommend using a 64-length
`vector<bool>` instead. This gives the best of both worlds, because the
bool case is optimized to only use one bit per element, so it does
actually compile into an `int64_t` sized buffer, but from the outside it
looks like a normal container, so you don't have to tinker with
individual bits.
--
Kristian
_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel