![]() |
libdisplaydevice master
C++ library to modify display devices.
|
Default macOS implementation for the SettingsManagerInterface. More...
#include <src/macos/include/display_device/macos/settings_manager.h>
Public Member Functions | |
| ApplyResult | applySettings (const SingleDisplayConfiguration &config) override |
| Apply the provided configuration to the system. | |
| EnumeratedDeviceList | enumAvailableDevices () const override |
| Enumerate the available (active and inactive) devices. | |
| const std::shared_ptr< AudioContextInterface > & | getAudioContextApi () const |
| Get the audio context API. | |
| std::string | getDisplayName (const std::string &device_id) const override |
| Get the platform-specific display name associated with the device. | |
| MacSettingsManager (std::shared_ptr< MacDisplayDeviceInterface > dd_api, std::shared_ptr< AudioContextInterface > audio_context_api, std::unique_ptr< MacPersistentState > persistent_state, MacWorkarounds workarounds) | |
| Default constructor for the class. | |
| bool | resetPersistence () override |
| Reset the persistence in case the settings cannot be reverted. | |
| RevertResult | revertSettings () override |
| Revert the applied configuration and restore the previous settings. | |
Public Member Functions inherited from display_device::SettingsManagerInterface | |
| virtual | ~SettingsManagerInterface ()=default |
| Default virtual destructor. | |
Additional Inherited Members | |
Public Types inherited from display_device::SettingsManagerInterface | |
| 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 macOS implementation for the SettingsManagerInterface.
macOS v1a supports SingleDisplayConfiguration::DevicePreparation::VerifyOnly with active-display resolution and refresh-rate changes. HDR writes and topology preparation modes such as EnsureActive, EnsurePrimary, and EnsureOnlyDisplay fail explicitly.
|
explicit |
Default constructor for the class.
| dd_api | A pointer to the macOS Display Device interface. Will throw on nullptr. |
| audio_context_api | Optional Audio Context interface. |
| persistent_state | A pointer to a class for managing persistence. |
| workarounds | Workaround settings for the APIs. |
|
nodiscardoverridevirtual |
Apply the provided configuration to the system.
| config | A desired configuration for the display device. |
*Examples**
Implements display_device::SettingsManagerInterface.
|
nodiscardoverridevirtual |
Enumerate the available (active and inactive) devices.
*Examples**
Implements display_device::SettingsManagerInterface.
|
nodiscard |
Get the audio context API.
|
nodiscardoverridevirtual |
Get the platform-specific display name associated with the device.
| device_id | A device to get display name for. |
*Examples**
Implements display_device::SettingsManagerInterface.
|
nodiscardoverridevirtual |
Reset the persistence in case the settings cannot be reverted.
In case the settings cannot be reverted, because the display is turned or some other reason, this allows to "accept" the current state and start from scratch, but only if the persistence was cleared successfully.
*Examples**
Implements display_device::SettingsManagerInterface.
|
nodiscardoverridevirtual |
Revert the applied configuration and restore the previous settings.
*Examples**
Implements display_device::SettingsManagerInterface.