Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <DisplaySettings.h>
Public Member Functions | |
bool | Load (const TiXmlNode *settings) override |
Load settings from the given XML node. | |
bool | Save (TiXmlNode *settings) const override |
Save settings to the given XML node. | |
void | Clear () override |
Clear any loaded setting values. | |
void | OnSettingAction (const std::shared_ptr< const CSetting > &setting) override |
The given setting has been activated. | |
bool | OnSettingChanging (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting is being changed. | |
bool | OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override |
The given setting needs to be updated. | |
void | OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting has changed. | |
RESOLUTION | GetCurrentResolution () const |
Returns the currently active resolution. | |
void | SetCurrentResolution (RESOLUTION resolution, bool save=false) |
RESOLUTION | GetDisplayResolution () const |
Returns the best-matching resolution of the videoscreen.screenmode setting value. | |
const RESOLUTION_INFO & | GetResolutionInfo (size_t index) const |
const RESOLUTION_INFO & | GetResolutionInfo (RESOLUTION resolution) const |
RESOLUTION_INFO & | GetResolutionInfo (size_t index) |
RESOLUTION_INFO & | GetResolutionInfo (RESOLUTION resolution) |
size_t | ResolutionInfoSize () const |
void | AddResolutionInfo (const RESOLUTION_INFO &resolution) |
const RESOLUTION_INFO & | GetCurrentResolutionInfo () const |
RESOLUTION_INFO & | GetCurrentResolutionInfo () |
RESOLUTION | GetResFromString (const std::string &strResolution) |
std::string | GetStringFromRes (const RESOLUTION resolution, float refreshrate=0.0f) |
void | ApplyCalibrations () |
void | UpdateCalibrations () |
void | ClearCalibrations () |
void | ClearCustomResolutions () |
float | GetZoomAmount () const |
void | SetZoomAmount (float zoomAmount) |
float | GetPixelRatio () const |
void | SetPixelRatio (float pixelRatio) |
float | GetVerticalShift () const |
void | SetVerticalShift (float verticalShift) |
bool | IsNonLinearStretched () const |
void | SetNonLinearStretched (bool nonLinearStretch) |
void | SetMonitor (const std::string &monitor) |
Public Member Functions inherited from ISettingCallback | |
virtual | ~ISettingCallback ()=default |
virtual void | OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName) |
The given property of the given setting has changed. | |
Public Member Functions inherited from ISubSettings | |
virtual | ~ISubSettings ()=default |
Public Member Functions inherited from Observable | |
Observable ()=default | |
virtual | ~Observable ()=default |
Observable & | operator= (const Observable &observable) |
virtual void | RegisterObserver (Observer *obs) |
Register an observer. | |
virtual void | UnregisterObserver (Observer *obs) |
Unregister an observer. | |
virtual void | NotifyObservers (const ObservableMessage message=ObservableMessageNone) |
Send a message to all observers when m_bObservableChanged is true. | |
virtual void | SetChanged (bool bSetTo=true) |
Mark an observable changed. | |
virtual bool | IsObserving (const Observer &obs) const |
Check whether this observable is being observed by an observer. | |
Static Public Member Functions | |
static CDisplaySettings & | GetInstance () |
static void | SettingOptionsModesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsRefreshChangeDelaysFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsRefreshRatesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsResolutionsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsDispModeFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsStereoscopicModesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsPreferredStereoscopicViewModesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsMonitorsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsCmsModesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsCmsWhitepointsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsCmsPrimariesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
static void | SettingOptionsCmsGammaModesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int ¤t, void *data) |
Protected Member Functions | |
CDisplaySettings () | |
CDisplaySettings (const CDisplaySettings &)=delete | |
CDisplaySettings & | operator= (CDisplaySettings const &)=delete |
~CDisplaySettings () override | |
DisplayMode | GetCurrentDisplayMode () const |
Protected Member Functions inherited from Observable | |
void | SendMessage (const ObservableMessage message) |
Send a message to all observer when m_bObservableChanged is true. | |
Static Protected Member Functions | |
static RESOLUTION | GetResolutionFromString (const std::string &strResolution) |
static std::string | GetStringFromResolution (RESOLUTION resolution, float refreshrate=0.0f) |
static RESOLUTION | GetResolutionForScreen () |
static RESOLUTION | FindBestMatchingResolution (const std::map< RESOLUTION, RESOLUTION_INFO > &resolutionInfos, int width, int height, float refreshrate, unsigned int flags) |
Additional Inherited Members | |
Protected Attributes inherited from Observable | |
std::atomic< bool > | m_bObservableChanged {false} |
std::vector< Observer * > | m_observers |
CCriticalSection | m_obsCritSection |
|
protected |
|
protecteddelete |
|
overrideprotecteddefault |
void CDisplaySettings::AddResolutionInfo | ( | const RESOLUTION_INFO & | resolution | ) |
void CDisplaySettings::ApplyCalibrations | ( | ) |
|
overridevirtual |
Clear any loaded setting values.
Reimplemented from ISubSettings.
void CDisplaySettings::ClearCalibrations | ( | ) |
void CDisplaySettings::ClearCustomResolutions | ( | ) |
|
staticprotected |
|
protected |
|
inline |
Returns the currently active resolution.
This resolution might differ from the display resolution which is based on the user's settings.
|
inline |
|
inline |
RESOLUTION CDisplaySettings::GetDisplayResolution | ( | ) | const |
Returns the best-matching resolution of the videoscreen.screenmode setting value.
This resolution might differ from the current resolution which is based on the properties of the operating system and the attached displays.
|
static |
|
inline |
|
inline |
|
staticprotected |
|
staticprotected |
RESOLUTION_INFO & CDisplaySettings::GetResolutionInfo | ( | RESOLUTION | resolution | ) |
const RESOLUTION_INFO & CDisplaySettings::GetResolutionInfo | ( | RESOLUTION | resolution | ) | const |
RESOLUTION_INFO & CDisplaySettings::GetResolutionInfo | ( | size_t | index | ) |
const RESOLUTION_INFO & CDisplaySettings::GetResolutionInfo | ( | size_t | index | ) | const |
|
inline |
|
staticprotected |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Load settings from the given XML node.
settings | XML node containing setting values |
Reimplemented from ISubSettings.
|
overridevirtual |
The given setting has been activated.
This callback is triggered whenever the given setting has been activated. This callback is only fired for CSettingAction settings.
setting | The setting which has been activated. |
Reimplemented from ISettingCallback.
|
overridevirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
|
overridevirtual |
The value of the given setting is being changed.
This callback is triggered whenever the value of a setting is being changed. The given CSetting already contains the new value and the handler of the callback has the possibility to allow or revert changing the value of the setting. In case of a revert OnSettingChanging() is called again to inform all listeners that the value change has been reverted.
setting | The setting whose value is being changed (already containing the changed value) |
Reimplemented from ISettingCallback.
|
overridevirtual |
The given setting needs to be updated.
This callback is triggered when a setting needs to be updated because its value is outdated. This only happens when initially loading the value of a setting and will not be triggered afterwards.
setting | The setting which needs to be updated. |
oldSettingId | The id of the previous setting. |
oldSettingNode | The old setting node |
Reimplemented from ISettingCallback.
|
protecteddelete |
|
inline |
|
overridevirtual |
Save settings to the given XML node.
settings | XML node in which the settings will be saved |
Reimplemented from ISubSettings.
void CDisplaySettings::SetCurrentResolution | ( | RESOLUTION | resolution, |
bool | save = false ) |
void CDisplaySettings::SetMonitor | ( | const std::string & | monitor | ) |
|
inline |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inline |
|
inline |