|
wavelength 1.0.0
|
Remix menu of one player during a song, a list of panels that switch effects on and off. More...
#include <remixhud.h>


Public Types | |
| enum | PanelType { kPanelLoop = 0 , kPanelMute = 1 , kPanelChorus = 2 , kPanelStutter = 3 , kPanelEffect = 4 , kPanelSolo = 5 , kPanelTempo = 6 , kPanelBoot = 7 , kNumPanelTypes = 8 } |
| Kind of a panel. More... | |
| enum | Event { kEventNone = 0 , kEventMuteOn = 1 , kEventMuteOff = 2 , kEventLoopOn = 3 , kEventLoopOff = 4 , kEventChorusOn = 5 , kEventChorusOff = 6 , kEventStutterOn = 7 , kEventStutterOff = 8 , kEventEffectOn = 9 , kEventEffectOff = 10 , kEventSoloOn = 11 , kEventSoloOff = 12 , kEventTempoUp = 13 , kEventTempoDown = 14 , kEventTempoOpened = 15 , kEventBootFirst = 16 } |
| What the player chose, as the callback receives it. More... | |
| using | Callback = void (*)(int nPlayer, int nEvent, void *pData) |
| Receiver of the player's choices. | |
Public Member Functions | |
| RemixHUD (int nPlayer, const char *pszEffectLabel) | |
| Construct the menu of a player and add its panels. | |
| ~RemixHUD () override | |
| Release the controller when the menu has it. | |
| void | SetActive (int nActive) |
| Activate or deactivate the menu. | |
| void | SetChorus (int nOn) |
| Show whether chorus is on. | |
| void | SetStutter (int nOn) |
| Show whether stutter is on. | |
| void | SetEffect (int nOn) |
| Show whether the constructor's effect is on. | |
| void | SetTempo (float fTempo, int nDimmed) |
| Show the tempo on the tempo panel and in the tempo control. | |
| void | SetLoop (int nOn) |
| Show whether loop is on. | |
| void | SetMute (int nOn) |
| Record whether mute is on, shown only in kModeMute. | |
| void | SetSolo (int nOn) |
| Show whether solo is on. | |
| void | SetMode (int nMode) |
| Set the mode of the player's track. | |
| void | RemovePeer (int nPeer) |
| Remove a player from the players the host can remove. | |
| void | SetCallback (Callback pfnCallback, void *pData) |
| Set the receiver of the player's choices. | |
| void | OpenTempo () |
| Open the panel at index 1, the tempo panel when the menu has one, unless the tempo control is already open with an entry chosen. | |
| void | CloseTempo () |
| Close the tempo control when it is open. | |
| void | SetFocused (int nFocused) |
| Give the controller to the menu or take it away. | |
| bool | DispatchPriv (Message *pMsg) override |
| Act on a press of the player's controller. | |
| 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. | |
Static Public Attributes | |
| static constexpr int | kModeMute = 4 |
| Value of SetMode() under which the mute panel can be chosen. | |
Remix menu of one player during a song, a list of panels that switch effects on and off.
The RTTI records MsgSink as the one base and the nested RemixHUD::Panel. The session builds one for each player. The menu takes the player's controller while it is both active and focused, draws itself through the remix sub-panels of TheGfxManager, and reports what the player chose through a callback.
| using RemixHUD::Callback = void (*)(int nPlayer, int nEvent, void *pData) |
Receiver of the player's choices.
| nPlayer | The player's index. |
| nEvent | One of Event. |
| pData | The data SetCallback() received. |
| enum RemixHUD::PanelType |
Kind of a panel.
A kind also indexes mPanelOfType.
| enum RemixHUD::Event |
What the player chose, as the callback receives it.
| Enumerator | |
|---|---|
| kEventNone | A panel with nothing to switch. |
| kEventMuteOn | Mute, chosen while off. |
| kEventMuteOff | Mute, chosen while on. |
| kEventLoopOn | Loop, chosen while off. |
| kEventLoopOff | Loop, chosen while on. |
| kEventChorusOn | Chorus, chosen while off. |
| kEventChorusOff | Chorus, chosen while on. |
| kEventStutterOn | Stutter, chosen while off. |
| kEventStutterOff | Stutter, chosen while on. |
| kEventEffectOn | The constructor's effect, chosen while off. |
| kEventEffectOff | The constructor's effect, chosen while on. |
| kEventSoloOn | Solo, chosen while off. |
| kEventSoloOff | Solo, chosen while on. |
| kEventTempoUp | Up in the tempo control. |
| kEventTempoDown | Down in the tempo control. |
| kEventTempoOpened | The tempo control opened. |
| kEventBootFirst | Removal of player 0. Player n adds n. |
| RemixHUD::RemixHUD | ( | int | nPlayer, |
| const char * | pszEffectLabel ) |
Construct the menu of a player and add its panels.
| nPlayer | The player's index. |
| pszEffectLabel | The label of the kPanelEffect panel. |
|
override |
Release the controller when the menu has it.
| void RemixHUD::SetActive | ( | int | nActive | ) |
Activate or deactivate the menu.
Deactivation closes an open sub-panel and removes the cursor.
| nActive | Non-zero to activate. |
| void RemixHUD::SetChorus | ( | int | nOn | ) |
Show whether chorus is on.
| nOn | Non-zero when on. |
| void RemixHUD::SetStutter | ( | int | nOn | ) |
Show whether stutter is on.
| nOn | Non-zero when on. |
| void RemixHUD::SetEffect | ( | int | nOn | ) |
Show whether the constructor's effect is on.
| nOn | Non-zero when on. |
| void RemixHUD::SetTempo | ( | float | fTempo, |
| int | nDimmed ) |
Show the tempo on the tempo panel and in the tempo control.
A menu with no tempo panel ignores the call.
| fTempo | The tempo, truncated for display. |
| nDimmed | Non-zero to show the tempo panel unlit. |
| void RemixHUD::SetLoop | ( | int | nOn | ) |
Show whether loop is on.
| nOn | Non-zero when on. |
| void RemixHUD::SetMute | ( | int | nOn | ) |
Record whether mute is on, shown only in kModeMute.
| nOn | Non-zero when on. |
| void RemixHUD::SetSolo | ( | int | nOn | ) |
Show whether solo is on.
A menu with no solo panel ignores the call.
| nOn | Non-zero when on. |
| void RemixHUD::SetMode | ( | int | nMode | ) |
Set the mode of the player's track.
The mode decides whether the mute panel can be chosen.
| nMode | The mode. kModeMute labels and enables the mute panel. |
| void RemixHUD::RemovePeer | ( | int | nPeer | ) |
Remove a player from the players the host can remove.
| nPeer | The player's index. |
| void RemixHUD::SetCallback | ( | Callback | pfnCallback, |
| void * | pData ) |
Set the receiver of the player's choices.
| pfnCallback | The receiver. |
| pData | The data the receiver receives. |
| void RemixHUD::OpenTempo | ( | ) |
Open the panel at index 1, the tempo panel when the menu has one, unless the tempo control is already open with an entry chosen.
| void RemixHUD::CloseTempo | ( | ) |
Close the tempo control when it is open.
| void RemixHUD::SetFocused | ( | int | nFocused | ) |
Give the controller to the menu or take it away.
The change matters only while active.
| nFocused | Non-zero to give the controller. |
|
overridevirtual |
Act on a press of the player's controller.
| pMsg | The message. |
Implements MsgSink.
|
staticconstexpr |
Value of SetMode() under which the mute panel can be chosen.