Default implementation for the SettingsManagerInterface.
More...
#include <src/windows/include/display_device/windows/settings_manager.h>
|
| bool | prepareDisplayModes (const SingleDisplayConfiguration &config, const std::string &device_to_configure, const std::set< std::string > &additional_devices_to_configure, DdGuardFn &guard_fn, SingleDisplayConfigState &new_state, bool &system_settings_touched) |
| | Changes or restores the display modes based on the cached state, new state and configuration.
|
| |
| bool | prepareHdrStates (const SingleDisplayConfiguration &config, const std::string &device_to_configure, const std::set< std::string > &additional_devices_to_configure, DdGuardFn &guard_fn, SingleDisplayConfigState &new_state, bool &system_settings_touched) |
| | Changes or restores the HDR states based on the cached state, new state and configuration.
|
| |
| bool | preparePrimaryDevice (const SingleDisplayConfiguration &config, const std::string &device_to_configure, DdGuardFn &guard_fn, SingleDisplayConfigState &new_state, bool &system_settings_touched) |
| | Changes or restores the primary device based on the cached state, new state and configuration.
|
| |
| std::optional< std::tuple< SingleDisplayConfigState, std::string, std::set< std::string > > > | prepareTopology (const SingleDisplayConfiguration &config, const ActiveTopology &topology_before_changes, bool &release_context, bool &system_settings_touched) |
| | Preps the topology so that the further settings could be applied.
|
| |
| RevertResult | revertModifiedSettings (const ActiveTopology ¤t_topology, bool &system_settings_touched, bool *switched_topology=nullptr) |
| | Try to revert the modified settings.
|
| |
|
| enum class | ApplyResult {
Ok
, ApiTemporarilyUnavailable
, DevicePrepFailed
, PrimaryDevicePrepFailed
,
DisplayModePrepFailed
, HdrStatePrepFailed
, PersistenceSaveFailed
} |
| | Outcome values when trying to apply settings. More...
|
| |
| enum class | RevertResult {
Ok
, ApiTemporarilyUnavailable
, TopologyIsInvalid
, SwitchingTopologyFailed
,
RevertingPrimaryDeviceFailed
, RevertingDisplayModesFailed
, RevertingHdrStatesFailed
, PersistenceSaveFailed
} |
| | Outcome values when trying to revert settings. More...
|
| |
Default implementation for the SettingsManagerInterface.
◆ SettingsManager()
Default constructor for the class.
- Parameters
-
| dd_api | A pointer to the Windows Display Device interface. Will throw on nullptr! |
| audio_context_api | [Optional] A pointer to the Audio Context interface. |
| persistent_state | A pointer to a class for managing persistence. |
| workarounds | Workaround settings for the APIs. |
◆ applySettings()
◆ enumAvailableDevices()
◆ getDisplayName()
| std::string display_device::SettingsManager::getDisplayName |
( |
const std::string & | device_id | ) |
const |
|
nodiscardoverridevirtual |
◆ prepareDisplayModes()
| bool display_device::SettingsManager::prepareDisplayModes |
( |
const SingleDisplayConfiguration & | config, |
|
|
const std::string & | device_to_configure, |
|
|
const std::set< std::string > & | additional_devices_to_configure, |
|
|
DdGuardFn & | guard_fn, |
|
|
SingleDisplayConfigState & | new_state, |
|
|
bool & | system_settings_touched ) |
|
nodiscardprotected |
Changes or restores the display modes based on the cached state, new state and configuration.
- Parameters
-
| config | Configuration to be used for preparing display modes. |
| device_to_configure | The main device to be used for preparation. |
| additional_devices_to_configure | Additional devices that should be configured. |
| guard_fn | Reference to the guard function which will be set to restore original state (if needed) in case something else fails down the line. |
| new_state | Reference to the new state which is to be updated accordingly. |
| system_settings_touched | Inticates whether a "write" operation could have been performed on the OS. |
- Returns
- True if no errors have occured, false otherwise.
◆ prepareHdrStates()
| bool display_device::SettingsManager::prepareHdrStates |
( |
const SingleDisplayConfiguration & | config, |
|
|
const std::string & | device_to_configure, |
|
|
const std::set< std::string > & | additional_devices_to_configure, |
|
|
DdGuardFn & | guard_fn, |
|
|
SingleDisplayConfigState & | new_state, |
|
|
bool & | system_settings_touched ) |
|
nodiscardprotected |
Changes or restores the HDR states based on the cached state, new state and configuration.
- Parameters
-
| config | Configuration to be used for preparing HDR states. |
| device_to_configure | The main device to be used for preparation. |
| additional_devices_to_configure | Additional devices that should be configured. |
| guard_fn | Reference to the guard function which will be set to restore original state (if needed) in case something else fails down the line. |
| new_state | Reference to the new state which is to be updated accordingly. |
| system_settings_touched | Inticates whether a "write" operation could have been performed on the OS. |
- Returns
- True if no errors have occured, false otherwise.
◆ preparePrimaryDevice()
Changes or restores the primary device based on the cached state, new state and configuration.
- Parameters
-
| config | Configuration to be used for preparing primary device. |
| device_to_configure | The main device to be used for preparation. |
| guard_fn | Reference to the guard function which will be set to restore original state (if needed) in case something else fails down the line. |
| new_state | Reference to the new state which is to be updated accordingly. |
| system_settings_touched | Inticates whether a "write" operation could have been performed on the OS. |
- Returns
- True if no errors have occured, false otherwise.
◆ prepareTopology()
Preps the topology so that the further settings could be applied.
- Parameters
-
| config | Configuration to be used for preparing topology. |
| topology_before_changes | The current topology before any changes. |
| release_context | Specifies whether the audio context should be released at the very end IF everything else has succeeded. |
| system_settings_touched | Inticates whether a "write" operation could have been performed on the OS. |
- Returns
- A tuple of (new_state that is to be updated/persisted, device_to_configure, additional_devices_to_configure).
◆ resetPersistence()
| bool display_device::SettingsManager::resetPersistence |
( |
| ) |
|
|
nodiscardoverridevirtual |
◆ revertModifiedSettings()
Try to revert the modified settings.
- Parameters
-
| current_topology | Topology before this method is called. |
| system_settings_touched | Indicates whether a "write" operation could have been performed on the OS. |
| switched_topology | [Optional] Indicates whether the current topology was switched to revert settings. |
- Returns
- Result enum indicating success or failure.
- Warning
- The method assumes that the caller will ensure restoring the topology in case of a failure!
◆ revertSettings()
The documentation for this class was generated from the following files: