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 pauseOnLostFocusSetting;
43  }
45  return umrCallBackSetting;
46  }
48  return invalidPsgDirectionsSetting;
49  }
51  return resampleSetting;
52  }
54  return *deadzoneSettings[i];
55  }
57  return throttleManager;
58  }
59 
60 private:
61  // Observer<Setting>
62  void update(const Setting& setting) override;
63 
64  GlobalCommandController& commandController;
65 
66  IntegerSetting speedSetting;
67  BooleanSetting pauseSetting;
68  BooleanSetting powerSetting;
69  BooleanSetting autoSaveSetting;
70  BooleanSetting pauseOnLostFocusSetting;
71  StringSetting umrCallBackSetting;
72  StringSetting invalidPsgDirectionsSetting;
74  std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
75  ThrottleManager throttleManager;
76 };
77 
78 } // namespace openmsx
79 
80 #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
BooleanSetting & getPauseOnLostFocusSetting()
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()