openMSX
FloatSetting.hh
Go to the documentation of this file.
1 #ifndef FLOATSETTING_HH
2 #define FLOATSETTING_HH
3 
4 #include "Setting.hh"
5 
6 namespace openmsx {
7 
10 class FloatSetting final : public Setting
11 {
12 public:
13  FloatSetting(CommandController& commandController,
14  std::string_view name, std::string_view description,
15  double initialValue, double minValue, double maxValue);
16 
17  std::string_view getTypeString() const override;
18  void additionalInfo(TclObject& result) const override;
19 
20  double getDouble() const noexcept { return getValue().getDouble(getInterpreter()); }
21  void setDouble (double d);
22 
23 private:
24  const double minValue;
25  const double maxValue;
26 };
27 
28 } // namespace openmsx
29 
30 #endif
openmsx::Setting::getInterpreter
Interpreter & getInterpreter() const
Definition: Setting.cc:162
openmsx::CommandController
Definition: CommandController.hh:17
Setting.hh
openmsx::FloatSetting
A Setting with a floating point value.
Definition: FloatSetting.hh:10
openmsx::Setting::getValue
const TclObject & getValue() const final override
Gets the current value of this setting as a TclObject.
Definition: Setting.hh:135
openmsx::TclObject::getDouble
double getDouble(Interpreter &interp) const
Definition: TclObject.cc:92
openmsx::FloatSetting::getTypeString
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
Definition: FloatSetting.cc:22
openmsx::Setting
Definition: Setting.hh:119
openmsx::FloatSetting::getDouble
double getDouble() const noexcept
Definition: FloatSetting.hh:20
openmsx::FloatSetting::setDouble
void setDouble(double d)
Definition: FloatSetting.cc:32
openmsx::TclObject
Definition: TclObject.hh:21
openmsx::FloatSetting::FloatSetting
FloatSetting(CommandController &commandController, std::string_view name, std::string_view description, double initialValue, double minValue, double maxValue)
Definition: FloatSetting.cc:5
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::FloatSetting::additionalInfo
void additionalInfo(TclObject &result) const override
Helper method for info().
Definition: FloatSetting.cc:27