|
resonance 1.0.1
|
Repeating post that re-queues itself one period ahead each time it runs. More...
#include <gsperiodical.h>
Public Member Functions | |
| GsPeriodical (Sch::TickClock *pClock, PhraseMaker *pPhraseMaker, int nPeriod) | |
| void | Post () |
| Queue the first run, one period after the origin. | |
| void | Withdraw () |
| Withdraw the queued run. | |
| void | Run (int nTick) |
| Report the period that has elapsed at a song position and queue the next run. | |
Repeating post that re-queues itself one period ahead each time it runs.
The class emits no RTTI, because it is not polymorphic. Its title comes from the anonymous-namespace marker Q235_GLOBAL_$N$GsPeriodical.cppdKuhgb13PeriodicalCmd, which records the translation unit as GsPeriodical.cpp and a file-local command class as PeriodicalCmd. The class title is therefore inferred from the file name rather than attested by a descriptor.
The object is 0x14 bytes and AxingSTG builds one with the global operator new(0x14). The constructor writes kTickInfinity to mOrigin, then overwrites it with the origin PhraseMaker::GetPeriodOrigin() reports. AxePhraseMaker reports the constant 6.
Every song position the class computes is clamped to the finite range and passed through the discarded finiteness test, which is the expansion of an inline position type rather than arithmetic the class performs itself.
Every member is private. Only this class and its file-local command address them.
| GsPeriodical::GsPeriodical | ( | Sch::TickClock * | pClock, |
| PhraseMaker * | pPhraseMaker, | ||
| int | nPeriod ) |
| pClock | The clock the post runs on. |
| pPhraseMaker | The phrase maker the post drives. |
| nPeriod | The period in MIDI ticks. AxingSTG passes 0x780, one bar at 480 per quarter note. |
| void GsPeriodical::Post | ( | ) |
Queue the first run, one period after the origin.
| void GsPeriodical::Withdraw | ( | ) |
Withdraw the queued run.
| void GsPeriodical::Run | ( | int | nTick | ) |
Report the period that has elapsed at a song position and queue the next run.
PhraseMaker::OnPeriod() receives the distance from the origin divided by the period. PeriodicalCmd::Execute() is the one caller.
| nTick | The song position the run was queued for, in MIDI ticks. |