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

Freestyle track the player scratches on. More...

#include <scratchtrack.h>

Inheritance diagram for ScratchTrack:
Collaboration diagram for ScratchTrack:

Public Member Functions

 ScratchTrack (ScratchTrackData *pData, const SectionBoundaries *pSections, PlayMap *pPlayMap, const float *pfMsPerTick, int nIndex, int nIntroBars, int nNumBars, int nTicksPerBar)
 Construct a track and its release sounds.
 ~ScratchTrack () override
 Stop the track and release it.
void Start () override
 Select the scratchers of the set at the song position.
void Stop () override
 Withdraw the scheduled commands and stop every scratcher.
void SetPlayer (Player *pPlayer) override
 End the active scratch, then assign the player.
void HandleInput (Player *pPlayer, const PlayNoteEvent &event) override
 Start or end a scratch of the track's player.
void HandleInput (Player *pPlayer, const StickEvent< 2 > &event) override
 Move the active scratcher with a stick position of the track's player.
void HandleInput (Player *pPlayer, const BtnEvent< 10 > &event) override
 Release the scratch of the track's player and play the release sound.
bool IsActive () override
 Report whether a scratch is active.
void Refresh () override
 Withdraw the scheduled update and select the scratchers of the set at the song position.
void HandleInput (Player *pPlayer, const BtnEvent< 8 > &event) override
 Ignore the event.
void HandleInput (Player *pPlayer, const StickEvent< 6 > &event) override
 Pass a stick position of the track's player to the graphics.
Public Member Functions inherited from FreestyleTrack
 FreestyleTrack (const SectionBoundaries *pSections, PlayMap *pPlayMap, const float *pfMsPerTick, int nIndex, int nNumBars, int nTicksPerBar)
 Construct a track.
 ~FreestyleTrack () override
 Release the track.
int WrapTick (int nTick)
 Wrap a tick into the repeat period of the track.
int SpanEnd (int nTick, int nStart, int nEnd)
 Report the tick at which the span that starts at a tick ends.
void UpdatePoints ()
 Award the player pending points for the time the active note sounded in the bar, and run again a twentieth of a bar later.
void StartBar (bool bSchedule)
 Commit the pending points of the bar that ends and restart the timing of the active note.
void SendUpdate (Player *pPlayer, float fX, float fY)
 Send the button and a stick position of a local player to the other consoles, at most once every 150 milliseconds.
int GetTickOffset () const
void SetTickOffset (int nTickOffset)
Public Member Functions inherited from Track
 Track (int nIndex)
 Construct a track with no player.
virtual ~Track ()
 Release the track.
int GetIndex () const
Player * GetPlayer () const

Static Public Member Functions

static void operator delete (void *pBlock)
 Release a track to the pool heap GameLogic allocated it from.

Static Public Attributes

static constexpr int kNumScratchers = ScratchTrackData::kSetSize
 The number of scratchers in a set, one for each gem button.

Additional Inherited Members

Protected Attributes inherited from FreestyleTrack
int mTickOffset
Protected Attributes inherited from Track
int mIndex
Player * mPlayer

Detailed Description

Freestyle track the player scratches on.

The RTTI records the class as deriving from FreestyleTrack. Each gem button the player holds plays one scratcher of the set that plays at the song position. Releasing the scratch plays a short sound on the next quantisation boundary.

Constructor & Destructor Documentation

◆ ScratchTrack()

ScratchTrack::ScratchTrack ( ScratchTrackData * pData,
const SectionBoundaries * pSections,
PlayMap * pPlayMap,
const float * pfMsPerTick,
int nIndex,
int nIntroBars,
int nNumBars,
int nTicksPerBar )

Construct a track and its release sounds.

