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 
31  return pauseSetting;
32  }
34  return powerSetting;
35  }
37  return autoSaveSetting;
38  }
40  return umrCallBackSetting;
41  }
43  return invalidPsgDirectionsSetting;
44  }
46  return invalidPpiModeSetting;
47  }
49  return resampleSetting;
50  }
52  return *deadzoneSettings[i];
53  }
55  return speedManager;
56  }
58  return throttleManager;
59  }
60 
61 private:
62  // Observer<Setting>
63  void update(const Setting& setting) override;
64 
65  GlobalCommandController& commandController;
66 
67  BooleanSetting pauseSetting;
68  BooleanSetting powerSetting;
69  BooleanSetting autoSaveSetting;
70  StringSetting umrCallBackSetting;
71  StringSetting invalidPsgDirectionsSetting;
72  StringSetting invalidPpiModeSetting;
74  std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
75  SpeedManager speedManager;
76  ThrottleManager throttleManager;
77 };
78 
79 } // namespace openmsx
80 
81 #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
openmsx::SpeedManager
Manages the desired ratio between emutime and real time.
Definition: SpeedManager.hh:16
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:24
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: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:35
SpeedManager.hh
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::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