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

Game rules of a remix session. More...

#include <remixlogic.h>

Inheritance diagram for RemixLogic:
Collaboration diagram for RemixLogic:

Public Types

enum  State {
  kStatePlaying = 0 , kStatePaused = 1 , kStateTutorialEnd = 2 , kStateEnding = 3 ,
  kStateFinished = 4
}
 Values of mState. More...

Public Member Functions

 RemixLogic (Song *pSong)
 Construct the rules for a song.
 ~RemixLogic () override
 Save the remix outside the tutorial and release the rules.
bool DispatchPriv (Message *pMsg) override
 Pass a packet of the session to its handler.
void Start () override
 Start the tracks, the players, the background music, and the intro of the song.
void Stop () override
 Stop the song and the tracks.
bool IsFinished () const override
 Report whether the remix ended.
int HasQuit () const override
 Report whether a player quit the remix from a menu.
int IsRestartRequested () const override
 Report that no restart was requested.
bool IsFreestyling (int nPlayer) override
 Report whether a player plays the freestyle track.
int GetTick () override
 Report the song position in ticks.
float GetTime () override
 Report the song position on the song clock.
void Poll () override
 End the tutorial once its script is done, and stop the song once the outro and the fade are done.
float GetProgress () override
 Report how much of the song has been played.
void HandleInput (const RotateEvent &event) override
 Rotate a player to the next or the previous track while the song plays.
void HandleInput (const PlayNoteEvent &event) override
 Pass a gem button to its player while the song plays.
void HandleInput (const BtnEvent< 3 > &event) override
 Pause the song while it plays.
void HandleInput (const BtnEvent< 4 > &event) override
 Ignore a button event of command 4.
void HandleInput (const BtnEvent< 5 > &event) override
 Ignore a button event of command 5.
void HandleInput (const ChangeSectionEvent &event) override
 Move to the next or the previous playable section.
void HandleInput (const BtnEvent< 9 > &event) override
 Start or stop a preview.
void HandleInput (const BtnEvent< 10 > &event) override
 Pass a button event of command 10 to its player while the song plays.
void HandleInput (const BtnEvent< 8 > &event) override
 Pass a button event of command 8 to its player while the song plays outside a preview.
void HandleInput (const StickEvent< 2 > &event) override
 Pass a stick event of command 2 to its player while the song plays.
void HandleInput (const StickEvent< 6 > &event) override
 Pass a stick event of command 6 to its player while the song plays.
void SetPaused (bool bPaused, int nPad, int nReason) override
 Pause or resume the song.
bool IsPlaying () const override
 Report whether the song is playing.
void SetLooping (int nPlayer, bool bLooping)
 Turn looping of a player's track on or off.
void ClearGems ()
 Erase the gems of the section at the song position from every pitch track.
void EnableMenu (bool bEnable)
 Focus or release the remix menu of the first controller.
void OpenTempo ()
 Open the tempo control.
void CloseTempo ()
 Close the tempo control.
void RaiseTempo ()
 Raise the tempo by one beat per minute.
void LowerTempo ()
 Lower the tempo by one beat per minute.
Public Member Functions inherited from WorldLogic
 WorldLogic ()
 Construct the logic and give the input of every controller to the world.
 ~WorldLogic () override
 Release the logic.
bool DispatchPriv (Message *pMsg) override
 Pass a JoypadConnectionMsg to OnJoypadConnection() and ignore any other message.
void AllNotesOff ()
 Silence every synthesiser channel.
void ScheduleControllerCheck ()
 Pause the song again one tick from now when a controller is disconnected.
int OnJoypadConnection (JoypadConnectionMsg *pMsg)
 Pause the playing song when the controller of a player is disconnected.
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.

Additional Inherited Members

Static Public Member Functions inherited from WorldLogic
static int FindDisconnectedPad ()
 Find the controller of a player on this console that is disconnected.

Detailed Description

Game rules of a remix session.

The RTTI includes the class name and records WorldLogic as the base. The object is 0x1a8 bytes. The vtable overrides every handler WorldLogic declares. The players edit the patterns of the remix tracks while the song loops over one playable section, and a preview plays the whole remix from a bar. The consoles of an online session synchronise through the packets DispatchPriv() receives. Every routine name other than those of the WorldLogic overrides and of the members a remix tutorial calls is inferred.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStatePlaying 

The song plays.

kStatePaused 

The pause menu shows.

kStateTutorialEnd 

The menu at the end of the tutorial shows.

kStateEnding 

The song fades out.

kStateFinished 

The remix ended.

Constructor & Destructor Documentation

◆ RemixLogic()

RemixLogic::RemixLogic ( Song * pSong)
explicit

Construct the rules for a song.

The constructor builds the tracks, the players, and a RemixHUD for each controller, reads a saved remix outside the tutorial, and assigns the players to the tracks. A read-only remix starts no section change.