Parameters
pDataThe scratchers to play.
pSectionsThe section boundaries of the song.
pPlayMapThe map of the song positions.
pfMsPerTickThe length of a tick, in milliseconds.
nIndexThe track's index in the song, also the MIDI channel of the release sounds.
nIntroBarsThe intro length, in bars, which the track ignores.
nNumBarsThe length of the song, in bars.
nTicksPerBarThe length of a bar, in ticks.
Ghidra address:
NTSC-U/C: 0x00137540
Ghidra address:
PAL: 0x00138da0

◆ ~ScratchTrack()

ScratchTrack::~ScratchTrack ( )
override

Stop the track and release it.

Ghidra address:
NTSC-U/C: 0x00137780
Ghidra address:
PAL: 0x00138fe0

Member Function Documentation

◆ operator delete()

void ScratchTrack::operator delete ( void * pBlock)
inlinestatic

Release a track to the pool heap GameLogic allocated it from.

Parameters
pBlockThe block.

◆ Start()

void ScratchTrack::Start ( )
overridevirtual

Select the scratchers of the set at the song position.

Ghidra address:
NTSC-U/C: 0x00137838
Ghidra address:
PAL: 0x00139098

Implements Track.

◆ Stop()

void ScratchTrack::Stop ( )
overridevirtual

Withdraw the scheduled commands and stop every scratcher.

Ghidra address:
NTSC-U/C: 0x00137858
Ghidra address:
PAL: 0x001390b8

Reimplemented from FreestyleTrack.

◆ SetPlayer()

void ScratchTrack::SetPlayer ( Player * pPlayer)
overridevirtual

End the active scratch, then assign the player.

Parameters
pPlayerThe player, or null.
Ghidra address:
NTSC-U/C: 0x00137900
Ghidra address:
PAL: 0x00139160

Reimplemented from FreestyleTrack.

◆ HandleInput() [1/5]

void ScratchTrack::HandleInput ( Player * pPlayer,
const PlayNoteEvent & event )
overridevirtual

Start or end a scratch of the track's player.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x00137940
Ghidra address:
PAL: 0x001391a0

Reimplemented from FreestyleTrack.

◆ HandleInput() [2/5]

void ScratchTrack::HandleInput ( Player * pPlayer,
const StickEvent< 2 > & event )
overridevirtual

Move the active scratcher with a stick position of the track's player.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x001379f8
Ghidra address:
PAL: 0x00139258

Reimplemented from FreestyleTrack.

◆ HandleInput() [3/5]

void ScratchTrack::HandleInput ( Player * pPlayer,
const BtnEvent< 10 > & event )
overridevirtual

Release the scratch of the track's player and play the release sound.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x00137ab0
Ghidra address:
PAL: 0x00139310

Reimplemented from FreestyleTrack.

◆ IsActive()

bool ScratchTrack::IsActive ( )
inlineoverridevirtual

Report whether a scratch is active.

Returns
True while a scratch is active.
Ghidra address:
NTSC-U/C: 0x0033feb8
Ghidra address:
PAL: 0x003ad3f0

Implements FreestyleTrack.

◆ Refresh()

void ScratchTrack::Refresh ( )
overridevirtual

Withdraw the scheduled update and select the scratchers of the set at the song position.

Ghidra address:
NTSC-U/C: 0x00138028
Ghidra address:
PAL: 0x00139888

Implements FreestyleTrack.

◆ HandleInput() [4/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const BtnEvent< 8 > & event )
inlineoverridevirtual

Ignore the event.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0034b6d8
Ghidra address:
PAL: 0x003b8b08

Reimplemented from FreestyleTrack.

◆ HandleInput() [5/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const StickEvent< 6 > & event )
overridevirtual

Pass a stick position of the track's player to the graphics.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0014f3b8
Ghidra address:
PAL: 0x00150d18

Reimplemented from FreestyleTrack.

Member Data Documentation

◆ kNumScratchers

int ScratchTrack::kNumScratchers = ScratchTrackData::kSetSize
staticconstexpr

The number of scratchers in a set, one for each gem button.


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