resonance 1.0.1
Loading...
Searching...
No Matches
axephrasemaker.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "game/phrase.h"
6#include "game/phrasemaker.h"
7#include "game/player.h"
8#include "game/quantizer.h"
9#include "game/trackdata.h"
10#include "gs/phrasemgr.h"
11#include "mid/tick.h"
13#include "msg/message.h"
14#include "msg/musemsg.h"
15#include "msg/stdmidimsg.h"
16#include "msg/sustainnotemsg.h"
17#include "msg/trackselectmsg.h"
18#include "sch/tickclock.h"
19
39public:
49 Quantizer *pQuantizer,
50 const TrackData *pTrackData,
51 Sch::TickClock *pClock);
52
65 virtual void DispatchPriv(Message *pMsg);
66
78 virtual void OnPeriod(int nBar);
79
87 virtual int GetPeriodOrigin();
88
100 int IsBarPlayable(int nBar);
101
118 void Erase(Player *pPlayer, int nTick, int bWholeStep);
119
125 struct HeldNote {
126 unsigned char mNote;
127 unsigned char mVelocity;
128 int mTick;
129 };
130
131private:
142 void OnStdMidi(StdMidiMsg *pMsg);
143
150 void RecordMuseMsg(MuseMsg *pMsg);
151
160 void StartPhrase(int nTick);
161
169 void FinishPhrase();
170
179 void SendSeekerMsg(int nBar) const;
180
187 void OnTrackSelect(TrackSelectMsg *pMsg);
188
195 void OnMsg(const InvalidateSeekerMsg &msg);
196
203 void OnSustainNote(SustainNoteMsg *pMsg);
204
205 PhraseMgr *mPhraseMgr; // +0x18
206 Quantizer *mQuantizer; // +0x1c, not read by any recovered routine
207 int mTrack; // +0x20
208 unsigned char mChannel; // +0x24
209 Phrase *mPhrase; // +0x28, the phrase in progress, or null
210 int mPhraseBar; // +0x2c, the bar mPhrase records, -1 at first
211 Player *mPlayer; // +0x30, NullPlayer::sInstance until a TrackSelectMsg
212 std::vector<HeldNote> mHeldNotes; // +0x34
213 Sch::Tick mBarTicks; // +0x40
214 const TrackData *mTrackData; // +0x44
215 int mSwitchBanks; // +0x48, from configuration codes 0x3a4 and 0x3a1
216 float mValue; // +0x4c, the axis value recorded with every message
217};
void Erase(Player *pPlayer, int nTick, int bWholeStep)
Erase a player's phrase at a song position.
AxePhraseMaker(PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, const TrackData *pTrackData, Sch::TickClock *pClock)
virtual int GetPeriodOrigin()
Report the song position periods are counted from.
virtual void OnPeriod(int nBar)
Act on the start of a bar.
int IsBarPlayable(int nBar)
Report whether a bar can be played.
virtual void DispatchPriv(Message *pMsg)
Act on a message.
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
Abstract base shared by a family of messages.
Definition musemsg.h:28
Base of the per-instrument phrase makers.
Definition phrasemaker.h:24
Owner of the gem phrases on one track, and the seam between the network and the gems.
Definition phrasemgr.h:51
One phrase of a track, with its gems, its player, and the messages and values scheduled across it.
Definition phrase.h:38
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
Event the game passes between a MsgSource and a MsgSink.
Definition stdmidimsg.h:27
Event the game passes between a MsgSource and a MsgSink.
Definition sustainnotemsg.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
A note-on the maker holds until its note-off.
Definition axephrasemaker.h:125
int mTick
Definition axephrasemaker.h:128
unsigned char mVelocity
Definition axephrasemaker.h:127
unsigned char mNote
Definition axephrasemaker.h:126