resonance 1.0.1
Loading...
Searching...
No Matches
PlayMapRing Class Reference

Traversal that wraps from the end of the sequence back to the start. More...

#include <playmapring.h>

Inheritance diagram for PlayMapRing:
Collaboration diagram for PlayMapRing:

Public Member Functions

virtual int MapBar (int nBar)
 Wraps the bar into one turn of the ring.
virtual std::vector< int > & FindBarsPlaying (int nStart, int nMin, int nEnd)
 Collects every position of one span into mFoundBars.
virtual int GetLength () const
 Scales one turn of the ring by a repeat count.
Public Member Functions inherited from PlayMap
void * operator new (size_t nSize)
 Allocate a map from the tagged heap under the tag PlayMap.
void operator delete (void *pBlock)
 Release a map to the tagged heap under the tag PlayMap.
 PlayMap ()
 Construct an empty map whose first step is at zero.
virtual ~PlayMap ()
 Inline.
virtual void AddStep (int nPosition, HxStr strLabel)
 Slot 2.
virtual void SetBarCount (int nBarCount)
 Slot 3.
virtual void ResetSpans ()
 Slot 4.
virtual int MapToLinkedStep (int nPosition, int nSet)
 Slot 7.
virtual int GetEndBar ()
 Slot 9.
virtual int GetNumSections () const
 Slot 10.
virtual int GetPatternSection (int nIndex)
 Slot 11.
virtual int GetPatternIndex (int nBar)
 Slot 12.
virtual int GetAbsoluteSectionIndex (int nBar)
 Slot 13.
virtual int IsLooping (int nBar)
 Slot 14.
virtual void CloseSpan (int nRepeats)
 Slot 15.
virtual int EndLoop (int nBar)
 Slot 16.
virtual int StartLoop (int nBar)
 Slot 17.
virtual int ToggleLoop (int nBar)
 Slot 18.
int FindStepIndex (int nPosition)
 Report the index of the step at or before a position that has already been mapped.
int IsStepStart (int nBar)
 Report whether a bar maps exactly onto a step.
int StepStartBar (int nBar)
 Report the bar at which the step containing a bar began.
int NextStepBar (int nBar)
 Report the bar at which the first step at or after a bar begins.
int FollowingStepBar (int nBar)
 Report the bar at which the first step strictly after a bar begins.

Additional Inherited Members

Public Attributes inherited from PlayMap
int mBarCount
 The number of bars SetBarCount() stores.
std::vector< int > mSteps
 Ascending sequence of positions.
std::vector< int > mSectionLengths
 Length of each section, the gap between one step and the previous one.
std::vector< HxStr > mSectionNames
 Label of each section, the one AddStep() receives with the step.
Protected Attributes inherited from PlayMap
int mUnusedValue
std::vector< int > mFoundBars

Detailed Description

Traversal that wraps from the end of the sequence back to the start.

PlayMapRing in the RTTI descriptor at 0x00901dd0, with PlayMap as its only base at offset

  1. Its table runs the same nineteen entries as the base, adding none, and it fills the two the base leaves pure, so the class is concrete. Beyond slots 1, 5, 6, and 8 every entry is the base implementation, which is the narrowest override set of the three subclasses.

No member is recovered, so none is declared, and the class adds no data to the 0x3c bytes of the base. The constructor at 0x0012daa0 is implicit for the same reason the destructor below is. It runs the PlayMap constructor and installs the table at 0x007d1598, and no routine in the image calls it.

The destructor at 0x0012e178 is declared nowhere here. Its body restores the base table pointer, tears down the four base vectors inline, and releases through the base allocation tag PlayMap rather than a tag of its own, which is exactly what an implicit destructor for this class compiles to. An empty destructor a programmer wrote would compile to the same bytes, so the two cannot be told apart, and the convention of this tree resolves that by declaring neither. The routine still occupies slot 1 of this class's own table, because the compiler emits an implicit destructor per class.

Member Function Documentation

◆ MapBar()

virtual int PlayMapRing::MapBar ( int nBar)
virtual

Wraps the bar into one turn of the ring.

The body returns (nBar + mBarCount) % mSteps.back(). mSteps.back() is therefore the length of one turn, and mBarCount is the offset the ring starts at.

Parameters
nBarThe bar to wrap.
Returns
The wrapped position.
Ghidra address:
NTSC-U/C: 0x0012e408
Ghidra address:
PAL: 0x0012eb80

Implements PlayMap.

◆ FindBarsPlaying()

virtual std::vector< int > & PlayMapRing::FindBarsPlaying ( int nStart,
int nMin,
int nEnd )
virtual

Collects every position of one span into mFoundBars.

The body clears mFoundBars, then walks a value from nStart upward in steps of mSteps.back() while it remains below nEnd, appending each value that is not below nMin.

Parameters
nStartThe first position.
nMinThe lowest position to collect.
nEndThe position to stop below.
Returns
mFoundBars.
Ghidra address:
NTSC-U/C: 0x0012dad8
Ghidra address:
PAL: 0x0012e238

Implements PlayMap.

◆ GetLength()

virtual int PlayMapRing::GetLength ( ) const
virtual

Scales one turn of the ring by a repeat count.

The repeat count is configuration code 0x385, read through QueryConfigValue().

Returns
One turn scaled by the repeat count.
Ghidra address:
NTSC-U/C: 0x0012e430
Ghidra address:
PAL: 0x0012eba8

Reimplemented from PlayMap.


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