|
resonance 1.0.1
|
One switchable audio effect that a powerup applies to a player's track. More...
#include <effector.h>


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. | |
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.
| Effector::Effector | ( | ) |
|
virtual |
|
pure virtual |
Report which effect this object applies.
Implemented in GhostNotesEffector, MidiOnOffEffector, StutterEffector, VolumeEffector, and WahEffector.
|
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.
| bEnabled | Non-zero to apply the effect. |
Reimplemented in GhostNotesEffector, MidiOnOffEffector, StutterEffector, VolumeEffector, and WahEffector.
|
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.
| nType | An EffectorType. Any other value leaves the result null, and the Type() call then dereferences it. |
| nChannel | The MIDI channel the effect sends on. |
| nTrack | The track, substituted into the property lookups. |