[yoshimi] Undo

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Mon, 8 Apr 2019 21:29:11 +0100

I'm currently going though the user guide to bring it up to date, and just saw
mention of this... which got me thinking (dangerous I know).

With everything now using a central command block it would be possible to create
undo files. Is there actually any interest in that?


It might slow down editing operations a bit, but whether it would be noticeable
is a moot point.

The information would be written direct to disk, most likely in Yoshimi's
config directory.

Each instance would have it's own file and keep a pointer to its current file
position, advancing for write, and retarding after undo (allowing redo).

The data would be stored as text, with one line per command having the current
value of the parameter the command was about to change as well as the full
command. Getting the current value is remarkably easy - you just call a read
with exactly the same command block as the one you intend to write :)

If both were the same, then the line would be discarded.

To aid backtracing I think at the end of a session the undo files should be
closed but not deleted, but when starting an new session these should be looked
for and first deleted if they exist.

Finally, is this a project that would interest any of
'Yoshimi's Little Band of Helpers'? :@)

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
Yoshimi source code is available from either: 
https://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: