class Track

Represents the concurrent musical sections of a Song. More...

Full nameTSE3::Track
Definition#include <Track.h>
InheritsTSE3::Listener [public ], TSE3::Listener [public ], TSE3::Notifier [public ], TSE3::Playable [public ], TSE3::Serializable [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Members


Detailed Description

A Track is a subunit of a Song. Many Tracks can exist in a Song and are played concurrently. You can imagine them to correspond to the different members of a band or orchestra.

Tracks contain a number of parameters that effect the way the musical data they contain is produced.

Tracks contain Parts. They 'own' them, and so a Part's lifetime is bound to it's parent Track. Parts are created by external agents - the user of the TSE3 library. Each Part has a well defined start and end time, and the Part objects in the Track may not overlap.

Command classes

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

See also: Song, Part

 Track ()

Track

 ~Track ()

~Track

[virtual]

const std::string & title ()

title

[const]

Read the Track title.

Returns: Track's title string

See also: setTitle

void  setTitle (const std::string &s)

setTitle

Set the Track title.

Parameters:
sNew title string

See also: title

MidiFilter * filter ()

filter

MidiFilter that affects how MidiEvents are produced by this Track.

Returns: Track's MidiFilter

MidiParams * params ()

params

The Track parameters.

Returns: Track's MidiParams

DisplayParams * displayParams ()

displayParams

The display parameters.

Returns: The Track's DisplayParams object

Song * parent ()

parent

[const]

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

Returns: Song this Track is inserted in

size_t  size ()

size

[const]

The number of Parts in this Track.

Returns: The number of Parts

Part * operator[] (size_t n)

operator[]

[const]

Return the Part at the given index

The value returned for an index that is out of range is undefined. The size method describes the valid values.

Parameters:
nIndex

Returns: Part at this index

Part * insert (Clock start, Clock end)

insert

Inserts a Part between the given times. The Track 'owns' this Part and will delete it when it is deleted.

If the Part cannot be inserted (due to Part overlap) a TrackError will be thrown.

Parameters:
startPart's start time
endPart's end time

Returns: New Part. If several Part objects are inserted (because action is Part::Under) the pointer to the first Part will be returned.

Throws: TrackError

void  insert (Part *part)

insert

Inserts the given Part into the Track at the Part's times.

This causes the Part to be 'owned' by the Track, it will be deleted when the Track is deleted.

You may not pass a Part that has already been inserted into a different (or indeed the same) Track (the TrackError exception will be thrown).

If the Part cannot be inserted (due to Part overlap) a TrackError will be thrown.

If the Part has invalid times (i.e. start after end) then a TrackError will be thrown.

Parameters:
NewPart to insert

Throws: TrackError

void  remove (Part *part)

remove

Remove the given Part.

The Part will not be deleted, it is no longer considered to be 'owned' by the Track.

If the Part is not in the Track then nothing will happen.

Parameters:
partPart to remove - you must now delete it

void  remove (size_t index)

remove

Remove the Part with the given index.

The Part will not be deleted, it is no longer considered to be 'owned' by the Track.

If the index is invalid then nothing will happen.

Parameters:
partPart to remove - you must now delete it

size_t  numPartsBetween (Clock start, Clock end)

numPartsBetween

Returns the number of Part objects (or bits of Part objects) that exist in the Track between the given times.

Parameters:
startStart of time zone
endEnd of time zone

Returns: Number of Part objects between times

int  operator< (const Track &t)

operator<

[const]

This less than operation compares the Tracks' title strings.

size_t  index (Clock c)

index

[const]

Returns the index of the first Part that occurs after the given Clock.

Parameters:
cClock value to search for

Returns: Index of first Part at or after this time. If past the end of the Track object then returns 'size'.

size_t  index (Part *part)

index

[const]

Returns the index of the specified Part (or size if not in this Track).

Parameters:
partPointer to @refPartTrack

Returns: The index of the specified Part, or size()

void  Notifier_Deleted (Part *)

Notifier_Deleted

[virtual]

Reimplemented from Listener for internal purposes..

PlayableIterator * iterator (Clock index)

iterator

[virtual]

Reimplemented from Playable for internal purposes..

Clock  lastClock ()

lastClock

[const virtual]

Reimplemented from Playable for internal purposes..

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

save

[const virtual]

Reimplemented from Serializable for internal purposes..

void  load (std::istream &in, SerializableLoadInfo &info)

load

[virtual]

Reimplemented from Serializable for internal purposes..

void  DisplayParams_Altered (DisplayParams *)

DisplayParams_Altered

[virtual]

friend class Song

Song