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

Player that turns one MultiMuse into messages over time. More...

#include <multimuseplayer.h>

Inheritance diagram for MultiMusePlayer:
Collaboration diagram for MultiMusePlayer:

Public Member Functions

 MultiMusePlayer (MultiMuse *pMuse, MuseParent *pParent, Sch::TickClock *pClock)
virtual ~MultiMusePlayer ()
virtual void Start (MsgSink *pSink)
virtual void Stop ()
virtual int DisplacesSiblings ()
 MusePlayer table slot 4.
virtual void RetainOnly (MusePlayer *pPlayer)
virtual void PlayerFinished (MusePlayer *pPlayer)
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
Public Member Functions inherited from MuseSynth
 MuseSynth (Sch::TickClock *pClock)
virtual ~MuseSynth ()
 Release every player and then the splitter.
void AddSink (MsgSink *pSink)
 Register a sink with the splitter every player sends to.
void CreateSustainer ()
 Build the sustain filter this synthesiser feeds through.
int IsActive () const
 Report whether any player is sounding.
void ReleaseAllPlayers ()
 Stop and release every player.
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 MusePlayer
void * operator new (size_t nSize)
 Allocate a player from the untagged heap.
void operator delete (void *pBlock)
 Release a player to the untagged heap.
 MusePlayer ()
 Construct a player with the next serial number.
virtual ~MusePlayer ()
 Inline.

Additional Inherited Members

Protected Member Functions inherited from MuseSynth
void StartNotePlayer (Message *pMsg)
 Start a note player for one NoteMsg.
void StartMultiMusePlayer (Message *pMsg)
 Start a MultiMusePlayer for one MultiMuseMsg.
virtual void DispatchPriv (Message *pMsg)
 Act on a message.
void OnAllNotesOff ()
 The out-of-line copy of the AllNotesOffMsg branch DispatchPriv() expands inline.
void OnStdMidi (StdMidiMsg *pMsg)
 The out-of-line copy of the StdMidiMsg branch DispatchPriv() expands inline.
void OnSustainNote (SustainNoteMsg *pMsg)
 The out-of-line copy of the SustainNoteMsg branch DispatchPriv() expands inline.
Protected Attributes inherited from MuseSynth
Sch::TickClock * mClock
MsgSplitter mSplitter
SynthSustainer * mSustainer
MsgSink * mOutput
std::list< MusePlayer * > mPlayers

Detailed Description

Player that turns one MultiMuse into messages over time.

Its RTTI descriptor is at 0x00901c50. It has MuseSynth at offset 0 and MusePlayer at offset 48. The allocation in MuseSynth::StartMultiMusePlayer() measures the object at 0x50 bytes. It has three tables: the primary at 0x007dfd58, the MuseParent one at 0x007dfd38, and the MusePlayer one at 0x007dfd08. The slot indices restart in each table. MuseParent slot 2 and MusePlayer slot 2 are therefore both members of this class.

It is both a player and a MuseSynth. Start() posts a scheduler command over its sequence, and each message that command dispatches arrives back through the MuseSynth half, which creates a player for it. That is why the class inherits MuseSynth::DispatchPriv() unchanged rather than overriding it.

Both MuseParent overrides forward once up the chain. RetainOnly() reports the request to its own parent the first time and never again, and PlayerFinished() reports itself finished to its own parent once the schedule is exhausted and the last child player is gone.

Constructor & Destructor Documentation

◆ MultiMusePlayer()

MultiMusePlayer::MultiMusePlayer ( MultiMuse * pMuse,
MuseParent * pParent,
Sch::TickClock * pClock )
Parameters
pMuseThe sequence to play, retained for the lifetime of the player.
pParentThe owner this player reports back to.
pClockThe clock the schedule is posted against.
Ghidra address:
NTSC-U/C: 0x001a9fb8
Ghidra address:
PAL: 0x001afd20

◆ ~MultiMusePlayer()

virtual MultiMusePlayer::~MultiMusePlayer ( )
virtual
Ghidra address:
NTSC-U/C: 0x001aa100
Ghidra address:
PAL: 0x001afe68

Member Function Documentation

◆ Start()

virtual void MultiMusePlayer::Start ( MsgSink * pSink)
virtual
Ghidra address:
NTSC-U/C: 0x001a9b48
Ghidra address:
PAL: 0x001af8b0

Implements MusePlayer.

◆ Stop()

virtual void MultiMusePlayer::Stop ( )
virtual
Ghidra address:
NTSC-U/C: 0x001aa1b8
Ghidra address:
PAL: 0x001aff20

Implements MusePlayer.

◆ DisplacesSiblings()

virtual int MultiMusePlayer::DisplacesSiblings ( )
virtual

MusePlayer table slot 4.

The body is one instruction and returns 1.

Returns
1.
Ghidra address:
NTSC-U/C: 0x001a9ed0
Ghidra address:
PAL: 0x001afc38

Implements MusePlayer.

◆ RetainOnly()

virtual void MultiMusePlayer::RetainOnly ( MusePlayer * pPlayer)
virtual
Ghidra address:
NTSC-U/C: 0x001aa1f8
Ghidra address:
PAL: 0x001aff60

Reimplemented from MuseSynth.

◆ PlayerFinished()

virtual void MultiMusePlayer::PlayerFinished ( MusePlayer * pPlayer)
virtual
Ghidra address:
NTSC-U/C: 0x001a9c30
Ghidra address:
PAL: 0x001af998

Reimplemented from MuseSynth.

◆ operator delete()

void MsgSink::operator delete ( void * pBlock)
inline

Release a sink to the tagged heap.

No out-of-line body exists. The release branch of every derived destructor inlines the call with the literal MsgSink, 294 sites in all.

Parameters
pBlockThe block.

◆ operator new()

void * MsgSink::operator new ( size_t nSize)
inline

Allocate a sink from the tagged heap under the tag "MsgSink".

No out-of-line body exists. Every allocation of a derived class inlines the call, 78 sites in all, among them the Synth unit's file-local NullSynth::New() at 0x0013a0c0 and new MetArenasScreen at 0x001fc690. Both pass the literal MsgSink. MsgSource declares no allocation pair. Its destructor at 0x0054a168 proves that by releasing its vector without a tagged free, and a class deriving from both bases therefore resolves the operator here without ambiguity.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

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