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

TSE3::Part Class Reference

A placement of a Phrase in a Track. More...

#include <Part.h>

Inheritance diagram for TSE3::Part:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Part ()
 Part (Clock start, Clock end)
 Part (const Part &p)
virtual ~Part ()
Partoperator= (const Part &)
MidiFilterfilter ()
MidiParamsparams ()
DisplayParamsdisplayParams ()
Phrasephrase () const
void setPhrase (Phrase *p)
Trackparent () const
Clock start () const
void setStart (Clock c)
Clock end () const
void setEnd (Clock c)
void setStartEnd (Clock start, Clock end)
Clock repeat () const
void setRepeat (Clock r)
virtual void Notifier_Deleted (Phrase *phrase)
virtual void Phrase_Reparented (Phrase *)
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)
virtual void MidiFilter_Altered (MidiFilter *, int what)
virtual void MidiParams_Altered (MidiParams *, int what)
virtual void DisplayParams_Altered (DisplayParams *)

Friends

class Track

Detailed Description

A placement of a Phrase in a Track.

The Part class represents a placement of a Phrase in a Track. It holds a reference to the Phrase and the realtime parameters that affect how the Phrase sounds as it is played.

A Part can only exist in one Track at once.

Each Part has a start and end time, which it manages. Before you insert a Part in a Track ensure that you have set the appropriate times with setStart() and setEnd() or with the consolidated setStartEnd().

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

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

Author:
Pete Goodliffe
Version:
3.00
See also:
MidiEvent

Phrase

PhraseEdit


Constructor & Destructor Documentation

TSE3::Part::Part  ) 
 

Creates a Part that uses no Phrase. Set the Phrase with the setPhrase method.

The start and end points are set to a default. Set them with setStart and setEnd.

TSE3::Part::Part Clock  start,
Clock  end
 

Creates a Part that uses no Phrase and the given start and end points.

TSE3::Part::Part const Part p  ) 
 

virtual TSE3::Part::~Part  )  [virtual]
 


Member Function Documentation

Part& TSE3::Part::operator= const Part  ) 
 

MidiFilter* TSE3::Part::filter  ) 
 

MidiFilter that affects how are produced by this Part.

Returns:
The Part's MidiFilter object

MidiParams* TSE3::Part::params  ) 
 

The Part parameters that affects how are produced by this Part.

Returns:
The Part's MidiParams object

DisplayParams* TSE3::Part::displayParams  ) 
 

The display parameters.

Returns:
The Part's DisplayParams object

Phrase* TSE3::Part::phrase  )  const
 

Returns the Phrase this Part uses (or 0 if there is no current Phrase).

Returns:
The Part's Phrase
See also:
setPhrase

void TSE3::Part::setPhrase Phrase p  ) 
 

Sets the Phrase this Part uses.

The Phrase must be contained in the correct PhraseList for this operation to work. If the Phrase subequently is removed from a PhraseList the Part's Phrase pointer is reset.

You may specify a value of 0 for "use no @ref Phrase".

See also:
phrase
Exceptions:
PartError 

Track* TSE3::Part::parent  )  const
 

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

Returns:
Track this Part is inserted in

Clock TSE3::Part::start  )  const
 

Returns the start time of this Part.

This is meerly held for the convenience of the parent and is not used by the Part itself. In particular, it does not alter the relative times of the MidiEvents produced through the Playable interface: they remain relative to time zero.

Returns:
Part's start time
See also:
end

setStart

void TSE3::Part::setStart Clock  c  ) 
 

Sets the start time of this Part.

If the Part is inserted in a Track then the end time cannot be changed to before the start time.

Note that if the Part is in a Track and the change would cause an exception to be thrown by the Track's insert method then that exception will propagate from this method. However you can be assured that if this happens the Part will be left with times set as they were when you called the method.

Parameters:
c New start time
See also:
start

setStartEnd

Exceptions:
PartError 
TrackError 

Clock TSE3::Part::end  )  const
 

Returns the end time of this Part.

This is meerly held for the convenience of the parent and is not used by the Part itself.

Returns:
Part's end time
See also:
start

setEnd

void TSE3::Part::setEnd Clock  c  ) 
 

Sets the end time of this Part.

If the Part is inserted in a Track then the end time cannot be changed to before the start time.

Note that if the Part is in a Track and the change would cause an exception to be thrown by the Track's insert method then that exception will propagate from this method. However you can be assured that if this happens the Part will be left with times set as they were when you called the method.

Parameters:
c New end time
See also:
end

setStartEnd

Exceptions:
PartError 
TrackError 

void TSE3::Part::setStartEnd Clock  start,
Clock  end
 

Sets the start and end times of this Part.

You may wish to use this when the Part is inserted in a Track and you want to move the Part in such a way that calling setStart or setEnd first would throw an exception.

Note that if the Part is in a Track and the change would cause an exception to be thrown by the Track's insert method then that exception will propagate from this method. However you can be assured that if this happens the Part will be left with times set as they were when you called the method.

Parameters:
start New start time
end New end time
See also:
setStart

setEnd

Exceptions:
PartError 
TrackError 

Clock TSE3::Part::repeat  )  const
 

Returns the repeat time of this Part.

A repeat time of zero means no repeat.

Returns:
Repeat time value
See also:
setRepeat

void TSE3::Part::setRepeat Clock  r  ) 
 

Sets the repeat time of this Part.

Parameters:
r New repeat time value
See also:
repeat

virtual void TSE3::Part::Notifier_Deleted Phrase phrase  )  [virtual]
 

virtual void TSE3::Part::Phrase_Reparented Phrase  )  [virtual]
 

Reimplemented from TSE3::PhraseListener.

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

Implements TSE3::Playable.

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

Implements TSE3::Playable.

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

Reimplemented from TSE3::Serializable.

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

Reimplemented from TSE3::Serializable.

virtual void TSE3::Part::MidiFilter_Altered MidiFilter ,
int  what
[virtual]
 

Reimplemented from TSE3::MidiFilterListener.

virtual void TSE3::Part::MidiParams_Altered MidiParams ,
int  what
[virtual]
 

Reimplemented from TSE3::MidiParamsListener.

virtual void TSE3::Part::DisplayParams_Altered DisplayParams  )  [virtual]
 

Reimplemented from TSE3::DisplayParamsListener.


Friends And Related Function Documentation

friend class Track [friend]
 

The Track class is a friend so that it can access the () method.


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