Parameters
pSongThe song.
Ghidra address:
NTSC-U/C: 0x0012fdb0
Ghidra address:
PAL: 0x001315d8

◆ ~RemixLogic()

RemixLogic::~RemixLogic ( )
override

Save the remix outside the tutorial and release the rules.

The host of an online session reports an empty score list first.

Ghidra address:
NTSC-U/C: 0x00131228
Ghidra address:
PAL: 0x00132a40

Member Function Documentation

◆ DispatchPriv()

bool RemixLogic::DispatchPriv ( Message * pMsg)
overridevirtual

Pass a packet of the session to its handler.

Parameters
pMsgThe message.
Returns
False for a message a handler of this class receives, otherwise the result of WorldLogic::DispatchPriv().
Ghidra address:
NTSC-U/C: 0x00136390
Ghidra address:
PAL: 0x00137ba8

Implements MsgSink.

◆ Start()

void RemixLogic::Start ( )
overridevirtual

Start the tracks, the players, the background music, and the intro of the song.

A read-only remix starts a preview at once.

Ghidra address:
NTSC-U/C: 0x001318c8
Ghidra address:
PAL: 0x001330d8

Implements WorldLogic.

◆ Stop()

void RemixLogic::Stop ( )
overridevirtual

Stop the song and the tracks.

Ghidra address:
NTSC-U/C: 0x00131c08
Ghidra address:
PAL: 0x00133418

Implements WorldLogic.

◆ IsFinished()

bool RemixLogic::IsFinished ( ) const
overridevirtual

Report whether the remix ended.

Returns
Whether mState is kStateFinished.
Ghidra address:
NTSC-U/C: 0x00131f88
Ghidra address:
PAL: 0x00133798

Implements WorldLogic.

◆ HasQuit()

int RemixLogic::HasQuit ( ) const
overridevirtual

Report whether a player quit the remix from a menu.

Returns
mQuit.
Ghidra address:
NTSC-U/C: 0x00131f98
Ghidra address:
PAL: 0x001337a8

Implements WorldLogic.

◆ IsRestartRequested()

int RemixLogic::IsRestartRequested ( ) const
inlineoverridevirtual

Report that no restart was requested.

The body returns zero.

Returns
Zero.
Ghidra address:
NTSC-U/C: 0x0033f070
Ghidra address:
PAL: 0x003ac5a8

Implements WorldLogic.

◆ IsFreestyling()

bool RemixLogic::IsFreestyling ( int nPlayer)
overridevirtual

Report whether a player plays the freestyle track.

Parameters
nPlayerThe player index.
Returns
True while the player plays mFreestyleTrack.
Ghidra address:
NTSC-U/C: 0x00131fa0
Ghidra address:
PAL: 0x001337b0

Implements WorldLogic.

◆ GetTick()

int RemixLogic::GetTick ( )
overridevirtual

Report the song position in ticks.

Returns
The tick of the song clock.
Ghidra address:
NTSC-U/C: 0x00131fe0
Ghidra address:
PAL: 0x001337f0

Implements WorldLogic.

◆ GetTime()

float RemixLogic::GetTime ( )
overridevirtual

Report the song position on the song clock.

Returns
The time of the song clock.
Ghidra address:
NTSC-U/C: 0x00132000
Ghidra address:
PAL: 0x00133810

Implements WorldLogic.

◆ Poll()

void RemixLogic::Poll ( )
overridevirtual

End the tutorial once its script is done, and stop the song once the outro and the fade are done.

Ghidra address:
NTSC-U/C: 0x00131e98
Ghidra address:
PAL: 0x001336a8

Implements WorldLogic.

◆ GetProgress()

float RemixLogic::GetProgress ( )
overridevirtual

Report how much of the song has been played.

Outside a preview the body reports 50.

Returns
During a preview, the song position past mLoopBar as a fraction of the song length, otherwise 50.
Ghidra address:
NTSC-U/C: 0x00132020
Ghidra address:
PAL: 0x00133830

Implements WorldLogic.

◆ HandleInput() [1/11]

void RemixLogic::HandleInput ( const RotateEvent & event)
overridevirtual

Rotate a player to the next or the previous track while the song plays.

A player on the freestyle track does not rotate, and a preview ignores the rotation.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00132bd8
Ghidra address:
PAL: 0x001343e8

Implements WorldLogic.

◆ HandleInput() [2/11]

void RemixLogic::HandleInput ( const PlayNoteEvent & event)
overridevirtual

Pass a gem button to its player while the song plays.

In an online session only a player whose track the arbitration confirms plays the note.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00132cf8
Ghidra address:
PAL: 0x00134508

Implements WorldLogic.

◆ HandleInput() [3/11]

void RemixLogic::HandleInput ( const BtnEvent< 3 > & event)
overridevirtual

Pause the song while it plays.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00132ee0
Ghidra address:
PAL: 0x001346f0

Implements WorldLogic.

