Etterna 0.74.4
Loading...
Searching...
No Matches
SongOptions.h
1/* SongOptions - Options that apply to an entire song (not per-player). */
2
3#ifndef SONG_OPTIONS_H
4#define SONG_OPTIONS_H
5
6#include "Etterna/Models/Misc/EnumHelper.h"
7
8enum AutosyncType
9{
10 AutosyncType_Off,
11 AutosyncType_Song,
12 AutosyncType_Machine,
13 NUM_AutosyncType,
14 AutosyncType_Invalid
15};
16auto
17AutosyncTypeToString(AutosyncType cat) -> const std::string&;
18auto
19AutosyncTypeToLocalizedString(AutosyncType cat) -> const std::string&;
20LuaDeclareType(AutosyncType);
21
22enum SoundEffectType
23{
24 SoundEffectType_Off,
25 SoundEffectType_Speed,
26 SoundEffectType_Pitch,
27 NUM_SoundEffectType,
28 SoundEffectType_Invalid
29};
30auto
31SoundEffectTypeToString(SoundEffectType cat) -> const std::string&;
32auto
33SoundEffectTypeToLocalizedString(SoundEffectType cat) -> const std::string&;
34LuaDeclareType(SoundEffectType);
35
37{
38 public:
39 bool m_bAssistClap{ false };
40 bool m_bAssistMetronome{ false };
41 float m_fMusicRate{ 1.0F }, m_SpeedfMusicRate{ 1.0F };
42 AutosyncType m_AutosyncType{ AutosyncType_Off };
43 SoundEffectType m_SoundEffectType{ SoundEffectType_Off };
44 bool m_bStaticBackground{ false };
45 bool m_bRandomBGOnly{ false };
46 bool m_bSaveScore{ true };
47
53 SongOptions() = default;
54 void Init();
55 void Approach(const SongOptions& other, float fDeltaSeconds);
56 void GetMods(std::vector<std::string>& AddTo) const;
57 void GetLocalizedMods(std::vector<std::string>& AddTo) const;
58 [[nodiscard]] auto GetString() const -> std::string;
59 [[nodiscard]] auto GetLocalizedString() const -> std::string;
60 void FromString(const std::string& sOptions);
61 auto FromOneModString(const std::string& sOneMod,
62 std::string& sErrorDetailOut)
63 -> bool; // On error, return
64 // false and optionally
65 // set sErrorDetailOut
66
67 auto operator==(const SongOptions& other) const -> bool;
68 auto operator!=(const SongOptions& other) const -> bool
69 {
70 return !operator==(other);
71 }
72
73 // Lua
74 void PushSelf(lua_State* L);
75};
76
77#endif
Definition SongOptions.h:37
SongOptions()=default
Set up the SongOptions with reasonable defaults.