resonance 1.0.1
Loading...
Searching...
No Matches
axeoldgemmaker.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/msgsink.h"
4#include "app/msgsource.h"
5#include "game/trackdata.h"
6#include "mid/tick.h"
7#include "msg/message.h"
8
9class NoteMsg;
10class Phrase;
11class PhraseMsg;
12class StdMidiMsg;
13
32class AxeOldGemMaker : public MsgSink, public MsgSource {
33public:
39 explicit AxeOldGemMaker(const TrackData *pTrackData);
40
51 virtual void DispatchPriv(Message *pMsg);
52
64 static float BlendForStep(int nStep);
65
77 static float BlendForAxis(float flValue) {
78 return static_cast<float>((flValue * kAxisBlendScale) + kAxisBlendBase);
79 }
80
81private:
82 static constexpr double kAxisBlendScale = 0.6;
83 static constexpr double kAxisBlendBase = 0.2;
84
92 void PostDurGemMsg(NoteMsg *pMsg);
93
102 void OnStdMidi(StdMidiMsg *pMsg);
103
111 void OnPhrase(PhraseMsg *pMsg);
112
113 int mTrack; // +0x18, copied from TrackData::mIndex
114 Sch::Tick mPosition; // +0x1c, the position of the entry being replayed
115 Phrase *mPhrase; // +0x20, the phrase being replayed, or null
116 Sch::Tick mSustainStart; // +0x24, zero while the pedal is not held
117};
118
128inline int GetNewGemID() {
129 // NTSC-U/C: 0x00683f70, PAL: 0x006c51d8
130 static int sID;
131 return sID++;
132}
int GetNewGemID()
Issue the next sustain strip identity.
Definition axeoldgemmaker.h:128
static float BlendForStep(int nStep)
Report the gem blend for a pitch step.
static float BlendForAxis(float flValue)
Map an axis value between 0 and 1 onto the gem blend, 0.2 to 0.8.
Definition axeoldgemmaker.h:77
virtual void DispatchPriv(Message *pMsg)
Act on a message.
AxeOldGemMaker(const TrackData *pTrackData)
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
Event the game passes between a MsgSource and a MsgSink.
Definition notemsg.h:28
Event the game passes between a MsgSource and a MsgSink.
Definition phrasemsg.h:24
One phrase of a track, with its gems, its player, and the messages and values scheduled across it.
Definition phrase.h:38
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
Converted events of one track of a level.
Definition trackdata.h:52