resonance 1.0.1
Loading...
Searching...
No Matches
tickclock.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/timeclock.h"
4#include "mid/tick.h"
5#include "sch/time.h"
6
7namespace Sch {
8class CmdID;
9class Command;
10class TempoMap;
11} // namespace Sch
12
13namespace Sch {
14
40class TickClock : public TimeClock {
41public:
54 TickClock(Scheduler *pWatchdog, TempoMap *pTempoMap);
55
63
75 void SetTempoMap(TempoMap *pTempoMap);
76
89 int SongTick();
90
107
116 void PostAt(Command *pCommand, Time tick);
117
131 void PostAtSongTick(Command *pCommand, long long nTick, CmdID &id, int nUnused = 0);
132
141 void PostAtSongTick(Command *pCommand, long long nTick);
142
153};
154
155} // namespace Sch
Handle that identifies one batch of commands the scheduler has queued.
Definition cmdid.h:35
Base of every action the scheduler performs on behalf of another subsystem.
Definition command.h:60
Scheduler that runs queued commands when their due time arrives.
Definition scheduler.h:45
Affine map between a song position in MIDI ticks and scheduler time in nanoseconds.
Definition tempomap.h:43
void SetTempoMap(TempoMap *pTempoMap)
Share a different tempo map, giving back the reference to the current one.
void PostAt(Command *pCommand, Time tick)
Queue a command at an absolute scheduler time, discarding the handle.
TempoMap * mTempoMap
Map between song position and scheduler time.
Definition tickclock.h:152
void SetSongTick(Sch::Tick tick)
Move the clock to a song position.
void PostAtSongTick(Command *pCommand, long long nTick, CmdID &id, int nUnused=0)
Queue a command at a song position, under a handle the caller retains.
void PostAtSongTick(Command *pCommand, long long nTick)
Queue a command at a song position, discarding the handle.
TickClock(Scheduler *pWatchdog, TempoMap *pTempoMap)
Start a clock against a scheduler, with a tempo map of its own or a shared one.
~TickClock()
Give back the reference to the tempo map.
int SongTick()
Report the song position the clock has arrived at.
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
TimeClock(Scheduler *pWatchdog)
Scheduler time, as a signed 64-bit count.
Definition time.h:44
Scheduling of timed commands.
Definition activefilter.h:9