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 "noncopyable.hh"
12 #include <memory>
13 #include <vector>
14 
15 namespace openmsx {
16 
17 class GlobalCommandController;
18 
24 class GlobalSettings final : private Observer<Setting>, private noncopyable
25 {
26 public:
27  explicit GlobalSettings(GlobalCommandController& commandController);
29 
31  return speedSetting;
32  }
34  return pauseSetting;
35  }
37  return powerSetting;
38  }
40  return autoSaveSetting;
41  }
43  return pauseOnLostFocusSetting;
44  }
46  return umrCallBackSetting;
47  }
49  return invalidPsgDirectionsSetting;
50  }
52  return resampleSetting;
53  }
55  return *deadzoneSettings[i];
56  }
58  return throttleManager;
59  }
60 
61 private:
62  // Observer<Setting>
63  void update(const Setting& setting) override;
64 
65  GlobalCommandController& commandController;
66 
67  IntegerSetting speedSetting;
68  BooleanSetting pauseSetting;
69  BooleanSetting powerSetting;
70  BooleanSetting autoSaveSetting;
71  BooleanSetting pauseOnLostFocusSetting;
72  StringSetting umrCallBackSetting;
73  StringSetting invalidPsgDirectionsSetting;
75  std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
76  ThrottleManager throttleManager;
77 };
78 
79 } // namespace openmsx
80 
81 #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
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12
This class contains settings that are used by several other class (including some singletons)...
IntegerSetting & getSpeedSetting()