wavelength 1.0.0
Loading...
Searching...
No Matches
ExpressionStick Class Reference

Analogue stick of one controller that bends the notes a player plays. More...

#include <expressionstick.h>

Inheritance diagram for ExpressionStick:
Collaboration diagram for ExpressionStick:

Public Member Functions

 ExpressionStick (int nPad, int nStick)
 Construct the reader of one stick and add it to the receivers of the controller messages.
 ~ExpressionStick () override
 Remove the reader from the receivers of the controller messages.
bool DispatchPriv (Message *pMsg) override
 Act on a controller message.
bool Poll ()
 Take the stick position when the stick moved, otherwise move the position by the speed the directional buttons set for the time since the last poll.
void Reset ()
 Centre the position and stop its movement.
bool HandleButton (JoypadInputMsg *pMsg)
 Start or stop the movement of the position for a directional button of the controller.
float GetX () const
float GetY () const
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
virtual bool Dispatch (Message *pMsg)
 Accept a message.
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.
virtual bool Dispatch (Message *msg)
 Handle a message.

Detailed Description

Analogue stick of one controller that bends the notes a player plays.

The RTTI includes the class name and records the MsgSink base. The directional buttons also move the position, at a constant speed while they are held.

Constructor & Destructor Documentation

◆ ExpressionStick()

ExpressionStick::ExpressionStick ( int nPad,
int nStick )

Construct the reader of one stick and add it to the receivers of the controller messages.

Parameters
nPadThe controller.
nStickThe stick.
Ghidra address:
NTSC-U/C: 0x0014e9e8
Ghidra address:
PAL: 0x00150368

◆ ~ExpressionStick()

ExpressionStick::~ExpressionStick ( )
override

Remove the reader from the receivers of the controller messages.

Ghidra address:
NTSC-U/C: 0x0014ea40
Ghidra address:
PAL: 0x001503c0

Member Function Documentation

◆ DispatchPriv()

bool ExpressionStick::DispatchPriv ( Message * pMsg)
overridevirtual

Act on a controller message.

Parameters
pMsgThe message.
Returns
The result of the button handler for a controller button, otherwise false.
Ghidra address:
NTSC-U/C: 0x0014ed88
Ghidra address:
PAL: 0x00150708

Implements MsgSink.

◆ Poll()

bool ExpressionStick::Poll ( )

Take the stick position when the stick moved, otherwise move the position by the speed the directional buttons set for the time since the last poll.

Returns
Whether the stick moved or a directional button moves the position.
Ghidra address:
NTSC-U/C: 0x0014ea98
Ghidra address:
PAL: 0x00150418

◆ Reset()

void ExpressionStick::Reset ( )

Centre the position and stop its movement.

Ghidra address:
NTSC-U/C: 0x0014ec78
Ghidra address:
PAL: 0x001505f8

◆ HandleButton()

bool ExpressionStick::HandleButton ( JoypadInputMsg * pMsg)

Start or stop the movement of the position for a directional button of the controller.

The name is inferred.

Parameters
pMsgThe message.
Returns
False.
Ghidra address:
NTSC-U/C: 0x0014ec90
Ghidra address:
PAL: 0x00150610

◆ GetX()

float ExpressionStick::GetX ( ) const
inline
Returns
The horizontal position, from -1 to 1.

◆ GetY()

float ExpressionStick::GetY ( ) const
inline
Returns
The vertical position, from -1 to 1.

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