resonance 1.0.1
Loading...
Searching...
No Matches
genericsequencer.h
Go to the documentation of this file.
1#pragma once
2
3#include "mid/tick.h"
4#include "sch/cmdid.h"
5#include "sch/tickclock.h"
6
7class MsgSink;
8class SequencerCmd;
9
26public:
35 }
36
42 virtual void Dispatch() = 0;
43
50 }
51
61 void Withdraw() {
62 const Sch::CmdID id = mCmdId;
63 mClock->Withdraw(id);
64 }
65
66protected:
67 // The handle value of a command the clock has not queued yet.
68 enum { kUnallocatedCommand = -2 };
69
70 // The handle SequencerCmd is queued under.
72 // The command that runs Dispatch(), created by the first post.
74 // The clock Post() queues against.
76 // The clock's song position when Post() ran.
78 // Subtracted from every message's position. The constructor builds it from zero through the
79 // checking Sch::Tick constructor.
81 // The sink every dispatched message goes to.
83};
virtual ~GenericSequencer()
Release the sequencer.
Definition genericsequencer.h:49
virtual void Dispatch()=0
Send the message at the cursor and schedule the next one.
GenericSequencer()
Prepare a sequencer before any post.
Definition genericsequencer.h:33
Sch::Tick mStartTick
Definition genericsequencer.h:77
SequencerCmd * mCommand
Definition genericsequencer.h:73
Sch::TickClock * mClock
Definition genericsequencer.h:75
@ kUnallocatedCommand
Definition genericsequencer.h:68
Sch::CmdID mCmdId
Definition genericsequencer.h:71
MsgSink * mSink
Definition genericsequencer.h:82
Sch::Tick mOffset
Definition genericsequencer.h:80
void Withdraw()
Withdraw every command queued under the handle.
Definition genericsequencer.h:61
Receiver of engine messages.
Definition msgsink.h:37
Handle that identifies one batch of commands the scheduler has queued.
Definition cmdid.h:35
Pausable view of scheduler time, together with the tempo that maps it to a song position.
Definition tickclock.h:40
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
Scheduler command that runs a sequencer's next dispatch.
Definition sequencercmd.h:18