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

TrackBuilder that reads the time signature of the song and checks its tempo. More...

#include <conductorbuilder.h>

Inheritance diagram for ConductorBuilder:
Collaboration diagram for ConductorBuilder:

Public Member Functions

 ConductorBuilder (int nTrack, bool bValidate, ErrorHandler pfnError, int nNumBars, int nTicksPerBeat, const float *pfMsPerTick, std::unique_ptr< PlayMap > *ppPlayMap, int *pTicksPerBar)
 Construct a builder.
 ~ConductorBuilder () override
 Release the builder.
void OnNewTrack (unsigned char nTrack) override
 Ignore the start of the track.
void OnEndTrack () override
 Ignore the end of the track.
void OnAllDone () override
 Ignore the end of the file.
void OnMidi (int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
 Ignore a channel message.
void OnTempo (int nTick, int nMicrosecondsPerBeat) override
 Report an error when a validating builder reads a tempo that differs from the song text by more than a tenth of a millisecond a beat.
void OnText (int nTick, const char *pszText, unsigned char nType) override
 Ignore a text event.
void OnTimeSignature (int nTick, int nNumerator, int nDenominator) override
 Set the length of a bar and create the play map.
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

TrackBuilder that reads the time signature of the song and checks its tempo.

The RTTI includes the class name and records TrackBuilder as the base. The time signature sets the length of a bar and creates the play map of the song.

Constructor & Destructor Documentation

◆ ConductorBuilder()

ConductorBuilder::ConductorBuilder ( int nTrack,
bool bValidate,
ErrorHandler pfnError,
int nNumBars,
int nTicksPerBeat,
const float * pfMsPerTick,
std::unique_ptr< PlayMap > * ppPlayMap,
int * pTicksPerBar )

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.
nNumBarsThe length of the song in bars, which the play map ends at.
nTicksPerBeatThe song ticks in one beat.
pfMsPerTickThe length of a tick that the song text gives, in milliseconds.
ppPlayMapReceives the play map the time signature creates.
pTicksPerBarReceives the song ticks in one bar, and must be 0 at the start.
Ghidra address:
NTSC-U/C: 0x0014e5c0
Ghidra address:
PAL: 0x0014ff60

◆ ~ConductorBuilder()

ConductorBuilder::~ConductorBuilder ( )
override

Release the builder.

Ghidra address:
NTSC-U/C: 0x0014e648
Ghidra address:
PAL: 0x0014ffe8

Member Function Documentation

◆ OnNewTrack()

void ConductorBuilder::OnNewTrack ( unsigned char nTrack)
inlineoverridevirtual

Ignore the start of the track.

Parameters
nTrackThe track index.
Ghidra address:
NTSC-U/C: 0x0034b000
Ghidra address:
PAL: 0x003b8430

Implements MidiReceiver.

◆ OnEndTrack()

void ConductorBuilder::OnEndTrack ( )
inlineoverridevirtual

Ignore the end of the track.

Ghidra address:
NTSC-U/C: 0x0034b020
Ghidra address:
PAL: 0x003b8450

Implements MidiReceiver.

◆ OnAllDone()

void ConductorBuilder::OnAllDone ( )
inlineoverridevirtual

Ignore the end of the file.

Ghidra address:
NTSC-U/C: 0x0034b008
Ghidra address:
PAL: 0x003b8438

Implements MidiReceiver.

◆ OnMidi()

void ConductorBuilder::OnMidi ( int nTick,
unsigned char nStatus,
unsigned char nData1,
unsigned char nData2 )
inlineoverridevirtual

Ignore a channel message.

Parameters
nTickThe tick of the message.
nStatusThe status byte.
nData1The first data byte.
nData2The second data byte.
Ghidra address:
NTSC-U/C: 0x0034b010
Ghidra address:
PAL: 0x003b8440

Implements MidiReceiver.

◆ OnTempo()

void ConductorBuilder::OnTempo ( int nTick,
int nMicrosecondsPerBeat )
overridevirtual

Report an error when a validating builder reads a tempo that differs from the song text by more than a tenth of a millisecond a beat.

Parameters
nTickThe tick of the tempo change.
nMicrosecondsPerBeatThe tempo.
Ghidra address:
NTSC-U/C: 0x0014e670
Ghidra address:
PAL: 0x00150010

Implements MidiReceiver.

◆ OnText()

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

Ignore a text event.

Parameters
nTickThe tick of the event.
pszTextThe text.
nTypeThe type of the event.
Ghidra address:
NTSC-U/C: 0x0034b018
Ghidra address:
PAL: 0x003b8448

Implements MidiReceiver.

◆ OnTimeSignature()

void ConductorBuilder::OnTimeSignature ( int nTick,
int nNumerator,
int nDenominator )
overridevirtual

Set the length of a bar and create the play map.

A second time signature is an error, and replaces the first.

Parameters
nTickThe tick of the time signature.
nNumeratorThe beats in one bar.
nDenominatorThe note value of a beat, which is not read.
Ghidra address:
NTSC-U/C: 0x0014e718
Ghidra address:
PAL: 0x001500b8

Implements MidiReceiver.


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