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 "ThrottleManager.hh"
10 #include "ResampledSoundDevice.hh"
11 #include <memory>
12 #include <vector>
13 
14 namespace openmsx {
15 
16 class GlobalCommandController;
17 
23 class GlobalSettings final : private Observer<Setting>
24 {
25 public:
26  explicit GlobalSettings(GlobalCommandController& commandController);
28 
30  return speedSetting;
31  }
33  return pauseSetting;
34  }
36  return powerSetting;
37  }
39  return autoSaveSetting;
40  }
42  return umrCallBackSetting;
43  }
45  return invalidPsgDirectionsSetting;
46  }
48  return resampleSetting;
49  }
51  return *deadzoneSettings[i];
52  }
54  return throttleManager;
55  }
56 
57 private:
58  // Observer<Setting>
59  void update(const Setting& setting) override;
60 
61  GlobalCommandController& commandController;
62 
63  IntegerSetting speedSetting;
64  BooleanSetting pauseSetting;
65  BooleanSetting powerSetting;
66  BooleanSetting autoSaveSetting;
67  StringSetting umrCallBackSetting;
68  StringSetting invalidPsgDirectionsSetting;
70  std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
71  ThrottleManager throttleManager;
72 };
73 
74 } // namespace openmsx
75 
76 #endif
IntegerSetting & getJoyDeadzoneSetting(int i)
EnumSetting< ResampledSoundDevice::ResampleType > & getResampleSetting()
ThrottleManager & getThrottleManager()
StringSetting & getInvalidPsgDirectionsSetting()
BooleanSetting & getPauseSetting()
BooleanSetting & getAutoSaveSetting()
BooleanSetting & getPowerSetting()
GlobalSettings(GlobalCommandController &commandController)
StringSetting & getUMRCallBackSetting()
A Setting with an integer value.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
Manages the throttle state of openMSX.
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
This class contains settings that are used by several other class (including some singletons)...
IntegerSetting & getSpeedSetting()