openMSX
FloatSetting.hh
Go to the documentation of this file.
1#ifndef FLOATSETTING_HH
2#define FLOATSETTING_HH
3
4#include "Setting.hh"
5
6namespace openmsx {
7
10class FloatSetting final : public Setting
11{
12public:
13 FloatSetting(CommandController& commandController,
14 std::string_view name, static_string_view description,
15 double initialValue, double minValue, double maxValue);
16
17 [[nodiscard]] std::string_view getTypeString() const override;
18 void additionalInfo(TclObject& result) const override;
19
20 [[nodiscard]] double getDouble() const noexcept { return getValue().getDouble(getInterpreter()); }
21 [[nodiscard]] float getFloat() const noexcept { return getValue().getFloat (getInterpreter()); }
22 void setDouble(double d);
23 void setFloat (float f);
24
25 double getMinValue() const { return minValue; }
26 double getMaxValue() const { return maxValue; }
27
28private:
29 const double minValue;
30 const double maxValue;
31};
32
33} // namespace openmsx
34
35#endif
A Setting with a floating point value.
double getDouble() const noexcept
void additionalInfo(TclObject &result) const override
Helper method for info().
void setDouble(double d)
double getMinValue() const
void setFloat(float f)
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
double getMaxValue() const
float getFloat() const noexcept
Interpreter & getInterpreter() const
Definition Setting.cc:139
const TclObject & getValue() const final
Gets the current value of this setting as a TclObject.
Definition Setting.hh:133
double getDouble(Interpreter &interp) const
Definition TclObject.cc:122
float getFloat(Interpreter &interp) const
Definition TclObject.cc:107
static_string_view
This file implemented 3 utility functions:
Definition Autofire.cc:11