9 commandController,
"throttle",
10 "controls speed throttling", true,
Setting::DONT_SAVE)
11 , fullSpeedLoadingSetting(
12 commandController,
"fullspeedwhenloading",
13 "sets openMSX to full speed when the MSX is loading", false)
14 , loading(0), throttle(true)
16 throttleSetting .
attach(*
this);
17 fullSpeedLoadingSetting.
attach(*
this);
22 throttleSetting .
detach(*
this);
23 fullSpeedLoadingSetting.
detach(*
this);
26 void ThrottleManager::updateStatus()
28 bool newThrottle = throttleSetting.
getBoolean() &&
29 (!loading || !fullSpeedLoadingSetting.
getBoolean());
30 if (throttle != newThrottle) {
31 throttle = newThrottle;
36 void ThrottleManager::indicateLoadingState(
bool state)
47 void ThrottleManager::update(
const Setting& ) noexcept
56 : throttleManager(throttleManager_)
68 if (isLoading != newState) {
70 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: