Etterna 0.74.4
Loading...
Searching...
No Matches
BPMDisplay.h
1#ifndef BPM_DISPLAY_H
2#define BPM_DISPLAY_H
3
4#include "Etterna/Actor/Base/BitmapText.h"
5#include "Etterna/Models/Misc/ThemeMetric.h"
6class Song;
7class Steps;
8struct DisplayBpms;
9
11class BPMDisplay : public BitmapText
12{
13 public:
15 BPMDisplay();
17 BPMDisplay* Copy() const override;
19 void Load();
24 void Update(float fDeltaTime) override;
25 void LoadFromNode(const XNode* pNode) override;
30 void SetBpmFromSong(const Song* pSong, bool bIgnoreCurrentRate = false);
35 void SetBpmFromSteps(const Steps* pSteps, bool bIgnoreCurrentRate = false);
40 void SetConstantBpm(float fBPM);
44 void CycleRandomly();
46 void NoBPM();
48 void SetVarious();
50 void SetFromGameState();
51
52 // Lua
53 void PushSelf(lua_State* L) override;
54
55 protected:
60 float GetActiveBPM() const;
65 void SetBPMRange(const DisplayBpms& bpms);
66
97
101 float m_fBPMTo;
105 std::vector<float> m_BPMS;
106 float m_fPercentInState;
109};
110
111#endif
Displays a BPM or a range of BPMs.
Definition BPMDisplay.h:12
void NoBPM()
Don't use a BPM at all.
Definition BPMDisplay.cpp:170
ThemeMetric< apActorCommands > SET_CHANGING_COMMAND
The commands to use when the BPM can change between 2 or more values.
Definition BPMDisplay.h:73
ThemeMetric< apActorCommands > SET_NO_BPM_COMMAND
The commands to use when there is no BPM.
Definition BPMDisplay.h:68
void CycleRandomly()
Have the BPMDisplay cycle between various BPMs.
Definition BPMDisplay.cpp:154
std::vector< float > m_BPMS
The list of BPMs.
Definition BPMDisplay.h:105
void SetBpmFromSteps(const Steps *pSteps, bool bIgnoreCurrentRate=false)
Use the BPM[s] from a steps.
Definition BPMDisplay.cpp:199
ThemeMetric< apActorCommands > SET_RANDOM_COMMAND
The commands to use when the BPM is random.
Definition BPMDisplay.h:75
int m_iCurrentBPM
The current BPM index used.
Definition BPMDisplay.h:103
ThemeMetric< std::string > RANDOM_TEXT
The text used when it is a random BPM.
Definition BPMDisplay.h:92
void SetBPMRange(const DisplayBpms &bpms)
Set the range to be used for the display.
Definition BPMDisplay.cpp:103
BPMDisplay()
Set up the BPM Display with default values.
Definition BPMDisplay.cpp:17
float m_fCycleTime
How long it takes to cycle the various BPMs.
Definition BPMDisplay.h:108
ThemeMetric< apActorCommands > SET_EXTRA_COMMAND
The commands to use if it is an extra stage.
Definition BPMDisplay.h:77
void SetFromGameState()
Have the GameState determine which BPMs to display.
Definition BPMDisplay.cpp:236
ThemeMetric< apActorCommands > SET_NORMAL_COMMAND
The commands to use when there is a normal BPM.
Definition BPMDisplay.h:70
ThemeMetric< std::string > BPM_FORMAT_STRING
The format string used for the numbers.
Definition BPMDisplay.h:96
ThemeMetric< bool > SHOW_QMARKS
A flag to determine if QUESTIONMARKS_TEXT is shown.
Definition BPMDisplay.h:82
ThemeMetric< float > RANDOM_CYCLE_SPEED
How often the random BPMs cycle themselves.
Definition BPMDisplay.h:84
float GetActiveBPM() const
Retrieve the active BPM on display.
Definition BPMDisplay.cpp:55
void SetConstantBpm(float fBPM)
Use a specified, constant BPM.
Definition BPMDisplay.cpp:220
ThemeMetric< std::string > VARIOUS_TEXT
The text used when there are various BPMs for the song.
Definition BPMDisplay.h:90
float m_fBPMFrom
The lowest valued BPM.
Definition BPMDisplay.h:99
void SetBpmFromSong(const Song *pSong, bool bIgnoreCurrentRate=false)
Use the BPM[s] from a song.
Definition BPMDisplay.cpp:178
ThemeMetric< std::string > SEPARATOR
The text used to separate the low and high BPMs.
Definition BPMDisplay.h:86
float m_fBPMTo
The highest valued BPM.
Definition BPMDisplay.h:101
void Update(float fDeltaTime) override
Update the display as required.
Definition BPMDisplay.cpp:61
ThemeMetric< std::string > QUESTIONMARKS_TEXT
The text used as one possible option for random BPM.
Definition BPMDisplay.h:94
void Load()
Load the various metrics needed.
Definition BPMDisplay.cpp:27
BPMDisplay * Copy() const override
Copy the BPMDisplay to another.
ThemeMetric< bool > CYCLE
A flag to determine if the BPMs cycle from low to high or just display both.
Definition BPMDisplay.h:80
ThemeMetric< std::string > NO_BPM_TEXT
The text used when there is no BPM.
Definition BPMDisplay.h:88
void SetVarious()
Have the BPMDisplay use various BPMs.
Definition BPMDisplay.cpp:228
An actor that holds a Font and draws text to the screen.
Definition BitmapText.h:11
Holds all music metadata and steps for one song.
Definition Song.h:65
Holds note information for a Song.
Definition Steps.h:42
The theme specific data.
Definition ThemeMetric.h:52
Definition XmlFile.h:95
The list of BPMs to display.
Definition GameConstantsAndTypes.h:402