Undo, redo
From Buzztard
The editor app. needs undo/redo.
Question #1 is what needs to be undoable. E.g. when removing a machine, that also means removing its patterns and its sequence data. As a side effect handling undo/redo makes it easy to detect when the song has been changed. If there is nothing to undo since last save (load), it has not been changed ;).
Contents |
[edit] Implementation
We need two lists (undo,redo) of command objects, on which we can call undo/redo methods (depending on in which list they are). Each command object needs contextual data. This data might be a partially serialized object.
[edit] Examples
[edit] entering something in a pattern
- command=pattern-edit
- parameter: tickdata+global/voicedata
<pattern id="bd_beats" machine="bd" name="beats" length="16"> <tick time= "8"><voicedata name="Trig" voice="0" value="1"/></tick> </pattern>
[edit] deleting a pattern
[edit] Links
Undo/Redo Links
- http://www.codeproject.com/cpp/undoredo_cpp.asp
- if we cut a selection from a pattern, that is not a full object, like the examples in the article
- http://www.javaworld.com/javaworld/jw-06-1998/jw-06-undoredo.html
- http://www-dse.doc.ic.ac.uk/~np2/software/undo.html



