summaryrefslogtreecommitdiff
path: root/src/common/settings_common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/settings_common.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/common/settings_common.h b/src/common/settings_common.h
index ad005ca4e..6b717deb1 100644
--- a/src/common/settings_common.h
+++ b/src/common/settings_common.h
@@ -43,15 +43,21 @@ enum class Category : u32 {
43 MaxEnum, 43 MaxEnum,
44}; 44};
45 45
46enum class Specialization : u32 { 46constexpr u8 SpecializationTypeMask = 0xf;
47 Default, 47constexpr u8 SpecializationAttributeMask = 0xf0;
48 Time, 48constexpr u8 SpecializationAttributeOffset = 4;
49 Hex, 49
50 List, 50enum Specialization : u8 {
51 RuntimeList, 51 Default = 0,
52 Scalar, 52 Time = 1,
53 Countable, 53 Hex = 2,
54 Paired, 54 List = 3,
55 RuntimeList = 4,
56 Scalar = 5,
57 Countable = 6,
58 Paired = 7,
59
60 Percentage = (1 << SpecializationAttributeOffset),
55}; 61};
56 62
57bool IsConfiguringGlobal(); 63bool IsConfiguringGlobal();
@@ -75,7 +81,7 @@ public:
75class BasicSetting { 81class BasicSetting {
76protected: 82protected:
77 explicit BasicSetting(Linkage& linkage, const std::string& name, enum Category category_, 83 explicit BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
78 bool save_, bool runtime_modifiable_, Specialization spec, 84 bool save_, bool runtime_modifiable_, u32 specialization,
79 BasicSetting* other_setting); 85 BasicSetting* other_setting);
80 86
81public: 87public:
@@ -195,7 +201,7 @@ public:
195 /** 201 /**
196 * @returns Extra metadata for data representation in frontend implementations. 202 * @returns Extra metadata for data representation in frontend implementations.
197 */ 203 */
198 [[nodiscard]] enum Specialization Specialization() const; 204 [[nodiscard]] u32 Specialization() const;
199 205
200 /** 206 /**
201 * @returns Another BasicSetting if one is paired, or nullptr otherwise. 207 * @returns Another BasicSetting if one is paired, or nullptr otherwise.
@@ -240,9 +246,8 @@ private:
240 const u32 id; ///< Unique integer for the setting 246 const u32 id; ///< Unique integer for the setting
241 const bool save; ///< Suggests if the setting should be saved and read to a frontend config 247 const bool save; ///< Suggests if the setting should be saved and read to a frontend config
242 const bool 248 const bool
243 runtime_modifiable; ///< Suggests if the setting can be modified while a guest is running 249 runtime_modifiable; ///< Suggests if the setting can be modified while a guest is running
244 const enum Specialization 250 const u32 specialization; ///< Extra data to identify representation of a setting
245 specialization; ///< Extra data to identify representation of a setting
246 BasicSetting* const other_setting; ///< A paired setting 251 BasicSetting* const other_setting; ///< A paired setting
247}; 252};
248 253