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"
12#include <memory>
13#include <vector>
14
15namespace openmsx {
16
17class GlobalCommandController;
18
24class GlobalSettings final : private Observer<Setting>
25{
26public:
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 }
51 [[nodiscard]] IntegerSetting& getJoyDeadzoneSetting(int i) {
52 return *deadzoneSettings[i];
53 }
54 [[nodiscard]] SpeedManager& getSpeedManager() {
55 return speedManager;
56 }
58 return throttleManager;
59 }
60
61private:
62 // Observer<Setting>
63 void update(const Setting& setting) noexcept override;
64
65private:
66 GlobalCommandController& commandController;
67
68 BooleanSetting pauseSetting;
69 BooleanSetting powerSetting;
70 BooleanSetting autoSaveSetting;
71 StringSetting umrCallBackSetting;
72 StringSetting invalidPsgDirectionsSetting;
73 StringSetting invalidPpiModeSetting;
75 std::vector<std::unique_ptr<IntegerSetting>> deadzoneSettings;
76 SpeedManager speedManager;
77 ThrottleManager throttleManager;
78};
79
80} // namespace openmsx
81
82#endif
BaseSetting * setting
Definition: Interpreter.cc:27
This class contains settings that are used by several other class (including some singletons).
ThrottleManager & getThrottleManager()
IntegerSetting & getJoyDeadzoneSetting(int i)
StringSetting & getUMRCallBackSetting()
BooleanSetting & getAutoSaveSetting()
SpeedManager & getSpeedManager()
GlobalSettings(GlobalCommandController &commandController)
StringSetting & getInvalidPpiModeSetting()
BooleanSetting & getPowerSetting()
EnumSetting< ResampledSoundDevice::ResampleType > & getResampleSetting()
BooleanSetting & getPauseSetting()
StringSetting & getInvalidPsgDirectionsSetting()
A Setting with an integer value.
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
Manages the desired ratio between emutime and real time.
Definition: SpeedManager.hh:18
Manages the throttle state of openMSX.
This file implemented 3 utility functions:
Definition: Autofire.cc:9