BrahmsCore documentation
Index
Annotated List
Hierarchy
Globals
Files

class Part

A Part is thought of as a container for events (like Notes, MasterEvents, etc.

#include <splitPart.h>

Inherits: Compound

More...


List of all Methods

Public Members

Protected Members


Detailed Description

A Part is thought of as a container for events (like Notes, MasterEvents, etc. An Event is an Atom which has a position and a length). These events have to appear ordered in their position property. More than one event at the same position are admitted.

Each Part owns a Pointer to a current event. This pointer can move back and forth within the list of events like the head of a turing machine. Loops are achived via these operations.

A Part also contains a memory in terms of a table. With certain methods, references to events can be put into memory and taken out again. This is important for the play-operation


Part ()

Constructs an empty part with an empty memory


Part (Part*)

Constructs a part from another part. Caution: Memory is not duplicated!


Part (Track*)

Constructs a part and remembers the track it belongs to (important for presentations)


~Part ()

Destructor


Position start ()

returns the start position of the part


int key ()

returns the key


int clef ()

returns the clef


int meter0 ()

returns the numerator of the measure


int meter1 ()

returns the denominator of the measure


int program ()

returns the midi program


Track * track ()

returns the track the part belongs to, or 0 if this informaition does not exist!


void setStart (Position)

sets the start position of the part


void setKey (int key)

sets the key


void setClef (int clef)

sets the clef


void setMeter (int numerator,int denominator)

sets the numerator and denominator of the measure


void setMeter0 (int numerator)

sets the numerator of the measure


void setMeter1 (int denominator)

sets the denominator of the measure


void setProgram (int program)

sets the midi program


void setTrack (Track *)

sets the track


void rewind ()

sets the pointer to the beginning

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool wind (Position p)

sets the pointer to the event at position p (or later) returns true in case of success

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool current (Type)

checks type of the event pointed to by the pointer

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool currentStartsBefore (long p)

returns true if the pointer starts before position p

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool currentStartsBehind (long p)

returns true if the pointer starts behind position p

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool currentStartsAt (long p)

returns true if the pointer starts at position p

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool currentEndsBehind (long p)

returns true if the pointer ends behind position p


long currentPos ()

returns the absolute position of the current event (including the part's offset!)


Event * current ()

returns the pointer (only use if you have to!!!)

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


bool currentInc ()

increments the pointer. Returns false if incrementation cannot be done

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


void flushCurrent ()

flushes properties of current pointer to std out.

See also: rewind(), wind(), current(), currentStartsBefore(), currentStartsBehind(), currentStartsAt(), currentInc()


void rememberCurrent ()

adds the current event to the internal memory

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


void startMem ()

sets the internal memory pointer (not to be with the internal event pointer s.a.!) to the beginning of the memory table

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


bool moreMem ()

returns true if the memory pointer exists and false if it is zero, which is the case at the end of a loop

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


void incMem ()

increments the memory pointer

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


void cutMem ()

removes the memory pointers reference from the memory table

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


void clearMem ()

clears the memory table

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


bool memEndsAt (long p)

returns true if the event pointed to by the memory pointer ends at the given position p and false otherwise

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


Event * mem ()

returns the event pointed to by the memory pointer. (Don't use if you can avoid it)

See also: startMem(), incMem(), moreMem(), cutMem(), clearMem(), memEndsAt(), mem(), rememberCurrent()


PrPart * presentation ()

This funktion returns a pointer to its presentation


Reference * makeRefs (int lowPitch, int highPitch, long left, long right)

returns a list of references containing events between left and right, where notes also have their pitch to be between lowPitch and highPitch


Part * partGlue ()

glues two parts. Returns the 'lost' part which should not be deleted if the operation is to be undone


Event * partSplit (Position p)

splits the part at position p and returns the event after p (or null)


void add (Element *) [virtual]

this add method differs from the compounds add method by inserting the new element not at the end of the part, but at the correct position


ostream & print (int,ostream&) [virtual]

* Virtual operations, each element has to implement * -------------------------------------------------


Generated by: wuerthne@clouseau on Fri Jan 19 23:08:00 200.