Skip to content

Commit

Permalink
Removed Advancedsettings 'AutoHDR' and now is used GUI Settings -> Pl…
Browse files Browse the repository at this point in the history
…ayer -> Use HDR display capabilities instead
  • Loading branch information
thexai committed Jan 25, 2020
1 parent 0e0d098 commit d8683dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
16 changes: 0 additions & 16 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,6 @@ bool CApplication::Create(const CAppParamParser &params)
//! @todo - move to CPlatformXXX
#ifdef TARGET_WINDOWS
CWIN32Util::SetThreadLocalLocale(true); // enable independent locale for each thread, see https://connect.microsoft.com/VisualStudio/feedback/details/794122
if (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_bAutoHDR &&
CWIN32Util::GetWindowsHDRStatus() == 1)
{
CLog::Log(LOGNOTICE, "Turning display HDR on due advancedsettings");
CWIN32Util::ToggleWindowsHDR();
Sleep(2000);
}
#endif // TARGET_WINDOWS

// application inbound service
Expand Down Expand Up @@ -2643,15 +2636,6 @@ void CApplication::Stop(int exitCode)

cleanup_emu_environ();

#if defined(TARGET_WINDOWS)
if (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_bAutoHDR &&
exitCode == EXITCODE_QUIT && CWIN32Util::GetWindowsHDRStatus() == 2)
{
CWIN32Util::ToggleWindowsHDR();
Sleep(1800);
}
#endif

Sleep(200);
}

Expand Down
17 changes: 17 additions & 0 deletions xbmc/rendering/dx/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#include "windowing/GraphicContext.h"
#include "messaging/ApplicationMessenger.h"
#include "platform/win32/CharsetConverter.h"
#include "platform/win32/WIN32Util.h"
#include "ServiceBroker.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "utils/log.h"
#include "utils/SystemInfo.h"
Expand Down Expand Up @@ -286,6 +288,21 @@ bool DX::DeviceResources::SetFullScreen(bool fullscreen, RESOLUTION_INFO& res)
// Configures resources that don't depend on the Direct3D device.
void DX::DeviceResources::CreateDeviceIndependentResources()
{
// Configures Windows HDR according GUI Settings / Player / Use HDR display capabilities
if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(
Windowing()->SETTING_WINSYSTEM_IS_HDR_DISPLAY) &&
CWIN32Util::GetWindowsHDRStatus() == 1)
{
CWIN32Util::ToggleWindowsHDR(); // Toggle Windows HDR on
Sleep(2000);
}
else if (!CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(
Windowing()->SETTING_WINSYSTEM_IS_HDR_DISPLAY) &&
CWIN32Util::GetWindowsHDRStatus() == 2)
{
CWIN32Util::ToggleWindowsHDR(); // Toggle Windows HDR off
Sleep(2000);
}
}

// Configures the Direct3D device, and stores handles to it and the device context.
Expand Down
4 changes: 0 additions & 4 deletions xbmc/settings/AdvancedSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ void CAdvancedSettings::Initialize()
m_bVirtualShares = true;
m_bTry10bitOutput = false;

m_bAutoHDR = false;

m_cpuTempCmd = "";
m_gpuTempCmd = "";
#if defined(TARGET_DARWIN)
Expand Down Expand Up @@ -897,8 +895,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
XMLUtils::GetUInt(pRootElement, "packagefoldersize", m_addonPackageFolderSize);
XMLUtils::GetBoolean(pRootElement, "try10bitoutput", m_bTry10bitOutput);

XMLUtils::GetBoolean(pRootElement, "autoHDR", m_bAutoHDR);

// EPG
pElement = pRootElement->FirstChildElement("epg");
if (pElement)
Expand Down
2 changes: 0 additions & 2 deletions xbmc/settings/AdvancedSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
bool m_bVirtualShares;
bool m_bTry10bitOutput;

bool m_bAutoHDR;

std::string m_cpuTempCmd;
std::string m_gpuTempCmd;

Expand Down

0 comments on commit d8683dd

Please sign in to comment.