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

TSE3::App::Record Class Reference

Support class for recording. More...

#include <Record.h>

Inheritance diagram for TSE3::App::Record:

Inheritance graph
[legend]
Collaboration diagram for TSE3::App::Record:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Record (TSE3::Transport *transport)
 ~Record ()
void start (TSE3::Song *p, TSE3::Track *t)
void stop ()
TSE3::Clock startTime () const
TSE3::Clock endTime () const
TSE3::PhraseEditphraseEdit () const
void insertPhrase (const std::string &title, bool replacePhrase, bool insertPart, int insertAction, TSE3::Cmd::CommandHistory *history=0)
void reset ()
void Transport_Status (TSE3::Transport *, int status)

Protected Attributes

TSE3::Transport_transport
TSE3::PhraseEdit_phraseEdit
TSE3::Song_song
TSE3::Track_track
TSE3::Clock _startTime
TSE3::Clock _endTime
bool recording

Detailed Description

Support class for recording.

This class provides help using the Transport object's record facilities. When using the Transport record API, you need to create a PhraseEdit and keep track of when you started and stopped recording.

After recording you will need to supply a name for the new Phrase and then have it inserted into the Song.

The job of this helper class is to aid this process. The lifetime of the objects involved are managed, and the actions needed are encapsulated in these methods.

It is assumed that neither the Transport object or the MidiScheduler object will be deleted from under the Recording object's feet.

Author:
Pete Goodliffe
Version:
1.00
See also:
TSE3


Constructor & Destructor Documentation

TSE3::App::Record::Record TSE3::Transport transport  ) 
 

Creates a new recording helper object.

The initial values of start() and () default, and there is no PhraseEdit created (see phraseEdit()).

TSE3::App::Record::~Record  ) 
 

Any allocated object will be deallocated.


Member Function Documentation

void TSE3::App::Record::start TSE3::Song p,
TSE3::Track t
 

Start recording at the current MidiScheduler time. This will create a new PhraseEdit object.

You must pass a Song and Track parameter. These are used to pass a Playable and parameter to the TSE3::Transport::record() method.

It is also used later on to insert a Part into the Track.

If you call start a second time, whilst recording is taking place, then it is equivalent to calling stop().

You don't have to call Record::stop(), you can just use TSE3::Transport::stop(). However, read the documentation for this object's stop method for information on the callback generated.

See also:
stop

void TSE3::App::Record::stop  ) 
 

Stops recording at the current MidiScheduler time. Sends a notification to any TSE3::Listener objects.

You do not have to call this to stop recording: any call to TSE3::Transport::stop() will cause the Record object to notice, and notify any listeners.

Notification
The notification is only sent if there was something recorded into the PhraseEdit object.

If you handle the callback you must take care to check the TSE3::Song and TSE3::Track parameters. If there are two or more objects that use the Record utility, they will both receive the notification and will have to check whether it was a recording that they started or not.

start

TSE3::Clock TSE3::App::Record::startTime  )  const [inline]
 

Returns the time recording was last started at, or -1 if recording has never been started.

TSE3::Clock TSE3::App::Record::endTime  )  const [inline]
 

Returns the time recording was last ended at, or -1 if recording has never been ended.

TSE3::PhraseEdit* TSE3::App::Record::phraseEdit  )  const [inline]
 

Returns a pointer to the current PhraseEdit object, or zero if no PhraseEdit has been created.

void TSE3::App::Record::insertPhrase const std::string &  title,
bool  replacePhrase,
bool  insertPart,
int  insertAction,
TSE3::Cmd::CommandHistory history = 0
 

Inserts the recorded Phrase into the Song. You specify a name for the new Phrase.

This method may propagate the PhraseList exception if the Phrase name already exists.

After the action has been carried out, the internally allocated PhraseEdit object is deallocated.

This operation will be performed using objects, and the object will be placed on the TSE3::Cmd::CommandHistory object specified.

Parameters:
title New Phrase title (must be unique)
replacePhrase If the Phrase name already exists, setting this to true will replace it.
insertAction A TSE3::Cmd::Part_Move::PartInsertAction value.
history TSE3::Cmd::CommandHistory object to place undoable commands onto. Specify zero will not store any commands.

void TSE3::App::Record::reset  ) 
 

Ensures that all objects are deallocated, in case the recording has ended but the user doesn't want to save the recording into the Song.

It's not strictly necessary to call this if you are not going to call insertPhrase(). Without calling this the next call to start() will handle object reallocation successfully. However, by calling this you will free up resources that aren't currently needed.

void TSE3::App::Record::Transport_Status TSE3::Transport ,
int  status
[virtual]
 

Reimplemented from TSE3::TransportListener.


Member Data Documentation

TSE3::Transport* TSE3::App::Record::_transport [protected]
 

TSE3::PhraseEdit* TSE3::App::Record::_phraseEdit [protected]
 

TSE3::Song* TSE3::App::Record::_song [protected]
 

TSE3::Track* TSE3::App::Record::_track [protected]
 

TSE3::Clock TSE3::App::Record::_startTime [protected]
 

TSE3::Clock TSE3::App::Record::_endTime [protected]
 

bool TSE3::App::Record::recording [protected]
 


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