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

Catcher that scores a whole range of bars at once. More...

#include <multicatcher.h>

Inheritance diagram for MultiCatcher:
Collaboration diagram for MultiCatcher:

Public Member Functions

 MultiCatcher (PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, const TrackData *pTrackData, Sch::TickClock *pClock, Sch::Tick tick)
virtual ~MultiCatcher ()
virtual void CapturePhrase (int nBar, int nRun, int nAutoCatch)
 Capture the phrase of one bar.
virtual void ReportCaughtPowerbar (int nBar)
 Report nothing.
Public Member Functions inherited from Catcher
 Catcher (PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, const TrackData *pTrackData, Sch::TickClock *pClock, int nSeekerBarCount, Sch::Tick catchWindow)
virtual ~Catcher ()
 Withdraw both commands through Stop().
virtual void DispatchPriv (Message *pMsg)
 Act on a message.
virtual void Start ()
 Schedule the catcher's two commands on the clock.
virtual void Stop ()
 Withdraw the catcher's two commands from the clock.
virtual int IsPhraseRunEmpty ()
 Report whether the catcher has nothing outstanding.
virtual void MissGem (int nTick, int nGem)
 Record a missed gem.
virtual void CatchGem (int nTick, int nGem)
 Record a caught gem.
void ProcessGemCommand (int nTick)
 Run the post-gem command at a song position.
void SimulateRemoteGem (int nTick)
 Play the remote player's gem at a song position, then schedule the next gem command.
Public Member Functions inherited from GenericCatcher
 GenericCatcher ()
virtual ~GenericCatcher ()
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.
Public Member Functions inherited from MsgSource
virtual ~MsgSource ()
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.

Additional Inherited Members

Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.
Protected Member Functions inherited from Catcher
void PostPhraseMuffedMsg (int nBar, Sch::Tick position)
 Sends a PhraseMuffedMsg for a bar once, recording the bar in mLastMuffedBar.
void PostCatchMsg (PitchRiffMsg *pMsg)
 Scores a PitchRiffMsg for this track.
void PostCaughtBarMsg (int nBar, int nNextBar)
 Does nothing once a gem of the phrase was missed or muffed.
int SnapToNearestGem (int nTick)
 Returns the gem on either side of nTick nearer to it when that gem lies within mCatchWindow, and nTick otherwise.
void OnTrackSelect (TrackSelectMsg *pMsg)
 Takes the track for the player a TrackSelectMsg names.
void OnAutoCatch (AutoCatchMsg *pMsg)
 Plays a free bar for the player an AutoCatchMsg identifies through CapturePhrase(), marks the message handled through CmdMsg::mResult, and replays the bar from the current offset through PhraseMgr::ReplayBar() when the song is inside it.
void EndBar (int nBar)
 Closes the counts for a bar.
int FindNextGemTick (int nTick)
 Returns the first gem position after nTick.
void SchedulePostGemCommand (int nTick)
 Build a PostGemCmd for the gem after nTick and queue it one tick after PostGemDelay() under the handle mPostGemCommand.
void ScheduleGemCommand (int nTick)
 Build a GemCmd for the gem after nTick and queue it at that gem under the handle mGemCommand.
int PostGemDelay (int nTick)
 Returns the earlier of the midpoint between nTick and the next gem, and nTick plus mCatchWindow.
void UpdateSeeker (int nBar)
 Finds the next free bar within 32 bars of nBar (or of the bar after mLastMuffedBar) and points the seeker at the phrase starting there, or turns the seeker off.
void PostSeekerMsg ()
 Sends a SeekerMsg that turns the seeker off and clears mSeekerEnabled.
void PostSeekerRangeMsg (int nFirstBar, int nBarCount)
 Sends a SeekerMsg for nBarCount bars from nFirstBar at position 0, and records the range in mSeekerFirstBar, mSeekerEndBar, and mSeekerEnabled.
int IsBarFree (int nBar)
 Returns whether a bar is non-negative, playable according to TrackData::QueryBar(), and owned by no player.
