|
resonance 1.0.1
|
Accumulator a MIDI conversion fills, and the one implementation of LevelData. More...
#include <levelbuilder.h>


Public Member Functions | |
| LevelBuilder (unsigned nTrackCount) | |
| Construct an empty builder. | |
| virtual | ~LevelBuilder () |
| virtual int | TrackCount () |
| virtual int | BackingTrackCount () |
| virtual TrackData * | OwnTrack () |
| virtual TrackData * | TrackAt (int nIndex) |
| Return one track. | |
| virtual TrackData * | BackingTrackAt (int nIndex) |
| Return one backing track. | |
| virtual Sch::TempoMap * | GetTempoMap () |
| virtual PlayMap * | GetPlayMap () |
| virtual int | GetEndBar () |
| Report the play map's extent. | |
| TrackData * | GetTrack (int nIndex) |
| Return one gameplay track, without dispatch. | |
| void | SelectTrack (int nKind, int nIndex) |
| Make one track the current track, creating it on first use. | |
| void | Print (std::ostream &stream) |
| Write every track of the three collections to a diagnostic stream. | |
| void | SetBarCount (int nBarCount) |
| Forward a bar count to PlayMap::SetBarCount(). | |
| TrackData * | IntroTrackAt (int nIndex) |
| Return one intro track. | |
| void | SetChannel (unsigned char nChannel) |
| Set the MIDI channel of the current track. | |
| void | SetKind (int nKind) |
| Set the TrackMode of the current track. | |
| void | SetInstrument (int nInstrument, const HxStr &name) |
| Set the instrument index and the name of the current track. | |
| void | AddEvent (int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2, unsigned char nChannel) |
| Append one MIDI event to the current track. | |
| void | AddNoteMsg (int nTick, unsigned char nNote, unsigned char nVelocity, int nLength, unsigned char nChannel) |
| Forward to TrackData::AddNoteMsg() on the current track. | |
| void | SetQuant (int nTick, int nQuant) |
| Forward to TrackData::SetQuant() on the current track. | |
| void | AddRiff (int nTick, Riff *pRiff) |
| Forward to TrackData::AddRiff() on the current track. | |
| void | AddGem (int nTick, int nGem, Riff *pRiff) |
| Forward to TrackData::AddGem() on the current track. | |
| void | AddHarmony (int nTick, const Harmony &harmony) |
| Start a harmony on the current track. | |
| void | SetActive (int nTick, int bActive) |
| Forward an activeness change to TrackData::SetActive() on the current track. | |
| void | AddTempo (int nTick, int nMicrosecondsPerQuarter) |
| Replace the tempo map at +0x30 with one built from a tempo meta event. | |
| void | DoneLoading () |
| Run TrackData::ScoreBars() on every score track. | |
| Public Member Functions inherited from LevelData | |
| virtual | ~LevelData () |
Public Attributes | |
| std::vector< TrackData * > | mIntroTracks |
| The intro tracks. | |
Accumulator a MIDI conversion fills, and the one implementation of LevelData.
Its RTTI descriptor is at 0x008efc40. It has LevelData as its one base at offset 0. Its table is at 0x007e79f8 and has ten entries with a zero terminator at index 10, the same length as the base table. The class adds no virtual. It implements all eight of LevelData's pure slots and supplies the destructor.
LevelConverter drives it. LevelConverter::Convert() stores the builder at its own +0x50, each MIDI event handler forwards to AddEvent() with the status byte for the event, and LevelConverter::Tempo() forwards to AddTempo().
The object is at least 0x38 bytes. Three vectors of pointers occupy +0x04 through +0x27, and the destructor clears each one with a std::for_each over the deleting function at 0x001ec328, so all three manage their elements. That function deletes a TrackData, which is what fixes the element type of all three. The two scalars at +0x30 and +0x34 are managed as well, the first through Attachment::Release() and the second through its own table slot 1.
The forwarding members below all reach the object at +0x2c, which the destructor does not release. That object is the one the conversion appends to, and its routines sit in the same address range as TrackData's own destructor and appenders, so it is a TrackData.
Every method name here is inferred from the body behind it.
|
explicit |
Construct an empty builder.
It creates the tempo map at mTempoMap at 500000 microseconds per quarter note and the PlayMapLinear at mPlayMap. The map takes its steps and labels from configuration codes 0x396 and 0x3a0 and its sections from code 0x39d. The builder then creates nTrackCount score tracks, and runs PlayMap::StartLoop() with bar 0xe when code 0x3a1 is set. GrooveWorld::StartLoad() passes the configuration value the query at 0x00509110 reports for the identifier 0x384.
| nTrackCount | The number of tracks to prepare for. |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Return one track.
The index is not tested against the collection.
Implements LevelData.
|
virtual |
Return one backing track.
The index is not tested against the collection.
Implements LevelData.
|
virtual |
|
virtual |
|
virtual |
Report the play map's extent.
Implements LevelData.
| TrackData * LevelBuilder::GetTrack | ( | int | nIndex | ) |
Return one gameplay track, without dispatch.
The body is the same as TrackAt(), but the member is not virtual. GrooveWorld calls it directly at 0x0018d284, 0x0018d714, and 0x0018df64. The title is inferred.
| nIndex | The position in mTracks. |
| void LevelBuilder::SelectTrack | ( | int | nKind, |
| int | nIndex ) |
Make one track the current track, creating it on first use.
A score track must already exist. A backing or intro collection grows to include nIndex. An empty slot, like an absent own track, receives a new TrackData with the index -1 over the play map at mPlayMap. The title is inferred.
| nKind | The collection, a LevelTrackKind. |
| nIndex | The position in the collection. The none and own kinds do not read it. |
| void LevelBuilder::Print | ( | std::ostream & | stream | ) |
Write every track of the three collections to a diagnostic stream.
Each track is introduced by its collection's label, its position, and a colon. The routine has no caller in the image.
| stream | The stream to write to. |
| void LevelBuilder::SetBarCount | ( | int | nBarCount | ) |
Forward a bar count to PlayMap::SetBarCount().
GrooveWorld::BuildGraphs() at 0x0018cd44 passes zero. The title is inferred.
| nBarCount | The value stored in the play map's bar count. |
| TrackData * LevelBuilder::IntroTrackAt | ( | int | nIndex | ) |
Return one intro track.
The index is not tested against the collection. GrooveWorld::BuildGraphs() at 0x0018d22c is the caller. The title is inferred.
| nIndex | The position in mIntroTracks. |
| void LevelBuilder::SetChannel | ( | unsigned char | nChannel | ) |
Set the MIDI channel of the current track.
| nChannel | The channel. |
| void LevelBuilder::SetKind | ( | int | nKind | ) |
| void LevelBuilder::SetInstrument | ( | int | nInstrument, |
| const HxStr & | name ) |
Set the instrument index and the name of the current track.
| nInstrument | The instrument index. |
| name | The track name, copied. |
| void LevelBuilder::AddEvent | ( | int | nTick, |
| unsigned char | nStatus, | ||
| unsigned char | nData1, | ||
| unsigned char | nData2, | ||
| unsigned char | nChannel ) |
Append one MIDI event to the current track.
The status and the channel arrive separately and the body combines them with a bitwise or before forwarding to TrackData::AddMidiMsg().
| nTick | The event position, in MIDI ticks. |
| nStatus | The MIDI status byte without its channel, 0x80 through 0xe0. |
| nData1 | The first data byte. |
| nData2 | The second data byte, or zero for a one-byte event. |
| nChannel | The channel, which the body ors into the status. |
| void LevelBuilder::AddNoteMsg | ( | int | nTick, |
| unsigned char | nNote, | ||
| unsigned char | nVelocity, | ||
| int | nLength, | ||
| unsigned char | nChannel ) |
Forward to TrackData::AddNoteMsg() on the current track.
| nTick | The song position, in MIDI ticks. |
| nNote | The note number. |
| nVelocity | The note-on velocity. |
| nLength | The length of the note, in MIDI ticks. |
| nChannel | The MIDI channel. |
| void LevelBuilder::SetQuant | ( | int | nTick, |
| int | nQuant ) |
Forward to TrackData::SetQuant() on the current track.
| nTick | The song position, in MIDI ticks. |
| nQuant | The quantisation, in MIDI ticks. |
| void LevelBuilder::AddRiff | ( | int | nTick, |
| Riff * | pRiff ) |
Forward to TrackData::AddRiff() on the current track.
| nTick | The song position, in MIDI ticks. |
| pRiff | The riff. |
| void LevelBuilder::AddGem | ( | int | nTick, |
| int | nGem, | ||
| Riff * | pRiff ) |
Forward to TrackData::AddGem() on the current track.
| nTick | The song position, in MIDI ticks. |
| nGem | The gem. |
| pRiff | The riff, or null. |
| void LevelBuilder::AddHarmony | ( | int | nTick, |
| const Harmony & | harmony ) |
Start a harmony on the current track.
Forwards to TrackData::AddHarmony() on mCurrentTrack. LevelConverter calls it at 0x001e6a60 and 0x001e7b04 with the harmony at its +0x7c.
| nTick | The song position, in MIDI ticks. |
| harmony | The harmony, copied by the track. |
| void LevelBuilder::SetActive | ( | int | nTick, |
| int | bActive ) |
Forward an activeness change to TrackData::SetActive() on the current track.
LevelConverter::Controller() calls it for controller 0x6a with whether the value is non-zero, and LevelConverter::EndTrack() calls it with two zeroes. The title is inferred.
| nTick | The event position, in MIDI ticks. |
| bActive | Whether the controller value was non-zero. |
| void LevelBuilder::AddTempo | ( | int | nTick, |
| int | nMicrosecondsPerQuarter ) |
Replace the tempo map at +0x30 with one built from a tempo meta event.
The body releases the map already there, allocates 0x28 bytes, and constructs a Sch::TempoMap from the tempo. The one caller, LevelConverter::Tempo() at 0x001ea570, passes its own two arguments through in the registers they arrive in.
| nTick | The event position. No instruction in the body reads it. |
| nMicrosecondsPerQuarter | The tempo the map is constructed from. |
| void LevelBuilder::DoneLoading | ( | ) |
Run TrackData::ScoreBars() on every score track.
LevelConverter::Convert() calls it once the reader has been built and before the file is read.
| std::vector<TrackData *> LevelBuilder::mIntroTracks |
The intro tracks.
+0x1c
No slot of LevelData reads this collection. Public because GrooveWorld::BuildGraphs() reads its size directly as a loop bound at 0x0018d198, and the image has no accessor.