wavelength 1.0.0
Loading...
Searching...
No Matches
jukeboxscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "met/freqscreen.h"
8#include "script/dataarray.h"
11#include "ui/uiscreen.h"
12
21class JukeboxScreen : public FreqScreen {
22public:
30 explicit JukeboxScreen(DataArray *pData) : FreqScreen(pData), mShowAllSongs(0) {
31 }
32
39 ~JukeboxScreen() override {
40 }
41
50 static UIScreen *New(DataArray *pData) {
51 return new JukeboxScreen(pData);
52 }
53
62 bool DispatchPriv(Message *pMsg) override;
63
72 void Exit(UIScreen *pNextScreen, float fTime) override;
73
82 void Enter(UIScreen *pPrevScreen, float fTime) override;
83
85 int GetShowAllSongs() const {
86 return mShowAllSongs;
87 }
88
90 void SetShowAllSongs(int nShowAllSongs) {
91 mShowAllSongs = nShowAllSongs;
92 }
93
94private:
106 bool HandleSelect(UIComponentSelectMsg *pMsg);
107
118 bool HandleSelectStart(UIComponentSelectStartMsg *pMsg);
119
130 bool HandleJoypad(JoypadInputMsg *pMsg);
131
132 std::vector<PlaylistSongData> mPlaylist;
133 int mShowAllSongs;
134};
Reference-counted array of script data nodes.
Definition dataarray.h:20
FreqScreen(DataArray *pData)
Construct a screen from its script description.
Message the controller poll sends when a button is pressed or released.
Definition joypadinputmsg.h:23
int GetShowAllSongs() const
Definition jukeboxscreen.h:85
bool DispatchPriv(Message *pMsg) override
Route the choices and the controller to their handlers.
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition jukeboxscreen.h:50
void Exit(UIScreen *pNextScreen, float fTime) override
Exit.
void SetShowAllSongs(int nShowAllSongs)
Definition jukeboxscreen.h:90
void Enter(UIScreen *pPrevScreen, float fTime) override
Enter and list the songs, or keep the playlist when the playback returns.
~JukeboxScreen() override
Destroy the screen.
Definition jukeboxscreen.h:39
JukeboxScreen(DataArray *pData)
Construct the screen from its script description, with an empty playlist.
Definition jukeboxscreen.h:30
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Message a component sends when the player chooses it.
Definition uicomponentselectmsg.h:28
Message a component sends when the player presses the button that chooses it.
Definition uicomponentselectstartmsg.h:27
UIScreen(DataArray *pData)
Construct a screen from its script description.