From: Chris Cannam <chris.cannam@fe...> - 2005-07-29 12:47:18
> This pattern is very simple : all user commands are represented by
> instances of an abstract Command class, which has only two methods :
> execute() and, obviously, unexecute().
Note that some of our commands use an intermediate class (BasicCommand) to provide unexecute. This basically implements a brute-force undo for commands that modify part of a Segment - at construction time the command indicates what region of the segment it will modify and the class saves a copy of the events in that region, restoring them on unexecute.
It can optionally implement execute() the same way on all but the first invocation (brute-force redo).
This class is where the modifySegment method originates.