openMSX
GlobalSettings.hh
Go to the documentation of this file.
1 #ifndef GLOBALSETTINGS_HH
2 #define GLOBALSETTINGS_HH
3 
4 #include "Observer.hh"
5 #include "BooleanSetting.hh"
6 #include "EnumSetting.hh"
7 #include "IntegerSetting.hh"
8 #include "StringSetting.hh"
9 #include "SpeedManager.hh"
10 #include "ThrottleManager.hh"
11 #include "ResampledSoundDevice.hh"
12 #include <memory>
13 #include <vector>
14 
15 namespace openmsx {
16 
17 class GlobalCommandController;
18 
24 class GlobalSettings final : private Observer<Setting>
25 {
26 public:
27  explicit GlobalSettings(GlobalCommandController& commandController);
29 
30  [[nodiscard]] BooleanSetting& getPauseSetting() {
31  return pauseSetting;
32  }
33  [[nodiscard]] BooleanSetting& getPowerSetting() {
34  return powerSetting;
35  }
37  return autoSaveSetting;
38  }
40  return umrCallBackSetting;
41  }
43  return invalidPsgDirectionsSetting;
44  }
46  return invalidPpiModeSetting;
47  }
49  return resampleSetting;
50  }
51  [[nodiscard]] IntegerSetting& getJoyDeadzoneSetting(int i) {
52  return *deadzoneSettings[i];
53  }
54  [[nodiscard]] SpeedManager& getSpeedManager() {
55  return speedManager;
56  }
58  return throttleManager;
59  }
60 
61 private:
62  // Observer<Setting>
63  void update(const Setting& setting) override;
64 
65 private:
66  GlobalCommandController& commandController;
67 
68  BooleanSetting pauseSetting;
69  BooleanSetting powerSetting;
70  BooleanSetting autoSaveSetting;
71  StringSetting umrCallBackSetting;
72  StringSetting invalidPsgDirectionsSetting;
73  StringSetting invalidPpiModeSetting;
75  std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
76  SpeedManager speedManager;
77  ThrottleManager throttleManager;
78 };
79 
80 } // namespace openmsx
81 
82 #endif
openmsx::EnumSetting< ResampledSoundDevice::ResampleType >
IntegerSetting.hh
openmsx::Setting
Definition: Setting.hh:120
BooleanSetting.hh
StringSetting.hh
openmsx::StringSetting
Definition: StringSetting.hh:9
Observer.hh
openmsx::SpeedManager
Manages the desired ratio between emutime and real time.
Definition: SpeedManager.hh:18
EnumSetting.hh
ThrottleManager.hh
openmsx::GlobalSettings::getThrottleManager
ThrottleManager & getThrottleManager()
Definition: GlobalSettings.hh:57
openmsx::GlobalSettings::getJoyDeadzoneSetting
IntegerSetting & getJoyDeadzoneSetting(int i)
Definition: GlobalSettings.hh:51
openmsx::GlobalSettings
This class contains settings that are used by several other class (including some singletons).
Definition: GlobalSettings.hh:25
openmsx::BooleanSetting
Definition: BooleanSetting.hh:9
openmsx::IntegerSetting
A Setting with an integer value.
Definition: IntegerSetting.hh:11
openmsx::GlobalSettings::GlobalSettings
GlobalSettings(GlobalCommandController &commandController)
Definition: GlobalSettings.cc:13
openmsx::GlobalSettings::getUMRCallBackSetting
StringSetting & getUMRCallBackSetting()
Definition: GlobalSettings.hh:39
openmsx::GlobalSettings::getPauseSetting
BooleanSetting & getPauseSetting()
Definition: GlobalSettings.hh:30
openmsx::GlobalSettings::getAutoSaveSetting
BooleanSetting & getAutoSaveSetting()
Definition: GlobalSettings.hh:36
openmsx::GlobalSettings::~GlobalSettings
~GlobalSettings()
Definition: GlobalSettings.cc:60
openmsx::GlobalCommandController
Definition: GlobalCommandController.hh:37
SpeedManager.hh
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::ThrottleManager
Manages the throttle state of openMSX.
Definition: ThrottleManager.hh:19
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
openmsx::GlobalSettings::getSpeedManager
SpeedManager & getSpeedManager()
Definition: GlobalSettings.hh:54
openmsx::GlobalSettings::getInvalidPsgDirectionsSetting
StringSetting & getInvalidPsgDirectionsSetting()
Definition: GlobalSettings.hh:42
openmsx::GlobalSettings::getResampleSetting
EnumSetting< ResampledSoundDevice::ResampleType > & getResampleSetting()
Definition: GlobalSettings.hh:48
openmsx::GlobalSettings::getInvalidPpiModeSetting
StringSetting & getInvalidPpiModeSetting()
Definition: GlobalSettings.hh:45
ResampledSoundDevice.hh
openmsx::GlobalSettings::getPowerSetting
BooleanSetting & getPowerSetting()
Definition: GlobalSettings.hh:33