namespace Cmd

TSE3 library undo/redoable commands. More...

Full nameTSE3::Cmd
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types


Detailed Description

The Cmd namespace contains classes that implement the Command pattern (GoF book). They use the TSE3 API to provide undo/redoable commands objects for all commonly performed operations.

There are a large number of commands that can be used for different purposes. The base class for all TSE3 commands is the Command. There exists one command class for every useful operation on the TSE3::Song data structure and it's subcomponents.

There is one proviso with using commands: if you manipulate some of a TSE3::Song with commands, for the undo/redo to work you must (logically) manipulate the TSE3::Song entirely through Command objects. Otherwise the undo/redo system will be faced with complicated inconsistencies which cannot be resolved.

You can store executed Command objects on the CommandHistory buffer to automate the undo/redo process.

Command subclasses are easy to write, so it's not difficult to add your own commands and use them with the CommandHistory. See the notes in the main TSE3 library documentation for more information.

See also: TSE3

Command (class)

Command

A base class for implementing the 'Command' design pattern [Gof]

If you are implementing a new Command then inherit publicly from this class, implement the executeImpl() and undoImpl() methods and ensure that your constructor calls the Command protected constructor.

VariableSetCommand (class)

VariableSetCommand

A template class for implementing Command objects that set a particular class' variable state.

The template takes five parameters:

CommandGroup (class)

CommandGroup

A class that groups Command object together so you can pretend that several commands are one.

The commands will be executed in the order that they are added to the CommandGroup (see add). They will be undone in the reverse order.

CommandHistory (class)

CommandHistory

The history of which Command objects have been executed. Once a Command has been executed, it should be placed into the CommandHistory so that an undo/redo mechanism can be operated by the user.

In the TSE3 system there could be be one CommandHistroy object per TSE3::Song or one global CommandHistory.

When the availablity of either undos or redos changes, a notification is sent.

The CommandHistory class has a size limit facility. When either the undo or redo list goes over a certain threshold (see limit) Commands will be deleted. This can be set to 'infinite'.

See also: Command

FlagTrack_Add (class)

FlagTrack_Add

Command to add a TSE3::Flag to a TSE3::FlagTrack.

See also: Command

Part_SetInfo (class)

Part_SetInfo

Command to set a TSE3::Part's info (the TSE3::Phrase, it's TSE3::MidiParams setup, the TSE3::DisplayParams and it's TSE3::MidiFilter setup).

If you just want to set the TSE3::Phrase, use Part_SetPhrase.

See also: Command

Part_SetPhrase (class)

Part_SetPhrase

Command to set a TSE3::Part's TSE3::Phrase.

See also: Command

Part_Move (class)

Part_Move

Command to move a TSE3::Part's from it's current position (which may be in a TSE3::Track or not - in which case the TSE3::Part is being 'inserted') to another position in a (possibly different) TSE3::Track.

See also: Command

Phrase_SetInfo (class)

Phrase_SetInfo

Command to set a TSE3::Phrase's info (the title and its TSE3::DisplayParams setup).

If the TSE3::Phrase is parented in a TSE3::PhraseList and you change the title to an invalid name, then the exception generated by TSE3::PhraseList::insert() will be propragated back to you.

See also: Command

Phrase_Create (class)

Phrase_Create

Command to insert a TSE3::Phrase into a TSE3::Song by creating it from a TSE3::PhraseEdit.

This object may propagate the TSE3::PhraseListError exception if the Phrase name already exists.

See also: Command

Phrase_Erase (class)

Phrase_Erase

Command to erase a TSE3::Phrase from a TSE3::PhraseList.

See also: Command

Phrase_Replace (class)

Phrase_Replace

Song_SetInfo (class)

Song_SetInfo

Command to set a Song's info (the title, author, copyright and date strings).

See also: Command

Song_SetTitle (class)

Song_SetTitle

Command to set a Song's title.

See also: Command

Song_SetAuthor (class)

Song_SetAuthor

Command to set a Song's author.

See also: Command

Song_SetCopyright (class)

Song_SetCopyright

Command to set a Song's copyright.

See also: Command

Song_SetDate (class)

Song_SetDate

Command to set a Song's date.

See also: Command

Song_InsertTrack (class)

Song_InsertTrack

Command to insert a new blank Track into a Song.

See also: Command

Song_RemoveTrack (class)

Song_RemoveTrack

Command to remove a Track from a Song.

See also: Command

Song_SoloTrack (class)

Song_SoloTrack

Command to set the solo Track in a Song.

See also: Command

Track_SetInfo (class)

Track_SetInfo

Command to set a TSE3::Track's info (the title, it's TSE3::MidiParams setup and it's TSE3::MidiFilter setup).

See also: Command

Track_Snip (class)

Track_Snip

Command to snip a TSE3::Part in a TSE3::Track.

If there is no TSE3::Part at the specified time, then nothing will happen, and no error will be raised. It is suggested that you check that the command is worthwhile before you perform it.

See also: Command

Track_Glue (class)

Track_Glue

Command to glue two TSE3::Part objects in a TSE3::Track.

If there is no TSE3::Part at the specified time or it is not directly adjacent to another TSE3::part, then nothing will happen, and no error will be raised. It is suggested that you check that the command is worthwhile before you perform it. You can use the static valid() method to find out whether this command is valid before performing it.

See also: Command

Track_RemovePart (class)

Track_RemovePart

Command to remove a TSE3::Part from a TSE3::Track.

(Too insert a TSE3::Part use Part_Move.)

See also: Command

Track_Sort (class)

Track_Sort

Command to sort a;; TSE3::Track objects in a TSE3::Song.

See also: Command