void OnInvalidateSeeker (InvalidateSeekerMsg *pMsg)
 The out-of-line copy of the InvalidateSeekerMsg branch DispatchPriv() expands inline.
void SetPhraseOwners (int nFirstBar, int nEndBar, Player *pPlayer)
 Gives every bar from nFirstBar up to nEndBar to one player.
Protected Attributes inherited from Catcher
Quantizer * mQuantizer
PhraseMgr * mPhraseMgr
const TrackData * mTrackData
Player * mPlayer
Sch::TickClock * mClock
Sch::CmdID mPostGemCommand
Sch::CmdID mGemCommand
Sch::Tick mTicksPerBar
int mSeekerBarCount
int mCatchWindow
int mEnabled
Sch::Tick mLastCaughtPosition
Sch::Tick mLastMissedPosition
int mTrack
int mCaughtGems
int mMissedGems
int mMuffedGems
int mLastEndedBar
int mPhraseRunBars
int mLastMuffedBar
int mSeekerFirstBar
int mSeekerEndBar
int mSeekerEnabled
Player * mRemotePlayer
float mRemoteSuccess
Sch::Tick mRemotePosition

Detailed Description

Catcher that scores a whole range of bars at once.

Its RTTI descriptor is at 0x008ef518. It has Catcher as its only base at offset 0. Its primary table is at 0x007e0b28 with eleven entries and its MsgSource subobject table at 0x007e0b00 with four. The table is the same length as the base's. The class introduces no virtual and overrides only the destructor and the base's two pure slots. The object is 0x80 bytes, the same as the base. It adds no data member.

The constructor's whole body is the base construction and the two table stores, and it supplies 1 for the base's int parameter. The destructor's whole body is the base teardown and the tagged release behind the deleting flag, which is why both definitions are empty of anything a programmer wrote.

CatchingSTG builds one of these for every game mode other than 1, and a SingleCatcher for 1.

Constructor & Destructor Documentation

◆ MultiCatcher()

MultiCatcher::MultiCatcher ( PhraseMgr * pPhraseMgr,
Quantizer * pQuantizer,
const TrackData * pTrackData,
Sch::TickClock * pClock,
Sch::Tick tick )
Parameters
pPhraseMgrThe phrase manager for the track.
pQuantizerThe quantiser for the track.
pTrackDataThe track description.
pClockThe clock the scheduled commands run on.
tickThe catch window, in MIDI ticks.
Ghidra address:
NTSC-U/C: 0x001b1a60
Ghidra address:
PAL: 0x001b7820

◆ ~MultiCatcher()

virtual MultiCatcher::~MultiCatcher ( )
virtual
Ghidra address:
NTSC-U/C: 0x001b0d98
Ghidra address:
PAL: 0x001b6b48

Member Function Documentation

◆ CapturePhrase()

virtual void MultiCatcher::CapturePhrase ( int nBar,
int nRun,
int nAutoCatch )
virtual

Capture the phrase of one bar.

Slot 9. The bar's points, times Player::GetMultiplier() for the bar (or 1 for an automatic catch), become its score. The bar is given to mPlayer, a PhraseCapturedMsg whose run starts nRun - 1 bars earlier and a SectionCapturedMsg are sent, and the score is stored as the bar's phrase byte. A bar with a power bar also sends a CaughtPowerbarMsg, to the sinks and to mPlayer, unless the catch was automatic.

Parameters
nBarThe bar.
nRunThe bars the run spans.
nAutoCatchNon-zero for an automatic catch.
Ghidra address:
NTSC-U/C: 0x001ad8e8
Ghidra address:
PAL: 0x001b3650

Implements Catcher.

◆ ReportCaughtPowerbar()

virtual void MultiCatcher::ReportCaughtPowerbar ( int nBar)
virtual

Report nothing.

Slot 10. The body is empty. The base declares the slot pure. The empty body is therefore a real override rather than an inherited default, and it makes this class concrete.

Parameters
nBarThe caught bar, unread.
Ghidra address:
NTSC-U/C: 0x001b0e00
Ghidra address:
PAL: 0x001b6bb0

Implements Catcher.


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