|
wavelength 1.0.0
|
Game rules of a remix session. More...
#include <remixlogic.h>


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. | |
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.
| enum RemixLogic::State |
|
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.
| pSong | The song. |
|
override |
Save the remix outside the tutorial and release the rules.
The host of an online session reports an empty score list first.
|
overridevirtual |
Pass a packet of the session to its handler.
| pMsg | The message. |
Implements MsgSink.
|
overridevirtual |
Start the tracks, the players, the background music, and the intro of the song.
A read-only remix starts a preview at once.
Implements WorldLogic.
|
overridevirtual |
Stop the song and the tracks.
Implements WorldLogic.
|
overridevirtual |
Report whether the remix ended.
Implements WorldLogic.
|
overridevirtual |
Report whether a player quit the remix from a menu.
Implements WorldLogic.
|
inlineoverridevirtual |
Report that no restart was requested.
The body returns zero.
Implements WorldLogic.
|
overridevirtual |
Report whether a player plays the freestyle track.
| nPlayer | The player index. |
Implements WorldLogic.
|
overridevirtual |
Report the song position in ticks.
Implements WorldLogic.
|
overridevirtual |
Report the song position on the song clock.
Implements WorldLogic.
|
overridevirtual |
End the tutorial once its script is done, and stop the song once the outro and the fade are done.
Implements WorldLogic.
|
overridevirtual |
Report how much of the song has been played.
Outside a preview the body reports 50.
Implements WorldLogic.
|
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.
| event | The event. |
Implements WorldLogic.
|
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.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pause the song while it plays.
| event | The event. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a button event of command 4.
The body is empty.
| event | The event. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a button event of command 5.
The body is empty.
| event | The event. |
Implements WorldLogic.
|
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.
| event | The event. |
Implements WorldLogic.
|
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.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pass a button event of command 10 to its player while the song plays.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pass a button event of command 8 to its player while the song plays outside a preview.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pass a stick event of command 2 to its player while the song plays.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pass a stick event of command 6 to its player while the song plays.
| event | The event. |
Implements WorldLogic.
|
overridevirtual |
Pause or resume the song.
Pausing opens the pause menu and, outside an online session, stops the song clock.
| bPaused | Pause the song. |
| nPad | The controller that paused the song, or -1. |
| nReason | Non-zero when a disconnected controller paused the song. |
Reimplemented from WorldLogic.
|
inlineoverridevirtual |
Report whether the song is playing.
Implements WorldLogic.
| void RemixLogic::SetLooping | ( | int | nPlayer, |
| bool | bLooping ) |
Turn looping of a player's track on or off.
| nPlayer | The player index. |
| bLooping | Loop the track. |
| void RemixLogic::ClearGems | ( | ) |
Erase the gems of the section at the song position from every pitch track.
| void RemixLogic::EnableMenu | ( | bool | bEnable | ) |
Focus or release the remix menu of the first controller.
| bEnable | Focus the menu. |
| void RemixLogic::OpenTempo | ( | ) |
Open the tempo control.
| void RemixLogic::CloseTempo | ( | ) |
Close the tempo control.
| void RemixLogic::RaiseTempo | ( | ) |
Raise the tempo by one beat per minute.
| void RemixLogic::LowerTempo | ( | ) |
Lower the tempo by one beat per minute.