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

Player of the phrases one track is divided into. More...

#include <phraseplayer.h>

Inheritance diagram for PhrasePlayer:
Collaboration diagram for PhrasePlayer:

Public Member Functions

 PhrasePlayer (PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, const TrackData *pTrackData)
virtual void DispatchPriv (Message *pMsg)
 Act on a message.
void PlayBar (int nBar)
 Play the phrase of one bar.
void PlayBarAt (int nBar, int nOffset, int nElapsed)
 Play a bar again from an offset, already some ticks under way.
void SetJamEffectsMgr (JamEffectsMgr *pJamEffects)
 Install the jam-effects manager the step values go to.
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.
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.

Additional Inherited Members

Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.

Detailed Description

Player of the phrases one track is divided into.

Its RTTI descriptor is at 0x008eff30. It is built over MsgSource at offset 0 and MsgSink at offset 20. The primary table is at 0x007e3120 with four entries and the MsgSink subobject table at 0x007e30f8. MsgSource coming first is why every upcast to MsgSink in the stage classes adjusts by +0x14 and guards the adjustment against a null pointer. The object is 0x30 bytes, which ScoreTrackGraph's constructor measures at 0x001cef40.

Each bar sends the bar's phrase to the sinks as one MultiMuseMsg. How the sequence is built depends on the track mode: an axe or vocal track sends the phrase's own sequence, a riff or scratch track the riff of every phrase gem, and a catch track the riff of every gem of the bar.

The destructor at 0x001c2658 is implicitly declared. It restores the base tables, frees MsgSource's vector, and releases the object under MsgSink's tag.

Constructor & Destructor Documentation

◆ PhrasePlayer()

PhrasePlayer::PhrasePlayer ( PhraseMgr * pPhraseMgr,
Quantizer * pQuantizer,
const TrackData * pTrackData )
Parameters
pPhraseMgrThe phrase manager of the track.
pQuantizerThe quantiser of the track.
pTrackDataThe track description. The constructor copies its mode.
Ghidra address:
NTSC-U/C: 0x001c17d8
Ghidra address:
PAL: 0x001c7620

Member Function Documentation

◆ DispatchPriv()

virtual void PhrasePlayer::DispatchPriv ( Message * pMsg)
virtual

Act on a message.

Slot 3 of the MsgSink table. The routine asks the message for its identity and discards the answer, which is what remains of a dispatch with no case left in the release build.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001c2928
Ghidra address:
PAL: 0x001c8770

Implements MsgSink.

◆ PlayBar()

void PhrasePlayer::PlayBar ( int nBar)

Play the phrase of one bar.

PhraseMgr::OnCommand() calls it once a bar. The step value of the bar goes to mJamEffects when there is one. A bar after mLastBar with a phrase is then played from its start.

Parameters
nBarThe bar.
Ghidra address:
NTSC-U/C: 0x001c1860
Ghidra address:
PAL: 0x001c76a8

◆ PlayBarAt()

void PhrasePlayer::PlayBarAt ( int nBar,
int nOffset,
int nElapsed )

Play a bar again from an offset, already some ticks under way.

PhraseMgr::ReplayBar() is the recovered caller. A riff track plays the phrase gems and every other mode plays the bar's gems, whatever the phrase of the bar.

Parameters
nBarThe bar.
nOffsetThe offset within the bar, in MIDI ticks. Earlier gems are skipped.
nElapsedThe ticks since the bar started, subtracted from every gem position.
Ghidra address:
NTSC-U/C: 0x001c2818
Ghidra address:
PAL: 0x001c8660

◆ SetJamEffectsMgr()

void PhrasePlayer::SetJamEffectsMgr ( JamEffectsMgr * pJamEffects)

Install the jam-effects manager the step values go to.

PitchingSTG's and VoxingSTG's constructors call it. The title is inferred.

Parameters
pJamEffectsThe manager, or null.
Ghidra address:
NTSC-U/C: 0x001c2810
Ghidra address:
PAL: 0x001c8658

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