wavelength 1.0.0
Loading...
Searching...
No Matches
redbookplaybackscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "met/freqscreen.h"
7#include "os/string.h"
8#include "script/dataarray.h"
9#include "ui/uiscreen.h"
10
20public:
29
37 }
38
47 static UIScreen *New(DataArray *pData) {
48 return new RedbookPlaybackScreen(pData);
49 }
50
59 bool DispatchPriv(Message *pMsg) override;
60
69 void Poll(float fTime) override;
70
79 void Enter(UIScreen *pPrevScreen, float fTime) override;
80
89 void ClearSongs();
90
100 void AddSong(const char *pszSong);
101
103 void SetShuffle(int nShuffle) {
104 mShuffle = nShuffle;
105 }
106
107private:
116 void StopPlayback();
117
126 void PickSong();
127
138 bool HandleJoypad(JoypadInputMsg *pMsg);
139
140 int mShuffle;
141
142 std::list<const char *> mSongsLeft; // The songs not yet played in this round.
143
144 std::list<const char *> mSongs; // The songs of the playlist.
145
146 int mPlaying; // Whether songs are picked and played.
147
148 int mStopping; // Whether the playback stops.
149
150 String mNextSong; // The song to load next, or empty.
151};
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
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
void AddSong(const char *pszSong)
Add a song to the songs to play.
RedbookPlaybackScreen(DataArray *pData)
Construct the screen from its script description, with no songs.
void Poll(float fTime) override
Pick and load the next song once the previous one has finished, or leave once the playback has stoppe...
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition redbookplaybackscreen.h:47
void ClearSongs()
Forget the songs.
void Enter(UIScreen *pPrevScreen, float fTime) override
Enter, show the help of the playback, and fade out the menu music.
~RedbookPlaybackScreen() override
Destroy the screen.
Definition redbookplaybackscreen.h:36
bool DispatchPriv(Message *pMsg) override
Route the controller to HandleJoypad().
void SetShuffle(int nShuffle)
Definition redbookplaybackscreen.h:103
Growable text buffer that is also a PrnStream.
Definition string.h:19
UIScreen(DataArray *pData)
Construct a screen from its script description.