resonance 1.0.1
Loading...
Searching...
No Matches
Effector Class Referenceabstract

One switchable audio effect that a powerup applies to a player's track. More...

#include <effector.h>

Inheritance diagram for Effector:
Collaboration diagram for Effector:

Public Member Functions

 Effector ()
virtual ~Effector ()
virtual int Type ()=0
 Report which effect this object applies.
virtual void SetEnabled (int bEnabled)
 Switch the effect on or off.
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.

Static Public Member Functions

static Effector * CreateForType (int nType, unsigned char nChannel, int nTrack)
 Build the effect one type selects.

Additional Inherited Members

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

Detailed Description

One switchable audio effect that a powerup applies to a player's track.

Its RTTI descriptor is at 0x008eff60. It has MsgSource as its one base. The class declares no data member. An instance is therefore the 0x14 bytes of the base, and the vptr stays where MsgSource put it at +0x10. Two measurements fix the size. GhostNotesEffector adds no field and the factory allocates 0x14 bytes for it, and VolumeEffector places its first field at +0x14.

The table at 0x007de948 runs GetTypeInfo, the destructor, MsgSource::AddSink() and MsgSource::RemoveSink() inherited unchanged, then the two virtuals below. Slot 4 addresses the pure-virtual report routine. That is the evidence for Type() being pure.

An effect is expressed as MIDI rather than as a filter. Every derived class that does any work sends a control change through MsgSource::Send(), and the synthesiser downstream applies it. The channel and the controller number are fixed when the effect is built.

Five classes derive from this one. VolumeEffector, MidiOnOffEffector, and GhostNotesEffector derive from it alone. WahEffector and StutterEffector derive from TickTask as well, placing their Effector subobject at +0x20. Both of those vary their control value over time.

Constructor & Destructor Documentation

◆ Effector()

Effector::Effector ( )
Ghidra address:
NTSC-U/C: 0x001a18c8
Ghidra address:
PAL: 0x001a7630

◆ ~Effector()

virtual Effector::~Effector ( )
virtual
Ghidra address:
NTSC-U/C: 0x001a24a8
Ghidra address:
PAL: 0x001a8210

Member Function Documentation

◆ Type()

virtual int Effector::Type ( )
pure virtual

Report which effect this object applies.

Returns
An EffectorType.

Implemented in GhostNotesEffector, MidiOnOffEffector, StutterEffector, VolumeEffector, and WahEffector.

◆ SetEnabled()

virtual void Effector::SetEnabled ( int bEnabled)
virtual

Switch the effect on or off.

The default implementation does nothing, and every derived class that sends MIDI overrides it. A derived class compares the request against its stored flag first and sends nothing when the request repeats the current position.

Parameters
bEnabledNon-zero to apply the effect.
Ghidra address:
NTSC-U/C: 0x001a2558
Ghidra address:
PAL: 0x001a82c0

Reimplemented in GhostNotesEffector, MidiOnOffEffector, StutterEffector, VolumeEffector, and WahEffector.

◆ CreateForType()

Effector * Effector::CreateForType ( int nType,
unsigned char nChannel,
int nTrack )
static

Build the effect one type selects.

The routine allocates the class the type selects, reads that class's tuning values from configuration codes 0x38f through 0x392 (the wah substitutes nTrack into both lookups), and returns the Effector subobject. The stutter's code 0x391 must hold exactly two values, and any other count stops the game with Need 2 stutter parameters. The returned object's Type() is called once and the result is discarded. JamEffectsMgr's constructor is the recovered caller.

Parameters
nTypeAn EffectorType. Any other value leaves the result null, and the Type() call then dereferences it.
nChannelThe MIDI channel the effect sends on.
nTrackThe track, substituted into the property lookups.
Returns
The new effect.
Ghidra address:
NTSC-U/C: 0x001a0df0
Ghidra address:
PAL: 0x001a6b58

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