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
openmsx::EnumSetting< ResampledSoundDevice::ResampleType >
IntegerSetting.hh
openmsx::Setting
Definition: Setting.hh:119
BooleanSetting.hh
StringSetting.hh
openmsx::StringSetting
Definition: StringSetting.hh:8
Observer.hh
EnumSetting.hh
ThrottleManager.hh
openmsx::GlobalSettings::getThrottleManager
ThrottleManager & getThrottleManager()
Definition: GlobalSettings.hh:53
openmsx::GlobalSettings::getJoyDeadzoneSetting
IntegerSetting & getJoyDeadzoneSetting(int i)
Definition: GlobalSettings.hh:50
openmsx::GlobalSettings::getSpeedSetting
IntegerSetting & getSpeedSetting()
Definition: GlobalSettings.hh:29
openmsx::GlobalSettings
This class contains settings that are used by several other class (including some singletons).
Definition: GlobalSettings.hh:23
openmsx::BooleanSetting
Definition: BooleanSetting.hh:8
openmsx::IntegerSetting
A Setting with an integer value.
Definition: IntegerSetting.hh:10
openmsx::GlobalSettings::GlobalSettings
GlobalSettings(GlobalCommandController &commandController)
Definition: GlobalSettings.cc:13
openmsx::GlobalSettings::getUMRCallBackSetting
StringSetting & getUMRCallBackSetting()
Definition: GlobalSettings.hh:41
openmsx::GlobalSettings::getPauseSetting
BooleanSetting & getPauseSetting()
Definition: GlobalSettings.hh:32
openmsx::GlobalSettings::getAutoSaveSetting
BooleanSetting & getAutoSaveSetting()
Definition: GlobalSettings.hh:38
openmsx::GlobalSettings::~GlobalSettings
~GlobalSettings()
Definition: GlobalSettings.cc:58
openmsx::GlobalCommandController
Definition: GlobalCommandController.hh:35
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::ThrottleManager
Manages the throttle state of openMSX.
Definition: ThrottleManager.hh:17
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
openmsx::GlobalSettings::getInvalidPsgDirectionsSetting
StringSetting & getInvalidPsgDirectionsSetting()
Definition: GlobalSettings.hh:44
openmsx::GlobalSettings::getResampleSetting
EnumSetting< ResampledSoundDevice::ResampleType > & getResampleSetting()
Definition: GlobalSettings.hh:47
ResampledSoundDevice.hh
openmsx::GlobalSettings::getPowerSetting
BooleanSetting & getPowerSetting()
Definition: GlobalSettings.hh:35