Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::Song Class Reference

A piece of playable music. More...

#include <Song.h>

Inheritance diagram for TSE3::Song:

Inheritance graph
[legend]
Collaboration diagram for TSE3::Song:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Song (int noTracks=defaultNoTracks)
virtual ~Song ()
PhraseListphraseList ()
TempoTracktempoTrack ()
TimeSigTracktimeSigTrack ()
KeySigTrackkeySigTrack ()
FlagTrackflagTrack ()
const std::string & title () const
void setTitle (const std::string &s)
const std::string & author () const
void setAuthor (const std::string &s)
const std::string & copyright () const
void setCopyright (const std::string &s)
const std::string & date () const
void setDate (const std::string &s)
size_t size () const
Trackoperator[] (size_t n) const
size_t index (Track *track) const
Trackinsert (int n=-1)
void insert (Track *track, int n=-1)
void remove (size_t n)
void remove (Track *track)
int soloTrack () const
void setSoloTrack (int t)
bool repeat () const
void setRepeat (bool status)
Clock from () const
void setFrom (Clock from)
Clock to () const
void setTo (Clock to)
virtual void Track_PartInserted (Track *, Part *)
virtual void Track_PartRemoved (Track *, Part *)
virtual void Notifier_Deleted (Track *)
virtual PlayableIteratoriterator (Clock index)
virtual Clock lastClock () const
virtual void save (std::ostream &o, int i) const
virtual void load (std::istream &in, SerializableLoadInfo &info)

Static Public Attributes

const int defaultNoTracks = 16

Detailed Description

A piece of playable music.

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 are used by Part objects held within each Track).

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

Author:
Pete Goodliffe
Version:
3.00
See also:
Notifier

Track


Constructor & Destructor Documentation

TSE3::Song::Song int  noTracks = defaultNoTracks  ) 
 

Creates a Song containing the given number of . Each Track will be empty.

Parameters:
noTracks The initial number of (empty) ; omit this value for a default (16)

virtual TSE3::Song::~Song  )  [virtual]
 


Member Function Documentation

PhraseList* TSE3::Song::phraseList  ) 
 

Returns the Song's PhraseList.

Returns:
Song's PhraseList

TempoTrack* TSE3::Song::tempoTrack  ) 
 

Returns the Song's TempoTrack.

Returns:
Song's TempoTrack

TimeSigTrack* TSE3::Song::timeSigTrack  ) 
 

Returns the Song's TimeSigTrack.

Returns:
Song's TimeSigTrack

KeySigTrack* TSE3::Song::keySigTrack  ) 
 

Returns the Song's KeySigTrack.

Returns:
Song's KeySigTrack

FlagTrack* TSE3::Song::flagTrack  ) 
 

Returns the Song's FlagTrack.

Returns:
Song's FlagTrack

const std::string& TSE3::Song::title  )  const
 

Read the Song title.

Returns:
Song's title string
See also:
setTitle

void TSE3::Song::setTitle const std::string &  s  ) 
 

Set the Song title.

Parameters:
s New Song title string
See also:
title

const std::string& TSE3::Song::author  )  const
 

Read the Song author.

Returns:
Song's author string
See also:
setAuthor

void TSE3::Song::setAuthor const std::string &  s  ) 
 

Set the Song author.

Parameters:
s New Song author string
See also:
author

const std::string& TSE3::Song::copyright  )  const
 

Read the Song copyright message.

Returns:
Song's copyright message string
See also:
setCopyright

void TSE3::Song::setCopyright const std::string &  s  ) 
 

Set the Song copyright message.

Parameters:
s New Song copyright message string
See also:
copyright

const std::string& TSE3::Song::date  )  const
 

Read the Song date.

Returns:
Song's date string
See also:
setDate

void TSE3::Song::setDate const std::string &  s  ) 
 

Set the Song date.

Parameters:
s New Song date string
See also:
date

size_t TSE3::Song::size  )  const
 

Returns the number of Track objects in the Song.

Returns:
Number of Track objects in the Song

Track* TSE3::Song::operator[] size_t  n  )  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 TSE3::Song::index Track track  )  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* TSE3::Song::insert int  n = -1  ) 
 

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 TSE3::Song::insert Track track,
int  n = -1
 

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
Exceptions:
SongError 

void TSE3::Song::remove size_t  n  ) 
 

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 TSE3::Song::remove Track track  ) 
 

Removes the given Track. This will not delete it.

Track to remove - you must now delete it

int TSE3::Song::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 TSE3::Song::setSoloTrack int  t  ) 
 

Set the solo Track.

Parameters:
t New solo track (or -1 to disable solo)
See also:
soloTrack

bool TSE3::Song::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 TSE3::Song::setRepeat bool  status  ) 
 

Sets the repeat modes status.

Parameters:
status Whether to repeat
See also:
repeat

Clock TSE3::Song::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 TSE3::Song::setFrom Clock  from  ) 
 

Sets the 'from' value.

Parameters:
from New 'from' value
See also:
from

Clock TSE3::Song::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 TSE3::Song::setTo Clock  to  ) 
 

Sets the 'to' value.

Parameters:
to New 'to' value
See also:
to

virtual void TSE3::Song::Track_PartInserted Track ,
Part
[virtual]
 

Reimplemented from TSE3::TrackListener.

virtual void TSE3::Song::Track_PartRemoved Track ,
Part
[virtual]
 

Reimplemented from TSE3::TrackListener.

virtual void TSE3::Song::Notifier_Deleted Track  )  [virtual]
 

virtual PlayableIterator* TSE3::Song::iterator Clock  index  )  [virtual]
 

Implements TSE3::Playable.

virtual Clock TSE3::Song::lastClock  )  const [virtual]
 

This value is cached, not recalculated each time.

Implements TSE3::Playable.

virtual void TSE3::Song::save std::ostream &  o,
int  i
const [virtual]
 

Important note
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 TSE3::Serializable.

virtual void TSE3::Song::load std::istream &  in,
SerializableLoadInfo info
[virtual]
 

Important note
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 TSE3::Serializable.


Member Data Documentation

const int TSE3::Song::defaultNoTracks = 16 [static]
 

The default number of in a new Song.


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:46:59 2005 for TSE3 by doxygen 1.3.2