| 1 |
#ifndef GLOBALSETTINGS_HH |
| 2 |
#define GLOBALSETTINGS_HH |
| 3 |
|
| 4 |
#include "BooleanSetting.hh" |
| 5 |
#include "EnumSetting.hh" |
| 6 |
#include "IntegerSetting.hh" |
| 7 |
#include "ResampledSoundDevice.hh" |
| 8 |
#include "SpeedManager.hh" |
| 9 |
#include "StringSetting.hh" |
| 10 |
#include "ThrottleManager.hh" |
| 11 |
|
| 12 |
#include "Observer.hh" |
| 13 |
|
| 14 |
#include <memory> |
| 15 |
|
| 16 |
namespace openmsx { |
| 17 |
|
| 18 |
class GlobalCommandController; |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
class GlobalSettings final : private Observer<Setting> |
| 26 |
{ |
| 27 |
public: |
| 28 |
explicit GlobalSettings(GlobalCommandController& commandController); |
| 29 |
~GlobalSettings(); |
| 30 |
|
| 31 |
[[nodiscard]] BooleanSetting& getPauseSetting() { |
| 32 |
return pauseSetting; |
| 33 |
} |
| 34 |
[[nodiscard]] BooleanSetting& getPowerSetting() { |
| 35 |
return powerSetting; |
| 36 |
} |
| 37 |
[[nodiscard]] BooleanSetting& getAutoSaveSetting() { |
| 38 |
return autoSaveSetting; |
| 39 |
} |
| 40 |
[[nodiscard]] StringSetting& getUMRCallBackSetting() { |
| 41 |
return umrCallBackSetting; |
| 42 |
} |
| 43 |
[[nodiscard]] StringSetting& getInvalidPsgDirectionsSetting() { |
| 44 |
return invalidPsgDirectionsSetting; |
| 45 |
} |
| 46 |
[[nodiscard]] StringSetting& getInvalidPpiModeSetting() { |
| 47 |
return invalidPpiModeSetting; |
| 48 |
} |
| 49 |
[[nodiscard]] EnumSetting<ResampledSoundDevice::ResampleType>& getResampleSetting() { |
| 50 |
return resampleSetting; |
| 51 |
} |
| 52 |
[[nodiscard]] SpeedManager& getSpeedManager() { |
| 53 |
return speedManager; |
| 54 |
} |
| 55 |
[[nodiscard]] ThrottleManager& getThrottleManager() { |
| 56 |
return throttleManager; |
| 57 |
} |
| 58 |
|
| 59 |
private: |
| 60 |
|
| 61 |
void update(const Setting& setting) noexcept override; |
| 62 |
|
| 63 |
private: |
| 64 |
GlobalCommandController& commandController; |
| 65 |
|
| 66 |
BooleanSetting pauseSetting; |
| 67 |
BooleanSetting powerSetting; |
| 68 |
BooleanSetting autoSaveSetting; |
| 69 |
StringSetting umrCallBackSetting; |
| 70 |
StringSetting invalidPsgDirectionsSetting; |
| 71 |
StringSetting invalidPpiModeSetting; |
| 72 |
EnumSetting<ResampledSoundDevice::ResampleType> resampleSetting; |
| 73 |
SpeedManager speedManager; |
| 74 |
ThrottleManager throttleManager; |
| 75 |
}; |
| 76 |
|
| 77 |
} |
| 78 |
|
| 79 |
#endif |