#include <Record.h>
Inheritance diagram for TSE3::App::Record:
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::PhraseEdit * | phraseEdit () 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 |
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.
|
Creates a new recording helper object. The initial values of start() and () default, and there is no PhraseEdit created (see phraseEdit()). |
|
Any allocated object will be deallocated. |
|
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.
|
|
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.
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. |
|
Returns the time recording was last started at, or -1 if recording has never been started. |
|
Returns the time recording was last ended at, or -1 if recording has never been ended. |
|
Returns a pointer to the current PhraseEdit object, or zero if no PhraseEdit has been created. |
|
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.
|
|
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. |
|
Reimplemented from TSE3::TransportListener. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|