84 mOwner->OnNewTrack(nTrack);
118 unsigned char nStatus,
119 unsigned char nData1,
120 unsigned char nData2)
override {
121 mOwner->OnMidi(nTick, nStatus, nData1, nData2);
132 void OnTempo(
int nTick,
int nMicrosecondsPerBeat)
override {
133 mOwner->OnTempo(nTick, nMicrosecondsPerBeat);
145 void OnText(
int nTick,
const char *pszText,
unsigned char nType)
override {
146 mOwner->OnText(nTick, pszText, nType);
159 mOwner->OnTimeSignature(nTick, nNumerator, nDenominator);
187 int nFreestyleEffectsBus,
188 int nRemixEffectsBus,
279 void OnMidi(
int nTick,
unsigned char nStatus,
unsigned char nData1,
unsigned char nData2);
289 void OnTempo(
int nTick,
int nMicrosecondsPerBeat);
312 void OnText(
int nTick,
const char *pszText,
unsigned char nType);
484 return mPlayMap.get();
489 return mBankTrack.get();
528 void ClassifyTrack(
const char *pszName);
537 void ParseGameTrackName(
const String &name);
545 void CreateTrackBuilder();
555 void Error(
int nTick,
const String &message);
622 Tracks(Tracks &&other) =
default;
624 std::unique_ptr<CatchTrackData> mCatch;
625 std::unique_ptr<ScratchTrackData> mScratch;
626 std::unique_ptr<AxeTrackData> mAxe;
627 std::unique_ptr<PitchTrackRiffData> mRiffs;
628 std::unique_ptr<CatchTrackData> mVox;
633 std::vector<Tracks> mTracks;
634 std::vector<std::unique_ptr<BackMusic>> mBackMusic;
635 std::vector<Ptr<Muse>> mIntroMuses;
636 std::vector<std::unique_ptr<ScriptTrackData>> mScriptTracks;
637 std::unique_ptr<PlayMap> mPlayMap;
638 std::unique_ptr<BankLoader> mBankTrack;
639 WorldTrack mWorldTrack;
640 std::unique_ptr<Lyric> mLyric;
641 std::unique_ptr<FXMgr> mFXMgr;
645 std::unique_ptr<File> mFile;
646 std::unique_ptr<MidiReader> mReader;
650 const char *mMidiFile;
655 int mFreestyleEffectsBus;
656 int mRemixEffectsBus;
657 std::unique_ptr<BuilderReceiver> mReceiver;
668 std::unique_ptr<TrackBuilder> mTrackBuilder;
670 SectionBoundaries *mSections;
The notes and chords of a guitar track, one set of each for each span of the song.
Definition axetrackdata.h:17
Background music of a song, played alone or along with a catch track.
Definition backmusic.h:20
Loader of the sound banks of a song, from its track named "BANK".
Definition bankloader.h:19
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
The effect sets a song applies to the synthesiser channels at given bars.
Definition fxmgr.h:15
void OnEndTrack() override
Pass the end of a track to the builder.
Definition levelmidibuilder.h:93
void OnAllDone() override
Pass the end of the file to the builder.
Definition levelmidibuilder.h:103
void OnText(int nTick, const char *pszText, unsigned char nType) override
Pass a text event to the builder.
Definition levelmidibuilder.h:145
~BuilderReceiver() override
Release the receiver.
Definition levelmidibuilder.h:73
void OnNewTrack(unsigned char nTrack) override
Pass the start of a track to the builder.
Definition levelmidibuilder.h:83
void OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
Pass a channel message to the builder.
Definition levelmidibuilder.h:117
BuilderReceiver(LevelMidiBuilder *pOwner)
Construct a receiver for a builder.
Definition levelmidibuilder.h:64
void OnTempo(int nTick, int nMicrosecondsPerBeat) override
Pass a tempo change to the builder.
Definition levelmidibuilder.h:132
void OnTimeSignature(int nTick, int nNumerator, int nDenominator) override
Pass a time signature to the builder.
Definition levelmidibuilder.h:158
int GetNumIntroMuses() const
Report the number of performances of the tracks named "INTRO".
void StartLoad(TrackBuilder::ErrorHandler pfnError)
Start reading the MIDI file and check it for authoring errors.
LevelMidiBuilder(const char *pszMidiFile, int nDifficulty, int nRuleSet, int nNumBars, int nIntroBars, int nFreestyleEffectsBus, int nRemixEffectsBus, SectionBoundaries *pSections, float *pMsPerTick, SlotGrid *pSlotGrid)
Construct a builder for the MIDI file of a song.
int IsDone() const
Report whether the MIDI file is parsed.
void StartLoad()
Start reading the MIDI file without checking it for authoring errors.
~LevelMidiBuilder()
Release the builder, the file, and the data of every track.
CatchTrackData * GetVoxData(int nTrack) const
Report the gems of a vocal track.
void OnEndTrack()
Finish the track, and make the lyrics after the conductor track.
PitchTrackRiffData * GetTrackRiffData(int nTrack) const
Report the riffs of a pitch track.
void OnAllDone()
Report a song without a WORLD track or a BANK track.
int GetTrackInstrument(int nTrack) const
Report the instrument of a track.
ScratchTrackData * GetScratchData(int nTrack) const
Report the patterns of a turntable track.
PlayMap * GetPlayMap() const
Definition levelmidibuilder.h:483
WorldTrack * GetWorldTrack()
Definition levelmidibuilder.h:493
void OnText(int nTick, const char *pszText, unsigned char nType)
Take the name of a track that has none yet, and build its builder.
void OnTimeSignature(int nTick, int nNumerator, int nDenominator)
Pass a time signature to the builder of the track.
int GetTrackType(int nTrack) const
Report the type of an instrument track.
void OnTempo(int nTick, int nMicrosecondsPerBeat)
Pass a tempo change to the builder of the track.
int GetTicksPerBar() const
Definition levelmidibuilder.h:478
int GetNumTracks() const
Report the number of instrument tracks.
TrackKind
Kinds of a MIDI track, as its name identifies them.
Definition levelmidibuilder.h:39
@ kTrackKindNone
Definition levelmidibuilder.h:40
@ kTrackKindScratch
Definition levelmidibuilder.h:46
@ kTrackKindAxeHarmony
Definition levelmidibuilder.h:43
@ kTrackKindScript
Definition levelmidibuilder.h:51
@ kTrackKindBank
Definition levelmidibuilder.h:52
@ kTrackKindIgnore
Definition levelmidibuilder.h:53
@ kTrackKindPitch
Definition levelmidibuilder.h:44
@ kTrackKindVox
Definition levelmidibuilder.h:45
@ kTrackKindBackground
Definition levelmidibuilder.h:48
@ kTrackKindConductor
Definition levelmidibuilder.h:41
@ kTrackKindWorld
Definition levelmidibuilder.h:50
@ kTrackKindIntro
Definition levelmidibuilder.h:49
@ kTrackKindAxeContour
Definition levelmidibuilder.h:42
@ kTrackKindCatch
Definition levelmidibuilder.h:47
Muse * GetIntroMuse(int nIndex) const
Report the performance of one track named "INTRO".
ScriptTrackData * FindScriptTrack(const char *pszName) const
Find the commands of a track named "SCRIPT" by their name.
BankLoader * GetBankTrack() const
Definition levelmidibuilder.h:488
CatchTrackData * GetCatchTrackData(int nTrack) const
Report the gems of a catch track.
int GetTrackFlags(int nTrack) const
Report the flags of a track.
void LoadRemix()
Replace the data of the tracks with the saved remix of the game database.
void Poll()
Advance the read of the MIDI file, parsing it for up to 15 milliseconds once it is in memory,...
float GetSpeed() const
Definition levelmidibuilder.h:508
int GetNumBackMusic() const
Report the number of background music tracks.
AxeTrackData * GetAxeData(int nTrack) const
Report the notes of a guitar track.
Lyric * GetLyric() const
Definition levelmidibuilder.h:498
void OnNewTrack(unsigned char nTrack)
Start a track.
static String FormatError(const String &prefix, int nTick, int nTrack, const String &message)
Format an error message with the MIDI track and the position it concerns.
void OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Pass a channel message to the builder of the track.
FXMgr * GetFXMgr() const
Definition levelmidibuilder.h:503
BackMusic * GetBackMusic(int nIndex) const
Report one background music track.
Lyrics of a song loop, each shown when the song reaches its tick.
Definition lyric.h:18
Listener a MIDI file reader reports each track and event to.
Definition midireceiver.h:8
Piece of MIDI performance that a Scheduler plays.
Definition muse.h:12
The riffs a pitch track plays, one set of riffs for each tick that starts a set.
Definition pitchtrackriffdata.h:16
Map from the bars a song plays to the bars of the song as written, with the loops that repeat stretch...
Definition playmap.h:11
The scratchers of a scratch track, one set of three for each span of the song.
Definition scratchtrackdata.h:15
The script commands of a song's SCRIPT track, each at its tick.
Definition scripttrackdata.h:14
Ascending list of the measures at which the sections of a song end.
Definition sectionboundaries.h:12
The pattern each section of a remixed song repeats, as the section the pattern comes from.
Definition slotgrid.h:10
Growable text buffer that is also a PrnStream.
Definition string.h:19
void(* ErrorHandler)(String &message)
Routine that reports a build error.
Definition trackbuilder.h:19
The events of the track of a song named "WORLD", sorted by tick.
Definition worldtrack.h:11