Skip to content
This repository
Browse code

Merge pull request #3229 from wsoltys/xpcleanup

[WIN32] cosmetics: removed some XP only code.
  • Loading branch information...
commit 24665612e08b4226c7aeb3296ad508019df11203 2 parents bbcdc74 + f097959
Martijn Kaijser authored September 10, 2013
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.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) ||
  104
+  if ((driver.empty() ||
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.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && !g_advancedSettings.m_audioForceDirectSound)
  144
+  if (!g_advancedSettings.m_audioForceDirectSound)
145 145
     ENUMERATE_SINK(WASAPI, force);
146 146
 #elif defined(TARGET_ANDROID)
147 147
     ENUMERATE_SINK(AUDIOTRACK, force);
52  xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -243,9 +243,6 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
243 243
   dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 /** Better position accuracy */
244 244
                   | DSBCAPS_GLOBALFOCUS;         /** Allows background playing */
245 245
 
246  
-  if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
247  
-    dsbdesc.dwFlags |= DSBCAPS_LOCHARDWARE;     /** Needed for 5.1 on emu101k, fails by design on Vista */
248  
-
249 246
   dsbdesc.dwBufferBytes = m_dwBufferLen;
250 247
   dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&wfxex;
251 248
 
@@ -512,55 +509,6 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bo
512 509
 
513 510
   std::string strDD = GetDefaultDevice();
514 511
 
515  
-  /* See if we are on Windows XP */
516  
-  if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
517  
-  {
518  
-    /* We are on XP - WASAPI not supported - enumerate using DS devices */
519  
-    LPGUID deviceGUID = NULL;
520  
-    RPC_CSTR cszGUID;
521  
-    std::string szGUID;
522  
-    std::list<DSDevice> DSDeviceList;
523  
-    DirectSoundEnumerate(DSEnumCallback, &DSDeviceList);
524  
-
525  
-    for(std::list<DSDevice>::iterator itt = DSDeviceList.begin(); itt != DSDeviceList.end(); ++itt)
526  
-    {
527  
-      if (UuidToString((*itt).lpGuid, &cszGUID) != RPC_S_OK)
528  
-        continue;  /* could not convert GUID to string - skip device */
529  
-
530  
-      deviceInfo.m_channels.Reset();
531  
-      deviceInfo.m_dataFormats.clear();
532  
-      deviceInfo.m_sampleRates.clear();
533  
-
534  
-      szGUID = (LPSTR)cszGUID;
535  
-
536  
-      deviceInfo.m_deviceName = "{" + szGUID + "}";
537  
-      deviceInfo.m_displayName = (*itt).name;
538  
-      deviceInfo.m_displayNameExtra = std::string("DirectSound: ") + (*itt).name;
539  
-
540  
-      deviceInfo.m_deviceType = AE_DEVTYPE_PCM;
541  
-      deviceInfo.m_channels   = layoutsByChCount[2];
542  
-
543  
-      deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_FLOAT));
544  
-      deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_AC3));
545  
-
546  
-      deviceInfo.m_sampleRates.push_back((DWORD) 96000);
547  
-
548  
-      deviceInfoList.push_back(deviceInfo);
549  
-
550  
-      // add the default device with m_deviceName = default
551  
-      if(strDD == deviceInfo.m_deviceName)
552  
-      {
553  
-        deviceInfo.m_deviceName = std::string("default");
554  
-        deviceInfo.m_displayName = std::string("default");
555  
-        deviceInfo.m_displayNameExtra = std::string("");
556  
-        deviceInfoList.push_back(deviceInfo);
557  
-      }
558  
-    }
559  
-
560  
-    RpcStringFree(&cszGUID);
561  
-    return;
562  
-  }
563  
-
564 512
   /* Windows Vista or later - supporting WASAPI device probing */
565 513
   hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator);
566 514
   EXIT_ON_FAILURE(hr, __FUNCTION__": Could not allocate WASAPI device enumerator. CoCreateInstance error code: %li", hr)
3  xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -731,8 +731,7 @@ void CBaseRenderer::SettingOptionsRenderMethodsFiller(const CSetting *setting, s
731 731
   list.push_back(make_pair(g_localizeStrings.Get(13416), RENDER_METHOD_AUTO));
732 732
 
733 733
 #ifdef HAS_DX
734  
-  if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
735  
-    list.push_back(make_pair(g_localizeStrings.Get(16319), RENDER_METHOD_DXVA));
  734
+  list.push_back(make_pair(g_localizeStrings.Get(16319), RENDER_METHOD_DXVA));
736 735
   list.push_back(make_pair(g_localizeStrings.Get(13431), RENDER_METHOD_D3D_PS));
737 736
   list.push_back(make_pair(g_localizeStrings.Get(13419), RENDER_METHOD_SOFTWARE));
738 737
 #endif
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.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && LoadD3D9Ex());
  103
+  m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && LoadD3D9Ex());
104 104
   m_pD3D = NULL;
105 105
 
106 106
   if (m_useD3D9Ex)
3  xbmc/settings/Settings.cpp
@@ -766,8 +766,7 @@ void CSettings::InitializeConditions()
766 766
 #endif
767 767
 #if defined(TARGET_WINDOWS) && defined(HAS_DX)
768 768
   m_settingsManager->AddCondition("has_dx");
769  
-  if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
770  
-    m_settingsManager->AddCondition("hasdxva2");
  769
+  m_settingsManager->AddCondition("hasdxva2");
771 770
 #endif
772 771
 
773 772
   if (g_application.IsStandAlone())
3  xbmc/utils/Environment.cpp
@@ -77,8 +77,7 @@ std::string CEnvironment::win32ConvertWToUtf8(const std::wstring &text, bool *re
77 77
   if (resultSuccessful != NULL)
78 78
     *resultSuccessful = false;
79 79
 
80  
-  static const DWORD convFlags = (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista)) ?
81  
-    /*WC_ERR_INVALID_CHARS*/ 0x80 : 0;
  80
+  static const DWORD convFlags = /*WC_ERR_INVALID_CHARS*/ 0x80;
82 81
   int bufSize = WideCharToMultiByte(CP_UTF8,  convFlags, text.c_str(), -1, NULL, 0, NULL, NULL);
83 82
   if (bufSize == 0)
84 83
     return "";
15  xbmc/utils/SystemInfo.cpp
@@ -367,17 +367,10 @@ CStdString CSysInfo::GetCPUSerial()
367 367
 bool CSysInfo::IsAeroDisabled()
368 368
 {
369 369
 #ifdef TARGET_WINDOWS
370  
-  if (IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
371  
-  {
372  
-    BOOL aeroEnabled = FALSE;
373  
-    HRESULT res = DwmIsCompositionEnabled(&aeroEnabled);
374  
-    if (SUCCEEDED(res))
375  
-      return !aeroEnabled;
376  
-  }
377  
-  else
378  
-  {
379  
-    return true;
380  
-  }
  370
+  BOOL aeroEnabled = FALSE;
  371
+  HRESULT res = DwmIsCompositionEnabled(&aeroEnabled);
  372
+  if (SUCCEEDED(res))
  373
+    return !aeroEnabled;
381 374
 #endif
382 375
   return false;
383 376
 }

0 notes on commit 2466561

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