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

Map from the bars a song plays to the bars of the song as written, with the loops that repeat stretches of bars. More...

#include <playmap.h>

Classes

class  Loop
 Stretch of the song as written that plays from a bar on. More...

Public Member Functions

 PlayMap (int nTicksPerBar, int nEndBar)
 Construct a map that plays the song as written, from bar 0 without end.
void AddLoop (int nStartBar, int nNumBars, int nPlayBar)
 Play a range of bars of the song as written from a bar on, repeating without end.
int MapBar (int nBar) const
 Map a bar the song plays to the bar of the song as written.
int MapTick (int nTick) const
 Map a tick the song plays at to the tick of the song as written.
void GetSegment (int nTick, int *pChangeTick, int *pEnd, int *pNextStart, int *pNextLength, int *pIsLast)
 Report the stretch of the song as written that plays at a tick, and the stretch after it.
int GetEndBar () const
 Report the bar the song ends at.
void ClearLoops ()
 Remove every loop, and play the song as written again.
int GetLooping () const

Detailed Description

Map from the bars a song plays to the bars of the song as written, with the loops that repeat stretches of bars.

The class is not polymorphic. The RTTI includes the nested PlayMap::Loop.

Constructor & Destructor Documentation

◆ PlayMap()

PlayMap::PlayMap ( int nTicksPerBar,
int nEndBar )

Construct a map that plays the song as written, from bar 0 without end.

Parameters
nTicksPerBarThe song ticks in one bar.
nEndBarThe bar the song ends at while no loop was added.
Ghidra address:
NTSC-U/C: 0x0012e3a0
Ghidra address:
PAL: 0x0012fb78

Member Function Documentation

◆ AddLoop()

void PlayMap::AddLoop ( int nStartBar,
int nNumBars,
int nPlayBar )

Play a range of bars of the song as written from a bar on, repeating without end.

The repetition of the current last loop under way at that bar plays only up to the bar.

Parameters
nStartBarThe first bar of the range as written.
nNumBarsThe length of the range in bars.
nPlayBarThe bar the song plays the range from.
Ghidra address:
NTSC-U/C: 0x0012e5e0
Ghidra address:
PAL: 0x0012fdb8

◆ MapBar()

int PlayMap::MapBar ( int nBar) const

Map a bar the song plays to the bar of the song as written.

Parameters
nBarThe bar the song plays.
Returns
The bar as written, which is negative inside a stretch of silence.
Ghidra address:
NTSC-U/C: 0x0012ea38
Ghidra address:
PAL: 0x00130210

◆ MapTick()

int PlayMap::MapTick ( int nTick) const

Map a tick the song plays at to the tick of the song as written.

Parameters
nTickThe tick the song plays at.
Returns
The tick of the song as written.
Ghidra address:
NTSC-U/C: 0x0012eab8
Ghidra address:
PAL: 0x00130290

◆ GetSegment()

void PlayMap::GetSegment ( int nTick,
int * pChangeTick,
int * pEnd,
int * pNextStart,
int * pNextLength,
int * pIsLast )

Report the stretch of the song as written that plays at a tick, and the stretch after it.

A loop that repeats without end stores 0x20000001 in pChangeTick, stores 1 in pIsLast, and does not write the other outputs.

Parameters
nTickThe tick the song plays at.
pChangeTickReceives the tick the song plays at where the next stretch begins.
pEndReceives the tick of the song as written where the current stretch ends.
pNextStartReceives the tick of the song as written where the next stretch begins.
pNextLengthReceives the length of the next stretch in ticks.
pIsLastReceives whether no loop follows the current one.
Ghidra address:
NTSC-U/C: 0x0012eb20
Ghidra address:
PAL: 0x001302f8

◆ GetEndBar()

int PlayMap::GetEndBar ( ) const

Report the bar the song ends at.

Returns
The last bar, or 0x20000001 while a loop repeats.
Ghidra address:
NTSC-U/C: 0x0012ec98
Ghidra address:
PAL: 0x00130470

◆ ClearLoops()

void PlayMap::ClearLoops ( )

Remove every loop, and play the song as written again.

mLooping remains set.

Ghidra address:
NTSC-U/C: 0x0012ecb8
Ghidra address:
PAL: 0x00130490

◆ GetLooping()

int PlayMap::GetLooping ( ) const
inline
Returns
Whether a loop was added.

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