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

Event the game passes between a MsgSource and a MsgSink. More...

#include <multimusemsg.h>

Inheritance diagram for MultiMuseMsg:
Collaboration diagram for MultiMuseMsg:

Public Member Functions

 MultiMuseMsg (MultiMuse *pMuse)
 MultiMuseMsg (const MultiMuseMsg &other)
virtual ~MultiMuseMsg ()
virtual Message * Clone ()
 Produce a heap copy of this message.
virtual int Type ()
 Report this message's registered identity.
virtual const char * GetName () const
 Report this message's class name.
virtual void PrintExtra (std::ostream &stream) const
 Write the message to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the sequence to an output stream.
virtual void restoreGuts (IBStream &stream)
 Read the sequence back from an input stream.
Public Member Functions inherited from MuseMsg
 MuseMsg ()
 Start the song position at kTickInfinity.
 MuseMsg (int nTick)
 Start the song position at a tick.
MuseMsg * CloneAndShift (int nTick)
 Copy this message and move the copy to a song position.
Public Member Functions inherited from Message
void * operator new (size_t nSize)
 Allocate a message from the tagged heap under the tag MSG.
void operator delete (void *pBlock)
 Release a message to the tagged heap under the tag MSG.
virtual ~Message ()
 Vtable slot 1.
std::ostream & Print (std::ostream &stream) const
 Write this message to a diagnostic stream as {GetName() PrintExtra()}.

Static Public Member Functions

static Message * New ()
 Produce a message with no sequence.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Public Attributes

MultiMuse * mMuse
 The sequence.
Public Attributes inherited from MuseMsg
int mTick
 The song position, in MIDI ticks.

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x008eec98. It has MuseMsg as its one base. The object is 0xc bytes and its vtable is at 0x00812df8. Clone() delegates to the copy constructor at 0x003e38a8 rather than copying inline.

The word at +0x08 is what settles MuseMsg's payload. This class copies a word there while NoteMsg and StdMidiMsg copy bytes, and a single word store cannot straddle a base and a derived class in a member-wise copy, so +0x08 belongs to each derived class rather than to MuseMsg.

That word is a MultiMuse, and the class is how a sequence of timed messages moves between a MsgSource and a MsgSink. The copy constructor at 0x003e38a8 retains it, the destructor releases it, PrintExtra() writes it through MultiMuse::Print(), saveGuts() writes it through MultiMuse::SaveFields(), and restoreGuts() replaces it with a freshly allocated sequence.

PrintExtra() also settles MuseMsg's own member. It copies that word into a temporary and writes the temporary through Sch::Tick::Print(), so MuseMsg's payload is a song position. Both this class and StdMidiMsg initialise it to 0x2aaaaaab, which Sch::Tick documents as inside its positive infinity range.

Constructor & Destructor Documentation

◆ MultiMuseMsg() [1/2]

MultiMuseMsg::MultiMuseMsg ( MultiMuse * pMuse)
Parameters
pMuseThe sequence, retained when it is not null. It is stored either way.
Ghidra address:
NTSC-U/C: 0x003e38e8
Ghidra address:
PAL: 0x0041bc88

◆ MultiMuseMsg() [2/2]

MultiMuseMsg::MultiMuseMsg ( const MultiMuseMsg & other)
Parameters
otherThe message to copy.
Ghidra address:
NTSC-U/C: 0x003e38a8
Ghidra address:
PAL: 0x0041bc48

◆ ~MultiMuseMsg()

virtual MultiMuseMsg::~MultiMuseMsg ( )
virtual
Ghidra address:
NTSC-U/C: 0x003e3920
Ghidra address:
PAL: 0x0041bcc0

Member Function Documentation

◆ New()

Message * MultiMuseMsg::New ( )
static

Produce a message with no sequence.

New() takes 0xc bytes against the tag MultiMuseMsg and calls this with a null sequence, and the registration table at 0x003d9818 records it as this class's factory.

Returns
The new message.
Ghidra address:
NTSC-U/C: 0x003d6e08
Ghidra address:
PAL: 0x0040ecf8

◆ Clone()

virtual Message * MultiMuseMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003dc590
Ghidra address:
PAL: 0x004149c8

Implements Message.

◆ Type()

virtual int MultiMuseMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_dwMultiMuseMsgType.
Ghidra address:
NTSC-U/C: 0x003dc608
Ghidra address:
PAL: 0x00414a40

Implements Message.

◆ GetName()

virtual const char * MultiMuseMsg::GetName ( ) const
virtual

Report this message's class name.

Returns
The literal MultiMuseMsg.
Ghidra address:
NTSC-U/C: 0x003dc618
Ghidra address:
PAL: 0x00414a50

Implements Message.

◆ PrintExtra()

virtual void MultiMuseMsg::PrintExtra ( std::ostream & stream) const
virtual

Write the message to a diagnostic stream.

Writes the inherited song position, a literal, and then the sequence.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003e3990
Ghidra address:
PAL: 0x0041bd30

Reimplemented from Message.

◆ saveGuts()

virtual void MultiMuseMsg::saveGuts ( OBStream & stream) const
virtual

Write the sequence to an output stream.

The inherited song position is not written.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003e39f8
Ghidra address:
PAL: 0x0041bd98

Reimplemented from Message.

◆ restoreGuts()

virtual void MultiMuseMsg::restoreGuts ( IBStream & stream)
virtual

Read the sequence back from an input stream.

Allocates a fresh MultiMuse with one reference and reads into it. Whatever sequence the message already stored is replaced without being released, which is faithful and leaks that sequence when the message already had one.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x003d8180
Ghidra address:
PAL: 0x004102e8

Reimplemented from Message.

Member Data Documentation

◆ mMuse

MultiMuse* MultiMuseMsg::mMuse

The sequence.

+0x08

Public because PitchPicker::OnMsg() at 0x001c2c84 reads it directly with no accessor in the image.


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