|
|
The Song is the container of an entire piece of music. It contains a number of Track s, which play concurrently - they correspond to the different members in a band playing together.
The Song class also holds a TempoTrack, TimeSigTrack, KeySigTrack, and FlagTrack. It conatins the PhraseList which holds the list of every Phrase in the Song. (The Phrases are used by Part objects held within each Track).
Use the following command classes to manipute this object in a undo/redo environment.
See also: Notifier, Track
| static const int defaultNoTracks | defaultNoTracks |
| Song (int noTracks = defaultNoTracks)
| Song |
Creates a Song containing the given number of Tracks. Each Track will be empty.
Parameters:
| noTracks | The initial number of (empty) Tracks; omit this value for a default (16) |
| ~Song ()
| ~Song |
[virtual]
| PhraseList * phraseList ()
| phraseList |
Returns the Song's PhraseList.
Returns: Song's PhraseList
| TempoTrack * tempoTrack ()
| tempoTrack |
Returns the Song's TempoTrack.
Returns: Song's TempoTrack
| TimeSigTrack * timeSigTrack ()
| timeSigTrack |
Returns the Song's TimeSigTrack.
Returns: Song's TimeSigTrack
| KeySigTrack * keySigTrack ()
| keySigTrack |
Returns the Song's KeySigTrack.
Returns: Song's KeySigTrack
| FlagTrack * flagTrack ()
| flagTrack |
Returns the Song's FlagTrack.
Returns: Song's FlagTrack
| const std::string & title ()
| title |
[const]
Read the Song title.
Returns: Song's title string
See also: setTitle
| void setTitle (const std::string &s)
| setTitle |
Set the Song title.
Parameters:
| s | New Song title string |
See also: title
| const std::string & author ()
| author |
[const]
Read the Song author.
Returns: Song's author string
See also: setAuthor
| void setAuthor (const std::string &s)
| setAuthor |
Set the Song author.
Parameters:
| s | New Song author string |
See also: author
| const std::string & copyright ()
| copyright |
[const]
Read the Song copyright message.
Returns: Song's copyright message string
See also: setCopyright
| void setCopyright (const std::string &s)
| setCopyright |
Set the Song copyright message.
Parameters:
| s | New Song copyright message string |
See also: copyright
| const std::string & date ()
| date |
[const]
Read the Song date.
Returns: Song's date string
See also: setDate
| void setDate (const std::string &s)
| setDate |
Set the Song date.
Parameters:
| s | New Song date string |
See also: date
| size_t size ()
| size |
[const]
Returns the number of Track objects in the Song.
Returns: Number of Track objects in the Song
| Track * operator[] (size_t n)
| operator[] |
[const]
Returns the Track 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:
| n | Index |
Returns: Track at this index
| size_t index (Track *track)
| index |
[const]
Returns the index of the specified Track (or size if not in this Song).
Parameters:
| track | Pointer to Track |
Returns: The index of the specified Track, or size()
| Track * insert (int n = -1)
| insert |
Inserts a Track at the given position. If you don't specify a position, the the Track will be inserted at the end.
This causes the Track to be 'owned' by the Song, it will be deleted when the Song is deleted.
Parameters:
| n | Index to insert at, or -1 for 'at end' |
Returns: Pointer to the new Track (which will be deleted by the Song)
| void insert (Track *track, int n = -1)
| insert |
Insert this Track at the given position. If you don't specify a position, the the Track will be inserted at the end.
This causes the Track to be 'owned' by the Song, it will be deleted when the Song is deleted.
If the Track has already been inserted in a Song, the SongError exception will be thrown.
Parameters:
| track | Track to insert |
| n | Index to insert at |
Throws: SongError
| void remove (size_t n)
| remove |
Remove the Track at the given position. This will not delete it.
Parameters:
| n | Index of Track to remove - you must now delete it |
| void remove (Track *track)
| remove |
Removes the given Track. This will not delete it.
track Track to remove - you must now delete it
| int soloTrack ()
| soloTrack |
[const]
Returns the currently soloed Track.
A value of -1 means that no Track is soloed.
By default, no Track is soloed.
Returns: Current solo Track (or -1 for none)
See also: setSoloTrack
| void setSoloTrack (int t)
| setSoloTrack |
Set the solo Track.
Parameters:
| t | New solo track (or -1 to disable solo) |
See also: soloTrack
| bool repeat ()
| repeat |
[const]
Returns whether the repeat facility is enabled.
When repeat is on, the Transport object will loop playback from the to to the from positions.
By default, repeat is disabled.
Returns: Whether repeat is enabled
See also: setRepeat, from, to
| void setRepeat (bool status)
| setRepeat |
Sets the repeat modes status.
Parameters:
| status | Whether to repeat |
See also: repeat
| Clock from ()
| from |
[const]
Return the 'from' value. This is the left repeat marker position. When repeat is enabled in the Transport object time will loop back to here from the to position.
Returns: The 'from' value
See also: to, setFrom
| void setFrom (Clock from)
| setFrom |
Sets the 'from' value.
Parameters:
| from | New 'from' value |
See also: from
| Clock to ()
| to |
[const]
Return the 'to' value. This is the right repeat marker position. When repeat is enabled in the Transport object time will loop back from here from the from position.
Returns: The 'to' value
See also: from, setTo
| void setTo (Clock to)
| setTo |
Sets the 'to' value.
Parameters:
| to | New 'to' value |
See also: to
| void Track_PartInserted (Track *, Part *)
| Track_PartInserted |
[virtual]
| void Track_PartRemoved (Track *, Part *)
| Track_PartRemoved |
[virtual]
| void Notifier_Deleted (Track *)
| 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]
This value is cached, not recalculated each time.
Reimplemented from Playable for internal purposes..
| void save (std::ostream &o, int i)
| save |
[const virtual]
You do not have to use this method directly, instead use the TSE3MDL class which takes care of the entire load/save process.
Reimplemented from Serializable for internal purposes..
| void load (std::istream &in, SerializableLoadInfo &info)
| load |
[virtual]
You do not have to use this method directly, instead use the TSE3MDL class which takes care of the entire load/save process.
Reimplemented from Serializable for internal purposes..