|
resonance 1.0.1
|
Converted events of one track of a level. More...
#include <trackdata.h>

Classes | |
| class | Bar |
| One bar of a track, with its scoring values and the sorted lists of what starts in it. More... | |
Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate a track from the tagged heap under the tag TrackData. | |
| void | operator delete (void *pBlock) |
| Release a track to the tagged heap. | |
| TrackData (int nIndex, PlayMap *pMap) | |
| Construct an empty track over a play map. | |
| ~TrackData () | |
| Delete every riff set and harmony the track created, then the bars. | |
| void | AddRiff (int nTick, Riff *pRiff) |
| Give a riff a place in the riff set at a song position. | |
| void | AddHarmony (int nTick, const Harmony &harmony) |
| Start a harmony at a song position. | |
| void | AddGem (int nTick, int nGem, Riff *pRiff) |
| Add a gem at a song position, with a riff set of its own when a riff is given. | |
| void | AddMidiMsg (int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) |
| Add a StdMidiMsg built from three bytes to the bar at a song position. | |
| void | AddNoteMsg (int nTick, unsigned char nNote, unsigned char nVelocity, int nLength, unsigned char nChannel) |
| Add a NoteMsg built from four values to the bar at a song position. | |
| void | ScoreBars () |
| Give every bar its point value and its configured word. | |
| int | FindGemAtOrBefore (int nTick, int *pTick, int *pGem) const |
| Find the last gem at or before a song position, looking back into the previous bar when the position's own bar has none. | |
| int | FindGemAtOrAfter (int nTick, int *pTick, int *pGem) const |
| Find the first gem at or after a song position within mGemSearchBars bars. | |
| void | Print (std::ostream &stream) |
| Write the track and every bar to a diagnostic stream. | |
| void | Locate (int nTick, Bar *&pBar, Sch::Tick &offset) |
| Split a song position into its bar and the offset within the bar. | |
| void | LocateMapped (int nTick, const Bar *&pBar, Sch::Tick &offset) const |
| Split a song position into its bar, mapped through PlayMap::MapBar(), and the offset. | |
| void | AddPhrases (PhraseDatabase *pDatabase) |
| Add every gem of every phrase of a database, one phrase per step, and score each bar. | |
| void | SetQuant (int nTick, int nQuant) |
| Set the quantisation of the bar at a song position. | |
| void | SetActive (int nTick, int bActive) |
| Do nothing. | |
| void | SetOwner (Player *pPlayer, int nBar) const |
| Report a player for a bar to the gamer, with this track's index. | |
| Harmony * | GetHarmony (int nTick) const |
| Riff * | GetRiff (int nTick, int nLevel) const |
| Riff * | GetRiffInMappedBar (int nBar, int nOffset, int nLevel) const |
| Riff * | GetRiffInBar (int nBar, int nOffset, int nLevel) const |
| int | GetGemAt (int nTick) const |
| int | GetQuant (int nBar) const |
| int | IsStepStart (int nBar) const |
| int | StepStartBar (int nBar) const |
| int | NextStepBar (int nBar) const |
| int | FollowingStepBar (int nBar) const |
| int | QueryBar (int nBar) const |
| Ask the gamer about a bar, with this track's index. | |
| int | GetPoints (int nBar) const |
| int | GetJuice (int nBar) const |
| const std::vector< TickObj< MuseMsg * > > * | GetMidiInBar (int nBar) const |
| const std::vector< TickObj< int > > * | GetGemsInBar (int nBar) const |
| const std::vector< TickObj< MuseMsg * > > * | GetMidi (int nBar) const |
| const std::vector< TickObj< int > > * | GetGems (int nBar) const |
| void | Locate (int nTick, Bar *&pBar) |
| Find the bar of a song position, discarding the offset. | |
| void | LocateMapped (int nTick, const Bar *&pBar) const |
| Find the mapped bar of a song position, discarding the offset. | |
| void | GetBar (int nBar, const Bar *&pBar) const |
| Find a bar by its bar number, mapped through PlayMap::MapBar(). | |
| int | FindStepIndex (int nBar) const |
Public Attributes | |
| Gamer * | mGamer |
| int | mIndex |
| unsigned char | mChannel |
| unsigned char | mPaddingByte |
| unsigned short | mPaddingHalf |
| int | mKind |
| int | mInstrument |
| Instrument index from 0 to 5. | |
Friends | |
| class | Catcher |
| class | LevelBuilder |
Converted events of one track of a level.
The class emits no RTTI descriptor and is not polymorphic. Its name is attested rather than inferred. The image records Catcher's constructor signature, whose third parameter is const TrackData *, and the LevelBuilder constructor allocates it under the tag TrackData.
The LevelBuilder allocation measures the object at 0x54 bytes. The constructor sizes mBars to the last step of the play map, one Bar per bar of the level, and every position the class accepts is split into a bar and an offset within the bar by Locate() or LocateMapped(), the second mapping the bar through PlayMap::MapBar() first.
The destructor deletes every riff set and every harmony the track created. A bar refers to them only through its sorted lists.
The members mIndex, mChannel, and mKind are public because every stage class reads them directly and no accessor exists. Overlay reads mInstrument the same way. The rest are private.
The queries are const. The mangled Catcher constructor attests a const TrackData *, every stage class and Quantizer store the track in that form, and Quantizer::GetQuantum() calls GetQuant() through the const pointer.
| TrackData::TrackData | ( | int | nIndex, |
| PlayMap * | pMap ) |
Construct an empty track over a play map.
| nIndex | The track's index, stored in mIndex. |
| pMap | The play map whose last step sizes mBars. |
| TrackData::~TrackData | ( | ) |
Delete every riff set and harmony the track created, then the bars.
LevelBuilder's deleter at 0x001ec328 passes an in-charge value of 3.
|
inline |
Allocate a track from the tagged heap under the tag TrackData.
No out-of-line body exists. The LevelBuilder constructor and LevelBuilder::SelectTrack() expand the call inline.
| nSize | The object size the compiler supplies. |
|
inline |
Release a track to the tagged heap.
No out-of-line body exists. The deleting destructor expands the call inline.
| pBlock | The block. |
| void TrackData::AddRiff | ( | int | nTick, |
| Riff * | pRiff ) |
Give a riff a place in the riff set at a song position.
A position other than the one the current riff set was created for starts a new set. The new set is stored at that position in its bar and at offset zero in every later bar. A position at or past the end of the track is ignored.
| nTick | The song position, in MIDI ticks. |
| pRiff | The riff, stored at the index given by its mId. |
| void TrackData::AddHarmony | ( | int | nTick, |
| const Harmony & | harmony ) |
Start a harmony at a song position.
The harmony is stored at that position in its bar and at offset zero in every later bar. A position at or past the end of the track is ignored.
| nTick | The song position, in MIDI ticks. |
| harmony | The harmony, copied onto the heap. |
| void TrackData::AddGem | ( | int | nTick, |
| int | nGem, | ||
| Riff * | pRiff ) |
Add a gem at a song position, with a riff set of its own when a riff is given.
A position at or past the end of the track is ignored.
| nTick | The song position, in MIDI ticks. |
| nGem | The gem. |
| pRiff | The riff, or null. |
| void TrackData::AddMidiMsg | ( | int | nTick, |
| unsigned char | nStatus, | ||
| unsigned char | nData1, | ||
| unsigned char | nData2 ) |
Add a StdMidiMsg built from three bytes to the bar at a song position.
The message is allocated under the message tag and inserted into Bar::mMidi at its offset in the bar. A position at or past the end of the track is ignored.
| nTick | The song position, in MIDI ticks. |
| nStatus | The status byte. |
| nData1 | The first data byte. |
| nData2 | The second data byte. |
| void TrackData::AddNoteMsg | ( | int | nTick, |
| unsigned char | nNote, | ||
| unsigned char | nVelocity, | ||
| int | nLength, | ||
| unsigned char | nChannel ) |
Add a NoteMsg built from four values to the bar at a song position.
Placed the same way as AddMidiMsg().
| 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 TrackData::ScoreBars | ( | ) |
Give every bar its point value and its configured word.
A track in one of the modes 1 through 3 takes a flat configured value for every bar, and any other track scores each bar from its gems. The game mode is read and discarded.
| int TrackData::FindGemAtOrBefore | ( | int | nTick, |
| int * | pTick, | ||
| int * | pGem ) const |
Find the last gem at or before a song position, looking back into the previous bar when the position's own bar has none.
| nTick | The song position, in MIDI ticks. |
| pTick | Receives the gem's song position. |
| pGem | Receives the gem. |
| int TrackData::FindGemAtOrAfter | ( | int | nTick, |
| int * | pTick, | ||
| int * | pGem ) const |
Find the first gem at or after a song position within mGemSearchBars bars.
| nTick | The song position, in MIDI ticks. |
| pTick | Receives the gem's song position. |
| pGem | Receives the gem. |
| void TrackData::Print | ( | std::ostream & | stream | ) |
Write the track and every bar to a diagnostic stream.
| stream | The stream to write to. |
Split a song position into its bar and the offset within the bar.
| nTick | The song position, in MIDI ticks. |
| pBar | Receives the bar. |
| offset | Receives the offset within the bar. |
Split a song position into its bar, mapped through PlayMap::MapBar(), and the offset.
| nTick | The song position, in MIDI ticks. |
| pBar | Receives the bar. |
| offset | Receives the offset within the bar. |
| void TrackData::AddPhrases | ( | PhraseDatabase * | pDatabase | ) |
Add every gem of every phrase of a database, one phrase per step, and score each bar.
GrooveWorld's setup path is the recovered caller.
| pDatabase | The database. |
| void TrackData::SetQuant | ( | int | nTick, |
| int | nQuant ) |
Set the quantisation of the bar at a song position.
A position at or past the end of the track is ignored.
| nTick | The song position, in MIDI ticks. |
| nQuant | The quantisation, in MIDI ticks. |
| void TrackData::SetActive | ( | int | nTick, |
| int | bActive ) |
Do nothing.
LevelBuilder::SetActive() forwards an activeness controller change here.
The title is inferred from the forwarder's callers.
| nTick | The event position, not read. |
| bActive | Whether the controller value was non-zero, not read. |
| void TrackData::SetOwner | ( | Player * | pPlayer, |
| int | nBar ) const |
Report a player for a bar to the gamer, with this track's index.
| pPlayer | The player. |
| nBar | The bar. |
| Harmony * TrackData::GetHarmony | ( | int | nTick | ) | const |
| nTick | The song position, in MIDI ticks. |
| Riff * TrackData::GetRiff | ( | int | nTick, |
| int | nLevel ) const |
| nTick | The song position, in MIDI ticks. |
| nLevel | The difficulty level. |
| Riff * TrackData::GetRiffInMappedBar | ( | int | nBar, |
| int | nOffset, | ||
| int | nLevel ) const |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| nOffset | The offset within the bar. |
| nLevel | The difficulty level. |
| Riff * TrackData::GetRiffInBar | ( | int | nBar, |
| int | nOffset, | ||
| int | nLevel ) const |
| nBar | The index into mBars, not mapped. |
| nOffset | The offset within the bar. |
| nLevel | The difficulty level. |
| int TrackData::GetGemAt | ( | int | nTick | ) | const |
| nTick | The song position, in MIDI ticks. |
| int TrackData::GetQuant | ( | int | nBar | ) | const |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| int TrackData::IsStepStart | ( | int | nBar | ) | const |
| nBar | The bar. |
| int TrackData::StepStartBar | ( | int | nBar | ) | const |
| nBar | The bar. |
| int TrackData::NextStepBar | ( | int | nBar | ) | const |
| nBar | The bar. |
| int TrackData::FollowingStepBar | ( | int | nBar | ) | const |
| nBar | The bar. |
| int TrackData::QueryBar | ( | int | nBar | ) | const |
Ask the gamer about a bar, with this track's index.
| nBar | The bar. |
| int TrackData::GetPoints | ( | int | nBar | ) | const |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| int TrackData::GetJuice | ( | int | nBar | ) | const |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| nBar | The index into mBars, not mapped. |
| const std::vector< TickObj< int > > * TrackData::GetGemsInBar | ( | int | nBar | ) | const |
| nBar | The index into mBars, not mapped. |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| const std::vector< TickObj< int > > * TrackData::GetGems | ( | int | nBar | ) | const |
| nBar | The bar, mapped through PlayMap::MapBar(). |
| void TrackData::Locate | ( | int | nTick, |
| Bar *& | pBar ) |
Find the bar of a song position, discarding the offset.
| nTick | The song position, in MIDI ticks. |
| pBar | Receives the bar. |
| void TrackData::LocateMapped | ( | int | nTick, |
| const Bar *& | pBar ) const |
Find the mapped bar of a song position, discarding the offset.
| nTick | The song position, in MIDI ticks. |
| pBar | Receives the bar. |
| void TrackData::GetBar | ( | int | nBar, |
| const Bar *& | pBar ) const |
Find a bar by its bar number, mapped through PlayMap::MapBar().
| nBar | The bar. |
| pBar | Receives the bar. |
| int TrackData::FindStepIndex | ( | int | nBar | ) | const |
| nBar | The bar. |
|
friend |
|
friend |
| Gamer* TrackData::mGamer |
The gamer the track reports to. Not written by the constructor. +0x00
| int TrackData::mIndex |
The track's index. Copied into ScoreTrackGraph's first member. +0x04
| unsigned char TrackData::mChannel |
MIDI channel the stage sends controller changes on. +0x08
| unsigned char TrackData::mPaddingByte |
No recovered routine accesses it. +0x09
| unsigned short TrackData::mPaddingHalf |
No recovered routine accesses it. +0x0a
| int TrackData::mKind |
A TrackMode. 2 selects a NotePitcher and 3 a Scratcher. +0x0c
| int TrackData::mInstrument |
Instrument index from 0 to 5.
+0x10
Overlay's constructor reads it at 0x0041d0dc through LevelData::TrackAt() and selects DRUMS, BASS, SYNTH, GUITAR, VOCAL, or FX through the jump table at 0x00819080.