|
wavelength 1.0.0
|
Queue of commands that run when the song clock reaches their tick. More...
#include <scheduler.h>
Classes | |
| class | CommandInfo |
| One queued run of a command. More... | |
| class | CancelPred |
| Test that selects the runs Cancel() withdraws. More... | |
| class | ByCommand |
| Test that selects the runs of one command. More... | |
| class | Recorder |
| Writer of the recordable runs to a file of a memory card, in parts. More... | |
| class | Playbacker |
| Reader of a recording that queues its runs on a scheduler. More... | |
Public Member Functions | |
| Scheduler () | |
| Construct a stopped scheduler with no command. | |
| ~Scheduler () | |
| Release the queued commands, the recorder, and the playback. | |
| void | Reset (const float *pTickDuration, int nTick) |
| Stop the clock, drop every command, and set the clock to a tick at normal speed. | |
| void | ResetForRecording (const float *pTickDuration, const char *pszFile, int nDevice, int nTick) |
| Reset the clock for a recorded song. | |
| void | ResetForPlayback (const float *pTickDuration, const char *pszFile, int nTick) |
| Reset the clock and replay the commands a file recorded. | |
| void | ResetForPlayback (const float *pTickDuration, char *pBuffer, int nSize, int nTick) |
| Reset the clock and replay the commands a buffer recorded. | |
| void | Resume () |
| Restart the clock after Pause(). | |
| void | Pause () |
| Stop the clock, and save what the recorder holds. | |
| bool | IsRunning () |
| Report whether the clock runs. | |
| void | SetSpeed (float fSpeed) |
| Set the rate of the clock. | |
| float | GetSpeed () |
| Report the rate of the clock. | |
| void | PostAtTime (Command *pCommand, float fTime, const CommandId &id, bool bRecordable) |
| Run a command at a time, with a tag stored beside the entry. | |
| void | PostAtTime (Command *pCommand, float fTime, bool bRecordable) |
| Run a command at a time. | |
| void | PostAfter (Command *pCommand, float fDelay, const CommandId &id, bool bRecordable) |
| Run a command a time from now, with a tag stored beside the entry. | |
| void | PostAfter (Command *pCommand, float fDelay, bool bRecordable) |
| Run a command a time from now. | |
| void | PostAt (Command *pCommand, int nTick, const CommandId &id, bool bRecordable) |
| Run a command at a tick, with a tag stored beside the entry. | |
| void | PostAt (Command *pCommand, int nTick, bool bRecordable) |
| Run a command at a tick. | |
| void | PostIn (Command *pCommand, int nDelayTicks, const CommandId &id, bool bRecordable) |
| Run a command a number of ticks from now. | |
| void | PostIn (Command *pCommand, int nDelayTicks, bool bRecordable) |
| Run a command a number of ticks from now. | |
| float | GetClockTime () |
| Report the clock time. | |
| int | GetClockTick () |
| Report the clock tick. | |
| void | Clear () |
| Drop every queued command. | |
| void | Cancel (Command *pCommand) |
| Withdraw every queued run of a command. | |
| void | Poll () |
| Advance the clock to the current time and run the commands it passed. | |
| const std::multiset< CommandInfo > & | GetCommands () const |
| const float * | GetTickDuration () const |
| float | GetTime () const |
| int | GetTick () const |
| float | GetFrameTime () const |
| int | GetFrameTick () const |
| float | GetPrevFrameTime () const |
| int | GetPrevFrameTick () const |
Queue of commands that run when the song clock reaches their tick.
The RTTI includes the name in the nested classes CommandInfo, ByCommand, ByID, and CancelPred. The class is not polymorphic. A recordable command can be written to a recording as it runs, and a recording replays its commands into the queue.
| Scheduler::Scheduler | ( | ) |
Construct a stopped scheduler with no command.
| Scheduler::~Scheduler | ( | ) |
Release the queued commands, the recorder, and the playback.
| void Scheduler::Reset | ( | const float * | pTickDuration, |
| int | nTick ) |
Stop the clock, drop every command, and set the clock to a tick at normal speed.
The name is inferred.
| pTickDuration | The duration of one tick in milliseconds, which the scheduler retains. |
| nTick | The tick. |
| void Scheduler::ResetForRecording | ( | const float * | pTickDuration, |
| const char * | pszFile, | ||
| int | nDevice, | ||
| int | nTick ) |
Reset the clock for a recorded song.
The shipped body passes only the tick duration and the tick to Reset(). The name is inferred.
| pTickDuration | The duration of one tick in milliseconds. |
| pszFile | The file to record to. |
| nDevice | The memory card to record to, or -1 for the host. |
| nTick | The tick. |
| void Scheduler::ResetForPlayback | ( | const float * | pTickDuration, |
| const char * | pszFile, | ||
| int | nTick ) |
Reset the clock and replay the commands a file recorded.
The name is inferred.
| pTickDuration | The duration of one tick in milliseconds. |
| pszFile | The recording. |
| nTick | The tick. |
| void Scheduler::ResetForPlayback | ( | const float * | pTickDuration, |
| char * | pBuffer, | ||
| int | nSize, | ||
| int | nTick ) |
Reset the clock and replay the commands a buffer recorded.
The name is inferred.
| pTickDuration | The duration of one tick in milliseconds. |
| pBuffer | The recording. |
| nSize | The size of the recording in bytes. |
| nTick | The tick. |
| void Scheduler::Resume | ( | ) |
| void Scheduler::Pause | ( | ) |
Stop the clock, and save what the recorder holds.
| bool Scheduler::IsRunning | ( | ) |
Report whether the clock runs.
| void Scheduler::SetSpeed | ( | float | fSpeed | ) |
Set the rate of the clock.
| fSpeed | The rate, 1 for real time. |
| float Scheduler::GetSpeed | ( | ) |
Report the rate of the clock.
The name is inferred.
| void Scheduler::PostAtTime | ( | Command * | pCommand, |
| float | fTime, | ||
| const CommandId & | id, | ||
| bool | bRecordable ) |
Run a command at a time, with a tag stored beside the entry.
| pCommand | The command. |
| fTime | The time, in milliseconds. |
| id | The tag stored with the entry. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostAtTime | ( | Command * | pCommand, |
| float | fTime, | ||
| bool | bRecordable ) |
Run a command at a time.
The name is inferred.
| pCommand | The command. |
| fTime | The time, in milliseconds. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostAfter | ( | Command * | pCommand, |
| float | fDelay, | ||
| const CommandId & | id, | ||
| bool | bRecordable ) |
Run a command a time from now, with a tag stored beside the entry.
| pCommand | The command. |
| fDelay | The delay, in milliseconds. |
| id | The tag stored with the entry. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostAfter | ( | Command * | pCommand, |
| float | fDelay, | ||
| bool | bRecordable ) |
Run a command a time from now.
| pCommand | The command. |
| fDelay | The delay, in milliseconds. |
| bRecordable | The command is recorded for replay. |
Run a command at a tick, with a tag stored beside the entry.
| pCommand | The command. |
| nTick | The tick. |
| id | The tag stored with the entry. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostAt | ( | Command * | pCommand, |
| int | nTick, | ||
| bool | bRecordable ) |
Run a command at a tick.
| pCommand | The command. |
| nTick | The tick. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostIn | ( | Command * | pCommand, |
| int | nDelayTicks, | ||
| const CommandId & | id, | ||
| bool | bRecordable ) |
Run a command a number of ticks from now.
The entry is stored with TheDefaultCommandId, whatever id is.
| pCommand | The command. |
| nDelayTicks | The delay. |
| id | Not used. |
| bRecordable | The command is recorded for replay. |
| void Scheduler::PostIn | ( | Command * | pCommand, |
| int | nDelayTicks, | ||
| bool | bRecordable ) |
Run a command a number of ticks from now.
| pCommand | The command. |
| nDelayTicks | The delay. |
| bRecordable | The command is recorded for replay. |
| float Scheduler::GetClockTime | ( | ) |
Report the clock time.
| int Scheduler::GetClockTick | ( | ) |
Report the clock tick.
| void Scheduler::Clear | ( | ) |
Drop every queued command.
The name is inferred.
| void Scheduler::Cancel | ( | Command * | pCommand | ) |
Withdraw every queued run of a command.
| pCommand | The command. |
| void Scheduler::Poll | ( | ) |
Advance the clock to the current time and run the commands it passed.
The name is inferred.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |