resonance 1.0.1
Loading...
Searching...
No Matches
autoriffer.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/msgsink.h"
4#include "app/msgsource.h"
6#include "game/player.h"
7#include "game/quantizer.h"
8#include "game/riff.h"
9#include "game/trackdata.h"
10#include "gs/musesynth.h"
11#include "msg/erasemsg.h"
12#include "msg/message.h"
13#include "msg/pitchriffmsg.h"
14#include "msg/stopriffmsg.h"
15#include "msg/trackselectmsg.h"
16#include "sch/cmdid.h"
17#include "sch/tickclock.h"
18
39class AutoRiffer : public MsgSink {
40public:
48 AutoRiffer(Sch::TickClock *pClock, Quantizer *pQuantizer, const TrackData *pTrackData);
49
54 virtual ~AutoRiffer();
55
63 virtual void DispatchPriv(Message *pMsg);
64
76 void OnCommand(int nTick);
77
87 void AddSink(MsgSink *pSink);
88
89private:
98 void OnPitchRiff(PitchRiffMsg *pMsg);
99
110 void OnStopRiff(StopRiffMsg *pMsg);
111
118 void OnErase(EraseMsg *pMsg);
119
127 void StopRiff(int nTick);
128
136 void PlayRiff(int nTick);
137
146 void OnGameOver();
147
154 void OnTrackSelect(TrackSelectMsg *pMsg);
155
156 int mTrack; // +0x04, copied from TrackData::mIndex
157 Quantizer *mQuantizer; // +0x08
158 const TrackData *mTrackData; // +0x0c
159 Riff *mCurrentRiff; // +0x10
160 int mLevelHeld[4]; // +0x14, one flag per difficulty level, cleared with memset
161 Sch::TickClock *mClock; // +0x24
162 Sch::CmdID mCommand; // +0x28, the handle the file-local Cmd is queued under
163
164public:
175
178
181
182private:
183 Player *mPlayer; // +0x48, the file-scope NullPlayer until a TrackSelectMsg assigns one
184};
MuseSynth * mSynth
Synthesiser AxingSTG installs while it wires the stage up.
Definition autoriffer.h:174
virtual void DispatchPriv(Message *pMsg)
Act on a message.
void AddSink(MsgSink *pSink)
Add a sink to mSource.
void OnCommand(int nTick)
Repeat the current riff at a song position, or release the buttons.
AutoRiffer(Sch::TickClock *pClock, Quantizer *pQuantizer, const TrackData *pTrackData)
MsgSource mSource
Sinks the riffer publishes to.
Definition autoriffer.h:177
AxePhraseMaker * mPhraseMaker
Phrase maker AxingSTG installs.
Definition autoriffer.h:180
virtual ~AutoRiffer()
Phrase maker for a guitar track.
Definition axephrasemaker.h:38
Event the game passes between a MsgSource and a MsgSink.
Definition erasemsg.h:28
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Receiver of engine messages.
Definition msgsink.h:37
Sender of engine messages, which stores the list of sinks that receive them.
Definition msgsource.h:26
Owner of the players that are sounding, and the sink that starts them.
Definition musesynth.h:36
Event the game passes between a MsgSource and a MsgSink.
Definition pitchriffmsg.h:26
One participant in a session, local or remote.
Definition player.h:39
Holder of the track description the beat-quantising paths consult.
Definition quantizer.h:14
One riff of a track at one difficulty level, as a sequence of MIDI messages.
Definition riff.h:25
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
Event the game passes between a MsgSource and a MsgSink.
Definition stopriffmsg.h:27
Converted events of one track of a level.
Definition trackdata.h:52
Event the game passes between a MsgSource and a MsgSink.
Definition trackselectmsg.h:24