wavelength 1.0.0
Loading...
Searching...
No Matches
axetrackcontourbuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <utility>
4#include <vector>
5
6#include "game/axetrackdata.h"
7#include "gs/axecontour.h"
9#include "mid/midivalidator.h"
10#include "mid/trackbuilder.h"
11
21public:
23 struct MidiMsg {
24 int mTick;
25 unsigned char mStatus;
26 unsigned char mData1;
27 unsigned char mData2;
28 };
29
44 bool bValidate,
45 ErrorHandler pfnError,
46 int nChannel,
47 int nTicksPerBar,
48 int nIntroTicks,
49 AxeTrackData *pData);
50
58
66 void OnNewTrack([[maybe_unused]] unsigned char nTrack) override {
67 }
68
75 void OnEndTrack() override;
76
83 void OnAllDone() override {
84 }
85
98 void
99 OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override;
100
109 void OnTempo([[maybe_unused]] int nTick, [[maybe_unused]] int nMicrosecondsPerBeat) override {
110 }
111
121 void OnText([[maybe_unused]] int nTick,
122 [[maybe_unused]] const char *pszText,
123 [[maybe_unused]] unsigned char nType) override {
124 }
125
135 void OnTimeSignature([[maybe_unused]] int nTick,
136 [[maybe_unused]] int nNumerator,
137 [[maybe_unused]] int nDenominator) override {
138 }
139
148 static int ButtonForNote(unsigned char nNote);
149
150private:
160 AxeContour *BuildContour(std::vector<MidiMsg>::iterator itMessage, int nEndTick);
161
162 AxeTrackData *mData;
163 int mTicksPerBar;
164 int mIntroTicks;
165 std::vector<MidiMsg> mMessages;
166 std::vector<std::pair<int, int> > mButtons;
167 MidiChannelState mChannelState;
168 MidiValidator mValidator;
169};
The notes AxeTrack plays on a guitar track, looped over the length of the track.
Definition axecontour.h:19
void OnAllDone() override
Ignore the end of the file.
Definition axetrackcontourbuilder.h:83
~AxeTrackContourBuilder() override
Release the builder.
void OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
Record a gem button note, or collect any other channel message.
void OnText(int nTick, const char *pszText, unsigned char nType) override
Ignore a text meta event.
Definition axetrackcontourbuilder.h:121
void OnNewTrack(unsigned char nTrack) override
Ignore the start of the track.
Definition axetrackcontourbuilder.h:66
void OnEndTrack() override
Build the notes of each set of three gem button notes, and add them to the data.
AxeTrackContourBuilder(int nTrack, bool bValidate, ErrorHandler pfnError, int nChannel, int nTicksPerBar, int nIntroTicks, AxeTrackData *pData)
Construct a builder.
static int ButtonForNote(unsigned char nNote)
Report the gem button a note plays.
void OnTimeSignature(int nTick, int nNumerator, int nDenominator) override
Ignore a time signature.
Definition axetrackcontourbuilder.h:135
void OnTempo(int nTick, int nMicrosecondsPerBeat) override
Ignore a tempo change.
Definition axetrackcontourbuilder.h:109
The notes and chords of a guitar track, one set of each for each span of the song.
Definition axetrackdata.h:17
The controller state of one MIDI channel, as the channel messages of a track change it.
Definition midichannelstate.h:15
Checker of the channel messages of one MIDI track for authoring errors.
Definition midivalidator.h:15
TrackBuilder(int nTrack, bool bValidate, ErrorHandler pfnError)
Construct a builder.
void(* ErrorHandler)(String &message)
Routine that reports a build error.
Definition trackbuilder.h:19
One channel message of the track.
Definition axetrackcontourbuilder.h:23
int mTick
Definition axetrackcontourbuilder.h:24
unsigned char mData2
Definition axetrackcontourbuilder.h:27
unsigned char mStatus
Definition axetrackcontourbuilder.h:25
unsigned char mData1
Definition axetrackcontourbuilder.h:26