9 commandController,
"throttle",
10 "controls speed throttling", true,
Setting::Save::NO)
11 , fullSpeedLoadingSetting(
12 commandController,
"fullspeedwhenloading",
13 "sets openMSX to full speed when the MSX is loading", false)
15 throttleSetting .
attach(*
this);
16 fullSpeedLoadingSetting.
attach(*
this);
21 throttleSetting .
detach(*
this);
22 fullSpeedLoadingSetting.
detach(*
this);
25void ThrottleManager::updateStatus()
27 bool newThrottle = throttleSetting.
getBoolean() &&
28 (!loading || !fullSpeedLoadingSetting.
getBoolean());
29 if (throttle != newThrottle) {
30 throttle = newThrottle;
35void ThrottleManager::indicateLoadingState(
bool state)
46void ThrottleManager::update(
const Setting& )
noexcept
55 : throttleManager(throttleManager_)
66 if (isLoading != newState) {
68 throttleManager.indicateLoadingState(isLoading);
bool getBoolean() const noexcept
LoadingIndicator(ThrottleManager &throttleManager)
void update(bool newState)
Called by the device to indicate its loading state may have changed.
void detach(Observer< T > &observer)
void attach(Observer< T > &observer)
Manages the throttle state of openMSX.
ThrottleManager(CommandController &commandController)
This file implemented 3 utility functions: