Skip to content
This repository
Browse code

Merge pull request #2741 from Karlson2k/win32_sysinfo_clean

Small cleanup for CSysInfo
  • Loading branch information...
commit 1350ccbdafe10fa57ac99b0d2974e626c3ca8671 2 parents abf7d8a + 305c4a7
wsoltys authored
4  xbmc/cores/AudioEngine/AESinkFactory.cpp
@@ -101,7 +101,7 @@ IAESink *CAESinkFactory::Create(std::string &device, AEAudioFormat &desiredForma
101 101
 
102 102
 
103 103
 #if defined(TARGET_WINDOWS)
104  
-  if ((driver.empty() && g_sysinfo.IsVistaOrHigher() ||
  104
+  if ((driver.empty() && g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) ||
105 105
     driver == "WASAPI") && !g_advancedSettings.m_audioForceDirectSound)
106 106
     TRY_SINK(WASAPI)
107 107
   else
@@ -141,7 +141,7 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force)
141 141
 {
142 142
 #if defined(TARGET_WINDOWS)
143 143
   ENUMERATE_SINK(DirectSound, force);
144  
-  if (g_sysinfo.IsVistaOrHigher() && !g_advancedSettings.m_audioForceDirectSound)
  144
+  if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && !g_advancedSettings.m_audioForceDirectSound)
145 145
     ENUMERATE_SINK(WASAPI, force);
146 146
 #elif defined(TARGET_ANDROID)
147 147
     ENUMERATE_SINK(AUDIOTRACK, force);
4  xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -234,7 +234,7 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
234 234
   dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 /** Better position accuracy */
235 235
                   | DSBCAPS_GLOBALFOCUS;         /** Allows background playing */
236 236
 
237  
-  if (!g_sysinfo.IsVistaOrHigher())
  237
+  if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
238 238
     dsbdesc.dwFlags |= DSBCAPS_LOCHARDWARE;     /** Needed for 5.1 on emu101k, fails by design on Vista */
239 239
 
240 240
   dsbdesc.dwBufferBytes = m_dwBufferLen;
@@ -478,7 +478,7 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bo
478 478
   HRESULT                hr;
479 479
 
480 480
   /* See if we are on Windows XP */
481  
-  if (!g_sysinfo.IsVistaOrHigher())
  481
+  if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
482 482
   {
483 483
     /* We are on XP - WASAPI not supported - enumerate using DS devices */
484 484
     LPGUID deviceGUID = NULL;
2  xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -716,7 +716,7 @@ void CBaseRenderer::SettingOptionsRenderMethodsFiller(const CSetting *setting, s
716 716
   list.push_back(make_pair(g_localizeStrings.Get(13416), RENDER_METHOD_AUTO));
717 717
 
718 718
 #ifdef HAS_DX
719  
-  if (g_sysinfo.IsVistaOrHigher())
  719
+  if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
720 720
     list.push_back(make_pair(g_localizeStrings.Get(16319), RENDER_METHOD_DXVA));
721 721
   list.push_back(make_pair(g_localizeStrings.Get(13431), RENDER_METHOD_D3D_PS));
722 722
   list.push_back(make_pair(g_localizeStrings.Get(13419), RENDER_METHOD_SOFTWARE));
2  xbmc/rendering/dx/RenderSystemDX.cpp
@@ -100,7 +100,7 @@ bool CRenderSystemDX::InitRenderSystem()
100 100
 {
101 101
   m_bVSync = true;
102 102
 
103  
-  m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && g_sysinfo.IsVistaOrHigher() && LoadD3D9Ex());
  103
+  m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && LoadD3D9Ex());
104 104
   m_pD3D = NULL;
105 105
 
106 106
   if (m_useD3D9Ex)
2  xbmc/settings/Settings.cpp
@@ -759,7 +759,7 @@ void CSettings::InitializeConditions()
759 759
 #endif
760 760
 #if defined(TARGET_WINDOWS) && defined(HAS_DX)
761 761
   m_settingsManager->AddCondition("has_dx");
762  
-  if (g_sysinfo.IsVistaOrHigher())
  762
+  if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
763 763
     m_settingsManager->AddCondition("hasdxva2");
764 764
 #endif
765 765
 
20  xbmc/utils/SystemInfo.cpp
@@ -356,7 +356,7 @@ CStdString CSysInfo::GetCPUSerial()
356 356
 bool CSysInfo::IsAeroDisabled()
357 357
 {
358 358
 #ifdef _WIN32
359  
-  if (IsVistaOrHigher())
  359
+  if (IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
360 360
   {
361 361
     BOOL aeroEnabled = FALSE;
362 362
     HRESULT res = DwmIsCompositionEnabled(&aeroEnabled);
@@ -371,24 +371,6 @@ bool CSysInfo::IsAeroDisabled()
371 371
   return false;
372 372
 }
373 373
 
374  
-bool CSysInfo::IsVistaOrHigher()
375  
-{
376  
-#ifdef TARGET_WINDOWS
377  
-  return IsWindowsVersionAtLeast(WindowsVersionVista);
378  
-#else // TARGET_WINDOWS
379  
-  return false;
380  
-#endif // TARGET_WINDOWS
381  
-}
382  
-
383  
-bool CSysInfo::IsWindows8OrHigher()
384  
-{
385  
-#ifdef TARGET_WINDOWS
386  
-  return IsWindowsVersionAtLeast(WindowsVersionWin8);
387  
-#else // TARGET_WINDOWS
388  
-  return false;
389  
-#endif // TARGET_WINDOWS
390  
-}
391  
-
392 374
 CSysInfo::WindowsVersion CSysInfo::m_WinVer = WindowsVersionUnknown;
393 375
 
394 376
 bool CSysInfo::IsWindowsVersion(WindowsVersion ver)
2  xbmc/utils/SystemInfo.h
@@ -118,8 +118,6 @@ class CSysInfo : public CInfoLoader, public ISubSettings
118 118
   bool HasVDADecoder();
119 119
   bool HasVideoToolBoxDecoder();
120 120
   bool IsAeroDisabled();
121  
-  bool IsVistaOrHigher();
122  
-  bool IsWindows8OrHigher();
123 121
   static bool IsWindowsVersion(WindowsVersion ver);
124 122
   static bool IsWindowsVersionAtLeast(WindowsVersion ver);
125 123
   static WindowsVersion GetWindowsVersion();
2  xbmc/win32/WIN32Util.cpp
@@ -282,7 +282,7 @@ bool CWIN32Util::PowerManagement(PowerState State)
282 282
     break;
283 283
   case POWERSTATE_SHUTDOWN:
284 284
     CLog::Log(LOGINFO, "Shutdown Windows...");
285  
-    if (g_sysinfo.IsWindows8OrHigher())
  285
+    if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8))
286 286
       uExitFlags = 0x00400000; /* EWX_HYBRID_SHUTDOWN */
287 287
     return ExitWindowsEx(uExitFlags | EWX_SHUTDOWN | EWX_FORCE, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_UPGRADE | SHTDN_REASON_FLAG_PLANNED) == TRUE;
288 288
     break;

0 notes on commit 1350ccb

Please sign in to comment.
Something went wrong with that request. Please try again.