◆ HandleInput() [4/11]

void RemixLogic::HandleInput ( const BtnEvent< 4 > & event)
inlineoverridevirtual

Ignore a button event of command 4.

The body is empty.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0033f078
Ghidra address:
PAL: 0x003ac5b0

Implements WorldLogic.

◆ HandleInput() [5/11]

void RemixLogic::HandleInput ( const BtnEvent< 5 > & event)
inlineoverridevirtual

Ignore a button event of command 5.

The body is empty.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0033f080
Ghidra address:
PAL: 0x003ac5b8

Implements WorldLogic.

◆ HandleInput() [6/11]

void RemixLogic::HandleInput ( const ChangeSectionEvent & event)
overridevirtual

Move to the next or the previous playable section.

A guest of an online session sends a request to the chat of the session instead.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00132f50
Ghidra address:
PAL: 0x00134760

Implements WorldLogic.

◆ HandleInput() [7/11]

void RemixLogic::HandleInput ( const BtnEvent< 9 > & event)
overridevirtual

Start or stop a preview.

A read-only remix ignores the event, and a guest of an online session sends a request to the chat of the session instead.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x001331d8
Ghidra address:
PAL: 0x001349e8

Implements WorldLogic.

◆ HandleInput() [8/11]

void RemixLogic::HandleInput ( const BtnEvent< 10 > & event)
overridevirtual

Pass a button event of command 10 to its player while the song plays.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x001333d0
Ghidra address:
PAL: 0x00134be0

Implements WorldLogic.

◆ HandleInput() [9/11]

void RemixLogic::HandleInput ( const BtnEvent< 8 > & event)
overridevirtual

Pass a button event of command 8 to its player while the song plays outside a preview.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00132e50
Ghidra address:
PAL: 0x00134660

Implements WorldLogic.

◆ HandleInput() [10/11]

void RemixLogic::HandleInput ( const StickEvent< 2 > & event)
overridevirtual

Pass a stick event of command 2 to its player while the song plays.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00133330
Ghidra address:
PAL: 0x00134b40

Implements WorldLogic.

◆ HandleInput() [11/11]

void RemixLogic::HandleInput ( const StickEvent< 6 > & event)
overridevirtual

Pass a stick event of command 6 to its player while the song plays.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x00133380
Ghidra address:
PAL: 0x00134b90

Implements WorldLogic.

◆ SetPaused()

void RemixLogic::SetPaused ( bool bPaused,
int nPad,
int nReason )
overridevirtual

Pause or resume the song.

Pausing opens the pause menu and, outside an online session, stops the song clock.

Parameters
bPausedPause the song.
nPadThe controller that paused the song, or -1.
nReasonNon-zero when a disconnected controller paused the song.
Ghidra address:
NTSC-U/C: 0x00132090
Ghidra address:
PAL: 0x001338a0

Reimplemented from WorldLogic.

◆ IsPlaying()

bool RemixLogic::IsPlaying ( ) const
inlineoverridevirtual

Report whether the song is playing.

Returns
Whether mState is kStatePlaying.
Ghidra address:
NTSC-U/C: 0x0033f088
Ghidra address:
PAL: 0x003ac5c0

Implements WorldLogic.

◆ SetLooping()

void RemixLogic::SetLooping ( int nPlayer,
bool bLooping )

Turn looping of a player's track on or off.

Parameters
nPlayerThe player index.
bLoopingLoop the track.
Ghidra address:
NTSC-U/C: 0x00134ca0
Ghidra address:
PAL: 0x001364b0

◆ ClearGems()

void RemixLogic::ClearGems ( )

Erase the gems of the section at the song position from every pitch track.

Ghidra address:
NTSC-U/C: 0x00135510
Ghidra address:
PAL: 0x00136d10

◆ EnableMenu()

void RemixLogic::EnableMenu ( bool bEnable)

Focus or release the remix menu of the first controller.

Parameters
bEnableFocus the menu.
Ghidra address:
NTSC-U/C: 0x001355c0
Ghidra address:
PAL: 0x00136dc0

◆ OpenTempo()

void RemixLogic::OpenTempo ( )

Open the tempo control.

Ghidra address:
NTSC-U/C: 0x001355e0
Ghidra address:
PAL: 0x00136de0

◆ CloseTempo()

void RemixLogic::CloseTempo ( )

Close the tempo control.

Ghidra address:
NTSC-U/C: 0x00135600
Ghidra address:
PAL: 0x00136e00

◆ RaiseTempo()

void RemixLogic::RaiseTempo ( )

Raise the tempo by one beat per minute.

Ghidra address:
NTSC-U/C: 0x00135620
Ghidra address:
PAL: 0x00136e20

◆ LowerTempo()

void RemixLogic::LowerTempo ( )

Lower the tempo by one beat per minute.

Ghidra address:
NTSC-U/C: 0x00135648
Ghidra address:
PAL: 0x00136e48

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