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

Builder of the riffs of a pitch track from its MIDI track. More...

#include <pitchtrackbuilder.h>

Inheritance diagram for PitchTrackBuilder:
Collaboration diagram for PitchTrackBuilder:

Classes

struct  Gem
 The start of the riff of a gem button. More...

Public Member Functions

 PitchTrackBuilder (int nTrack, bool bValidate, ErrorHandler pfnError, const String &riffName, int nChannel, int nStartTick, int nEndTick, PitchTrackRiffData *pRiffData)
 Construct a builder.
 ~PitchTrackBuilder () override
 Release the builder.
void OnNewTrack (unsigned char nTrack) override
 Ignore the start of the track.
void OnEndTrack () override
 Cut the riffs of each gem button out of the collected messages, and add every three to the riff 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 note, or collect any other message.
void OnTempo (int nTick, int nMicrosecondsPerBeat) override
 Ignore a tempo change.
void OnText (int nTick, const char *pszText, unsigned char nType) override
 Ignore a text meta event.
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.

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

Builder of the riffs of a pitch track from its MIDI track.

The RTTI records the class as deriving from TrackBuilder. Gem notes 96, 100, and 103 mark where the riff of each gem button starts, in that order, and every other message belongs to the riffs. The names of the members other than the MidiReceiver overrides are inferred.

Constructor & Destructor Documentation

◆ PitchTrackBuilder()

PitchTrackBuilder::PitchTrackBuilder ( int nTrack,
bool bValidate,
ErrorHandler pfnError,
const String & riffName,
int nChannel,
int nStartTick,
int nEndTick,
PitchTrackRiffData * pRiffData )

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.
riffNameThe name the riff data receives.
nChannelThe channel every message must use.
nStartTickThe tick the song starts at, after its intro.
nEndTickThe tick the song ends at.
pRiffDataThe riff data built.
Ghidra address:
NTSC-U/C: 0x00129978
Ghidra address:
PAL: 0x0012b170

◆ ~PitchTrackBuilder()

PitchTrackBuilder::~PitchTrackBuilder ( )
inlineoverride

Release the builder.

Ghidra address:
NTSC-U/C: 0x0033cc68
Ghidra address:
PAL: 0x003aa1a0

Member Function Documentation

◆ OnNewTrack()

void PitchTrackBuilder::OnNewTrack ( unsigned char nTrack)
inlineoverridevirtual

Ignore the start of the track.

The body is empty.

Parameters
nTrackThe track index.
Ghidra address:
NTSC-U/C: 0x0033cd18
Ghidra address:
PAL: 0x003aa250

Implements MidiReceiver.

◆ OnEndTrack()

void PitchTrackBuilder::OnEndTrack ( )
overridevirtual

Cut the riffs of each gem button out of the collected messages, and add every three to the riff data.

Ghidra address:
NTSC-U/C: 0x00129a48
Ghidra address:
PAL: 0x0012b240

Implements MidiReceiver.

◆ OnAllDone()

void PitchTrackBuilder::OnAllDone ( )
inlineoverridevirtual

Ignore the end of the file.

The body is empty.

Ghidra address:
NTSC-U/C: 0x0033cd20
Ghidra address:
PAL: 0x003aa258

Implements MidiReceiver.

◆ OnMidi()

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

Record a gem note, or collect any other message.

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

Implements MidiReceiver.

◆ OnTempo()

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

Ignore a tempo change.

The body is empty.

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

Implements MidiReceiver.

◆ OnText()

void PitchTrackBuilder::OnText ( int nTick,
const char * pszText,
unsigned char nType )
inlineoverridevirtual

Ignore a text meta event.

The body is empty.

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

Implements MidiReceiver.

◆ OnTimeSignature()

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

Ignore a time signature.

The body is empty.

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

Implements MidiReceiver.


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