wavelength 1.0.0
Loading...
Searching...
No Matches
catchtrackbuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
6#include "game/lyric.h"
7#include "gs/musefactory.h"
8#include "mid/midivalidator.h"
9#include "mid/trackbuilder.h"
10
20public:
22 struct GemData {
23 int mTick;
24 int mLane;
25 };
26
43 bool bValidate,
44 ErrorHandler pfnError,
45 int nChannel,
46 int nIntroTicks,
47 CatchTrackData *pData,
48 Lyric *pLyric,
49 int nFilterEffects,
50 int nSkill);
51
58 ~CatchTrackBuilder() override {
59 }
60
68 void OnNewTrack([[maybe_unused]] unsigned char nTrack) override {
69 }
70
77 void OnEndTrack() override;
78
85 void OnAllDone() override {
86 }
87
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(int nTick, const char *pszText, unsigned char nType) override;
122
132 void OnTimeSignature([[maybe_unused]] int nTick,
133 [[maybe_unused]] int nNumerator,
134 [[maybe_unused]] int nDenominator) override {
135 }
136
147 static bool DecodeGemNote(unsigned char nNote, int *pnLane, int *pnSkill);
148
149private:
161 bool AddGem(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2);
162
163 int mIntroTicks;
164 CatchTrackData *mData;
165 int mFilterEffects;
166 Lyric *mLyric;
167 MidiValidator mValidator;
168 int mSkill;
169 std::vector<GemData> mGems;
170 MuseFactory mSamples;
171 int mLastNoteOnTick;
172 int mFirstSampleTick;
173};
void OnTimeSignature(int nTick, int nNumerator, int nDenominator) override
Ignore a time signature.
Definition catchtrackbuilder.h:132
void OnEndTrack() override
Check the gems and the samples, and add each gem and its samples to the data.
void OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
Record a gem, or collect a sample message.
void OnNewTrack(unsigned char nTrack) override
Ignore the start of the track.
Definition catchtrackbuilder.h:68
void OnAllDone() override
Ignore the end of the file.
Definition catchtrackbuilder.h:85
void OnTempo(int nTick, int nMicrosecondsPerBeat) override
Ignore a tempo change.
Definition catchtrackbuilder.h:109
void OnText(int nTick, const char *pszText, unsigned char nType) override
Add the text of a text or lyric event to the lyrics.
static bool DecodeGemNote(unsigned char nNote, int *pnLane, int *pnSkill)
Report the lane and the skill level of a gem note.
CatchTrackBuilder(int nTrack, bool bValidate, ErrorHandler pfnError, int nChannel, int nIntroTicks, CatchTrackData *pData, Lyric *pLyric, int nFilterEffects, int nSkill)
Construct a builder.
~CatchTrackBuilder() override
Release the builder.
Definition catchtrackbuilder.h:58
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
Lyrics of a song loop, each shown when the song reaches its tick.
Definition lyric.h:18
Checker of the channel messages of one MIDI track for authoring errors.
Definition midivalidator.h:15
Collector of the channel messages of one MIDI channel that cuts MultiMuse pieces out of them.
Definition musefactory.h:17
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 gem of the skill level.
Definition catchtrackbuilder.h:22
int mTick
Definition catchtrackbuilder.h:23
int mLane
Definition catchtrackbuilder.h:24