class Phrase

A list of MidiEvents with unique reference name. More...

Full nameTSE3::Phrase
Definition#include <Phrase.h>
InheritsTSE3::Listener [public ], TSE3::MidiData [public ], TSE3::Notifier [public ], TSE3::Serializable [public ]
List of all Methods
Annotated List

Public Methods

Public Members

Detailed Description

The Phrase class is a MidiData object with a unique reference name.

Phrases are held in a PhraseList. This PhraseList is the context of the unique name - there can be two Song objects which have Phrases with the same name, but you can't have two Phrases with the same name in one PhraseList.

Phrases are only generated by PhraseEdit objects (see PhraseEdit::createPhrase() for details).

Phrases are used in a Part to produce MIDI data in the Song.

The Phrase has a DisplayParameters object associated with it which may be used by an application to redraw the Phrase in any Part on screen (this use is optional). If you use this, a Part DisplayParams should superceed any Phrase DisplayParams.

Command classes

Use the following command classes to manipute this object in a undo/redo environment.

See also: MidiData, PhraseList

 ~Phrase ()



PhraseList * parent ()



Returns a pointer to the parent PhraseList that this Phrase has been inserted into. If this Phrase has not been inserted in a PhraseList, this method returns zero.

Returns: PhraseList this Phrase is inserted in

const std::string & title ()



Returns the unique title of this Phrase.

Returns: Phrase's title

See also: setTitle

void  setTitle (const std::string &title)


Sets the unique Phrase title. Since the Phrase is held in a PhraseList, the new name must be unique in this list. If it is not, a PhrseListError is thrown and the name is not changed.

titleNew Phrase title

Throws: PhraseListError

See also: title

DisplayParams * displayParams ()


The display parameters.

Returns: The Part's DisplayParams object

int  operator< (const Phrase &p)



This operator works on the value of the title alone

int  operator== (const Phrase &p)



This operator works on the value of the title alone

void  save (std::ostream &o, int i)


[const virtual]

Implementation of the Serializable interface

NB: Loading is done by the PhraseList. A Phrase can't be altered so it can't logically load itself. Sigh.

Reimplemented from Serializable for internal purposes..

friend class PhraseEdit


friend class PhraseList


void  DisplayParams_Altered (DisplayParams *)