Undo, redo

From Buzztard

Jump to: navigation, search

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

Personal tools
collaboration

SourceForge Logo

GStreamer Logo

Linux Sound Logo

MediaWiki

Valgrind

GNU Library Public Licence

GNU Free Documentation License 1.2