wavelength 1.0.0
Loading...
Searching...
No Matches
songpreview.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include "os/string.h"
7
19public:
28
40 static void Stop(float fFadeStep);
41
49 static void End(bool bRestoreMusic);
50
58 static bool IsWaiting();
59
74 static void Load(const char *pszSong, bool bMetaClip);
75
82 static void FadeOut();
83
91 static bool IsIdle();
92
100 static bool IsPlaying();
101
108 static void Poll();
109
110#ifdef VIDEO_STANDARD_PAL
121 static const char *BonusEncrypt();
122
133 static const char *LevelEncrypt();
134#else
140 static const char *sLevelEncrypt;
141
147 static const char *sBonusEncrypt;
148#endif
149
150private:
158 static void OnMenuRestored(int nArg);
159
167 static void OnClipReady(int nArg);
168
175 static int sState;
176
183 static std::unique_ptr<StreamPlayer> sPlayer;
184
191 static float sVolume;
192
199 static float sFadeRate;
200
207 static float sFadeStep;
208
215 static int sRestoreMusic;
216
222 static String sClip;
223};
The streamed clip of a song that plays while the song screen shows the song.
Definition songpreview.h:18
static void End(bool bRestoreMusic)
Fade out the clip, forget the clip to play, and enter kStateEnding.
static void Stop(float fFadeStep)
Mute the menu music and prepare the sound output for clips.
static bool IsWaiting()
Report whether the clip is in kStateReady.
static void Load(const char *pszSong, bool bMetaClip)
Choose the clip of a song and fade out the clip that plays.
static void Poll()
Advance the clip, fading its volume and starting or stopping its stream as requested.
static const char * sLevelEncrypt
The stream that stands in for the clip of a locked song.
Definition songpreview.h:140
static bool IsIdle()
Report whether no clip plays and none is chosen.
State
The states of the clip, the values of sState.
Definition songpreview.h:21
@ kStateReady
Definition songpreview.h:23
@ kStateMenu
Definition songpreview.h:26
@ kStateStarting
Definition songpreview.h:22
@ kStateEnding
Definition songpreview.h:24
@ kStateRestoring
Definition songpreview.h:25
static bool IsPlaying()
Report whether the clip is in kStateMenu, the state before Stop().
static const char * sBonusEncrypt
The stream that stands in for the clip of a locked bonus song.
Definition songpreview.h:147
static void FadeOut()
Start fading the clip out.
Growable text buffer that is also a PrnStream.
Definition string.h:19