wavelength 1.0.0
Loading...
Searching...
No Matches
CatchTrackBuilder Class Reference

TrackBuilder that reads the gems of one skill level of a catch track into CatchTrackData. More...

#include <catchtrackbuilder.h>

Inheritance diagram for CatchTrackBuilder:
Collaboration diagram for CatchTrackBuilder:

Classes

struct  GemData
 One gem of the skill level. More...

Public Member Functions

 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.
void OnNewTrack (unsigned char nTrack) override
 Ignore the start of the track.
void OnEndTrack () override
 Check the gems and the samples, and add each gem and its samples to the data.
void OnAllDone () override
 Ignore the end of the file.
void OnMidi (int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
 Record a gem, or collect a sample message.
void OnTempo (int nTick, int nMicrosecondsPerBeat) override
 Ignore a tempo change.
void OnText (int nTick, const char *pszText, unsigned char nType) override
 Add the text of a text or lyric event to the lyrics.
void OnTimeSignature (int nTick, int nNumerator, int nDenominator) override
 Ignore a time signature.
Public Member Functions inherited from TrackBuilder
 TrackBuilder (int nTrack, bool bValidate, ErrorHandler pfnError)
 Construct a builder.
 ~TrackBuilder () override
 Release the builder.
void Error (int nTick, const char *pszMessage)
 Report a build error at a tick.
Public Member Functions inherited from MidiReceiver
virtual ~MidiReceiver ()
 Release the receiver.

Static Public Member Functions

static bool DecodeGemNote (unsigned char nNote, int *pnLane, int *pnSkill)
 Report the lane and the skill level of a gem note.

Additional Inherited Members

Public Types inherited from TrackBuilder
typedef void(* ErrorHandler) (String &message)
 Routine that reports a build error.
Protected Attributes inherited from TrackBuilder
int mTrack
int mValidate
ErrorHandler mErrorHandler

Detailed Description

TrackBuilder that reads the gems of one skill level of a catch track into CatchTrackData.

The RTTI includes the class name and records TrackBuilder as the base. The object is 0xb4 bytes. Each gem is a note at or above 96 that gives the lane and the skill level. The other channel messages are the samples the gems play, each gem the samples from its tick to the next gem. The text and lyric events are the lyrics.

Constructor & Destructor Documentation

◆ CatchTrackBuilder()

CatchTrackBuilder::CatchTrackBuilder ( int nTrack,
bool bValidate,
ErrorHandler pfnError,
int nChannel,
int nIntroTicks,
CatchTrackData * pData,
Lyric * pLyric,
int nFilterEffects,
int nSkill )

Construct a builder.

Parameters
nTrackThe number of the MIDI track the error messages give.
bValidateCheck the events for authoring errors.
pfnErrorThe routine that reports an error, or null to print it.
nChannelThe MIDI channel of the track.
nIntroTicksThe length of the song intro. The intro must not have notes.
pDataThe data to fill.
pLyricThe lyrics to fill.
nFilterEffectsNon-zero to omit controllers 93 and 94 from the samples.
nSkillThe skill level whose gems the builder reads.
Ghidra address:
NTSC-U/C: 0x0014b390
Ghidra address:
PAL: 0x0014cd30

◆ ~CatchTrackBuilder()

CatchTrackBuilder::~CatchTrackBuilder ( )
inlineoverride

Release the builder.

Ghidra address:
NTSC-U/C: 0x0034a008
Ghidra address:
PAL: 0x003b7438

Member Function Documentation

◆ OnNewTrack()

void CatchTrackBuilder::OnNewTrack ( unsigned char nTrack)
inlineoverridevirtual

Ignore the start of the track.

Parameters
nTrackThe track index.
Ghidra address:
NTSC-U/C: 0x0034a0b8
Ghidra address:
PAL: 0x003b74e8

Implements MidiReceiver.

◆ OnEndTrack()

void CatchTrackBuilder::OnEndTrack ( )
overridevirtual

Check the gems and the samples, and add each gem and its samples to the data.

Ghidra address:
NTSC-U/C: 0x0014b930
Ghidra address:
PAL: 0x0014d2d0

Implements MidiReceiver.

◆ OnAllDone()

void CatchTrackBuilder::OnAllDone ( )
inlineoverridevirtual

Ignore the end of the file.

Ghidra address:
NTSC-U/C: 0x0034a0c0
Ghidra address:
PAL: 0x003b74f0

Implements MidiReceiver.

◆ OnMidi()

void CatchTrackBuilder::OnMidi ( int nTick,
unsigned char nStatus,
unsigned char nData1,
unsigned char nData2 )
overridevirtual

Record a gem, or collect a sample message.

Parameters
nTickThe tick.
nStatusThe status byte.
nData1The first data byte.
nData2The second data byte.
Ghidra address:
NTSC-U/C: 0x0014b470
Ghidra address:
PAL: 0x0014ce10

Implements MidiReceiver.

◆ OnTempo()

void CatchTrackBuilder::OnTempo ( int nTick,
int nMicrosecondsPerBeat )
inlineoverridevirtual

Ignore a tempo change.

Parameters
nTickThe tick.
nMicrosecondsPerBeatThe new tempo.
Ghidra address:
NTSC-U/C: 0x0034a0c8
Ghidra address:
PAL: 0x003b74f8

Implements MidiReceiver.

◆ OnText()

void CatchTrackBuilder::OnText ( int nTick,
const char * pszText,
unsigned char nType )
overridevirtual

Add the text of a text or lyric event to the lyrics.

Parameters
nTickThe tick.
pszTextThe text.
nTypeThe meta event type.
Ghidra address:
NTSC-U/C: 0x0014b5b0
Ghidra address:
PAL: 0x0014cf50

Implements MidiReceiver.

◆ OnTimeSignature()

void CatchTrackBuilder::OnTimeSignature ( int nTick,
int nNumerator,
int nDenominator )
inlineoverridevirtual

Ignore a time signature.

Parameters
nTickThe tick.
nNumeratorThe beats per bar.
nDenominatorThe beat unit.
Ghidra address:
NTSC-U/C: 0x0034a0d0
Ghidra address:
PAL: 0x003b7500

Implements MidiReceiver.

◆ DecodeGemNote()

bool CatchTrackBuilder::DecodeGemNote ( unsigned char nNote,
int * pnLane,
int * pnSkill )
static

Report the lane and the skill level of a gem note.

Parameters
nNoteThe note, at least 96.
pnLaneReceives the lane.
pnSkillReceives the skill level, also when the note is not a gem.
Returns
Whether the note is a gem.
Ghidra address:
NTSC-U/C: 0x0014b328
Ghidra address:
PAL: 0x0014ccc8

The documentation for this class was generated from the following file: