wavelength 1.0.0
Loading...
Searching...
No Matches
remixhud.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "app/msgsink.h"
6#include "gfx/gfxmanager.h"
8#include "msg/message.h"
9#include "os/command.h"
10#include "os/ptr.h"
11
20class RemixHUD : public MsgSink {
21public:
34
36 static constexpr int kModeMute = 4;
37
58
66 using Callback = void (*)(int nPlayer, int nEvent, void *pData);
67
76 RemixHUD(int nPlayer, const char *pszEffectLabel);
77
84 ~RemixHUD() override;
85
95 void SetActive(int nActive);
96
104 void SetChorus(int nOn);
105
113 void SetStutter(int nOn);
114
122 void SetEffect(int nOn);
123
134 void SetTempo(float fTempo, int nDimmed);
135
143 void SetLoop(int nOn);
144
152 void SetMute(int nOn);
153
163 void SetSolo(int nOn);
164
172 void SetMode(int nMode);
173
181 void RemovePeer(int nPeer);
182
191 void SetCallback(Callback pfnCallback, void *pData);
192
200 void OpenTempo();
201
209
217 void SetFocused(int nFocused);
218
227 bool DispatchPriv(Message *pMsg) override;
228
229private:
237 void SelectPanel(int nIndex);
238
246 void SelectEntry(int nEntry);
247
256 void OpenPanel(int nIndex, bool bOpen);
257
265 bool ConfirmEntry();
266
276 void SetPeerIndex(int nIndex);
277
287 void AddPanel(int nType, const char *pszLabel, int nPostLabel);
288
295 void AddChorusPanel();
296
303 void AddSoloPanel();
304
311 void AddLoopPanel();
312
319 void AddStutterPanel();
320
328 void AddEffectPanel(const char *pszLabel);
329
336 void AddMutePanel();
337
344 void AddTempoPanel();
345
352 void AddBootPanel();
353
363 void PostPanelText(int nIndex, const char *pszText, GfxManager::RemixSubPanel ePanel);
364
373 void Navigate(bool bUp, bool bRepeat);
374
382 bool Confirm();
383
392 bool HandleJoypad(JoypadInputMsg *pMsg);
393
394 int mPlayer;
395 int mActive;
396 int mFocused;
397 int mLoopOn;
398 int mMuteOn;
399 int mSoloOn;
400 int mChorusOn;
401 int mStutterOn;
402 int mEffectOn;
403 int mMode;
404 std::vector<int> mPeers;
405 int mPeerIndex;
406 int mPanel;
407 int mEntry;
408 std::vector<int> mPanelTypes;
409 std::vector<int> mPanelOfType;
410 std::vector<GfxManager::RemixSubPanel> mSubPanels;
411 std::vector<int> mEntryCounts;
412 Ptr<Command> mRepeatUpCmd;
413 Ptr<Command> mRepeatDownCmd;
414 Callback mCallback;
415 void *mCallbackData;
416};
RemixSubPanel
Sub-panel of a player's remix menu.
Definition gfxmanager.h:90
Message the controller poll sends when a button is pressed or released.
Definition joypadinputmsg.h:23
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Receiver of engine messages.
Definition msgsink.h:21
Owner of one reference to an Attachment.
Definition ptr.h:16
PanelType
Kind of a panel.
Definition remixhud.h:23
@ kPanelChorus
Definition remixhud.h:26
@ kPanelLoop
Definition remixhud.h:24
@ kPanelSolo
Definition remixhud.h:29
@ kPanelEffect
Definition remixhud.h:28
@ kNumPanelTypes
Definition remixhud.h:32
@ kPanelTempo
Definition remixhud.h:30
@ kPanelStutter
Definition remixhud.h:27
@ kPanelBoot
Definition remixhud.h:31
@ kPanelMute
Definition remixhud.h:25
void SetLoop(int nOn)
Show whether loop is on.
void SetChorus(int nOn)
Show whether chorus is on.
~RemixHUD() override
Release the controller when the menu has it.
void(*)(int nPlayer, int nEvent, void *pData) Callback
Receiver of the player's choices.
Definition remixhud.h:66
void SetEffect(int nOn)
Show whether the constructor's effect is on.
bool DispatchPriv(Message *pMsg) override
Act on a press of the player's controller.
static constexpr int kModeMute
Value of SetMode() under which the mute panel can be chosen.
Definition remixhud.h:36
void OpenTempo()
Open the panel at index 1, the tempo panel when the menu has one, unless the tempo control is already...
void SetTempo(float fTempo, int nDimmed)
Show the tempo on the tempo panel and in the tempo control.
void SetFocused(int nFocused)
Give the controller to the menu or take it away.
void SetMute(int nOn)
Record whether mute is on, shown only in kModeMute.
RemixHUD(int nPlayer, const char *pszEffectLabel)
Construct the menu of a player and add its panels.
void RemovePeer(int nPeer)
Remove a player from the players the host can remove.
void SetStutter(int nOn)
Show whether stutter is on.
void SetActive(int nActive)
Activate or deactivate the menu.
void CloseTempo()
Close the tempo control when it is open.
Event
What the player chose, as the callback receives it.
Definition remixhud.h:39
@ kEventTempoOpened
Definition remixhud.h:55
@ kEventStutterOn
Definition remixhud.h:47
@ kEventNone
Definition remixhud.h:40
@ kEventMuteOn
Definition remixhud.h:41
@ kEventTempoDown
Definition remixhud.h:54
@ kEventMuteOff
Definition remixhud.h:42
@ kEventBootFirst
Definition remixhud.h:56
@ kEventLoopOff
Definition remixhud.h:44
@ kEventTempoUp
Definition remixhud.h:53
@ kEventEffectOn
Definition remixhud.h:49
@ kEventStutterOff
Definition remixhud.h:48
@ kEventSoloOff
Definition remixhud.h:52
@ kEventLoopOn
Definition remixhud.h:43
@ kEventChorusOff
Definition remixhud.h:46
@ kEventChorusOn
Definition remixhud.h:45
@ kEventSoloOn
Definition remixhud.h:51
@ kEventEffectOff
Definition remixhud.h:50
void SetSolo(int nOn)
Show whether solo is on.
void SetCallback(Callback pfnCallback, void *pData)
Set the receiver of the player's choices.
void SetMode(int nMode)
Set the mode of the player's track.