resonance 1.0.1
Loading...
Searching...
No Matches
notepitcher.h
Go to the documentation of this file.
1#pragma once
2
3#include "gs/pitcher.h"
4#include "mid/tick.h"
5#include "msg/message.h"
6
7class EraseMsg;
9class PhraseMgr;
10class PitchRiffMsg;
11class Player;
12class Quantizer;
13class TrackData;
14class TrackSelectMsg;
15
16namespace Sch {
17class TickClock;
18} // namespace Sch
19
34class NotePitcher : public Pitcher {
35public:
55 Quantizer *pQuantizer,
56 Sch::TickClock *pClock,
57 const TrackData *pTrackData,
58 int bPlayModeOne,
59 int bAllowOwnedBars,
60 int nUnreadOption);
61
66 virtual ~NotePitcher();
67
79 virtual int Tick(int nElapsedTicks);
80
81protected:
95
110
122
138 void PostPhraseCapturedMsg(int nGem, int nTick);
139
154 void PostSeekerMsgSecond(int nBar, int bForce);
155
165 virtual void DispatchPriv(Message *pMsg);
166
167private:
174 void OnInvalidateSeeker(InvalidateSeekerMsg *pMsg);
175
184 int IsOtherTick(int nTick);
185
198 int CanPlayBar(int nBar, int nCurrentBar);
199
200 PhraseMgr *mPhraseMgr; // +0x38
201 Quantizer *mQuantizer; // +0x3c
202 // Copied from the track description's `+0x04`. Matched against an InvalidateSeekerMsg's
203 // `+0x08`, so it identifies the track this pitcher serves.
204 int mTrack; // +0x40
205 Player *mPlayer; // +0x44, starts at NullPlayer::sInstance
206 Sch::Tick mLastErasePosition; // +0x48, Sch::Tick(-1), stored and then tested at 0x001b1e60
207 Sch::Tick mLastPitchPosition; // +0x4c, starts at kTickInfinity
208 // Copied from the phrase manager's `+0x34` after an initial kTickInfinity. Turns an elapsed
209 // tick count into a bar index.
210 int mBarDivisor; // +0x50
211 int mCapturedBar; // +0x54, the bar last announced as captured, -1 at first
212 int mPlayModeOne; // +0x58, the constructor's fifth argument
213 int mStepBars; // +0x5c, the spacing of a step's bars, 2 at first
214 int mAllowOwnedBars; // +0x60, the constructor's sixth argument
215 int mUnreadOption; // +0x64, the constructor's seventh argument, never read
216 const TrackData *mTrackData; // +0x68
217 Sch::TickClock *mClock; // +0x6c
218};
Event the game passes between a MsgSource and a MsgSink.
Definition erasemsg.h:28
Event the game passes between a MsgSource and a MsgSink.
Definition invalidateseekermsg.h:19
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
NotePitcher(PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, Sch::TickClock *pClock, const TrackData *pTrackData, int bPlayModeOne, int bAllowOwnedBars, int nUnreadOption)
Construct a note pitcher for one track.
void PostPhraseCapturedMsg(int nGem, int nTick)
Record a caught gem.
virtual void DispatchPriv(Message *pMsg)
Act on a message.
void PostAllNotesOffMsg(EraseMsg *pMsg)
Erase this player's phrases at an EraseMsg's position, outside play mode 1.
void PostSeekerMsg(TrackSelectMsg *pMsg)
Install the player a TrackSelectMsg for this track selects.
void PostPitchMsg(PitchRiffMsg *pMsg)
React to a PitchRiffMsg for this track and player.
void PostSeekerMsgSecond(int nBar, int bForce)
Post the seeker for mPlayer at the first playable bar of the eight from nBar.
virtual int Tick(int nElapsedTicks)
Advance to the bar the elapsed tick count falls in.
virtual ~NotePitcher()
Owner of the gem phrases on one track, and the seam between the network and the gems.
Definition phrasemgr.h:51
Event the game passes between a MsgSource and a MsgSink.
Definition pitchriffmsg.h:26
Pitcher(Sch::TickClock *pClock)
Construct the three bases, the TickTask one to run every bar.
Definition pitcher.h:44
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
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
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
Scheduling of timed commands.
Definition activefilter.h:9