diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-06-09 16:03:49 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-06-09 16:03:49 +0400 |
commit | d93173e3af0cacc4b295e3fb2f588d6e0c59b5fe (patch) | |
tree | 8779d5810e1e300fd3640ba1bcbc28ce1a95151d /src | |
parent | 18187f322ca29ce4e03d27a4769e3bc214395125 (diff) |
Move the IsWin* functions into an helper class. The OS version is now cached and the function calls properly inlined.
This code was inspired by TortoiseSVN's SysInfo class.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5057 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src')
-rw-r--r-- | src/DSUtil/DSUtil.vcxproj | 2 | ||||
-rw-r--r-- | src/DSUtil/DSUtil.vcxproj.filters | 6 | ||||
-rw-r--r-- | src/DSUtil/SysVersion.cpp | 37 | ||||
-rw-r--r-- | src/DSUtil/SysVersion.h | 46 | ||||
-rw-r--r-- | src/DSUtil/WinAPIUtils.cpp | 70 | ||||
-rw-r--r-- | src/DSUtil/WinAPIUtils.h | 4 | ||||
-rw-r--r-- | src/filters/renderer/VideoRenderers/RenderersSettings.h | 1 | ||||
-rw-r--r-- | src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp | 4 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/FfmpegContext.cpp | 4 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp | 6 | ||||
-rw-r--r-- | src/mpc-hc/AppSettings.cpp | 14 | ||||
-rw-r--r-- | src/mpc-hc/FGManagerBDA.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/MainFrm.cpp | 9 | ||||
-rw-r--r-- | src/mpc-hc/PPageDVD.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/PPageFormats.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/PPageOutput.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/PPageTweaks.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/PPageWebServer.cpp | 4 | ||||
-rw-r--r-- | src/mpc-hc/StatusLabel.cpp | 6 | ||||
-rw-r--r-- | src/mpc-hc/mplayerc.cpp | 2 | ||||
-rw-r--r-- | src/thirdparty/ui/TreePropSheet/PropPageFrameDefault.cpp | 4 |
21 files changed, 129 insertions, 110 deletions
diff --git a/src/DSUtil/DSUtil.vcxproj b/src/DSUtil/DSUtil.vcxproj index 82785f4e3..3803e3bc9 100644 --- a/src/DSUtil/DSUtil.vcxproj +++ b/src/DSUtil/DSUtil.vcxproj @@ -126,6 +126,7 @@ <ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="SysVersion.cpp" />
<ClCompile Include="text.cpp" />
<ClCompile Include="vd.cpp" />
<ClCompile Include="vd_asm.cpp" />
@@ -146,6 +147,7 @@ <ClInclude Include="SharedInclude.h" />
<ClInclude Include="simd_common.h" />
<ClInclude Include="stdafx.h" />
+ <ClInclude Include="SysVersion.h" />
<ClInclude Include="text.h" />
<ClInclude Include="vd.h" />
<ClInclude Include="vd_asm.h" />
diff --git a/src/DSUtil/DSUtil.vcxproj.filters b/src/DSUtil/DSUtil.vcxproj.filters index b503abe5d..cc560feba 100644 --- a/src/DSUtil/DSUtil.vcxproj.filters +++ b/src/DSUtil/DSUtil.vcxproj.filters @@ -47,6 +47,9 @@ <ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="SysVersion.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="text.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -103,6 +106,9 @@ <ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="SysVersion.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="text.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/src/DSUtil/SysVersion.cpp b/src/DSUtil/SysVersion.cpp new file mode 100644 index 000000000..82c18ef40 --- /dev/null +++ b/src/DSUtil/SysVersion.cpp @@ -0,0 +1,37 @@ +/*
+ * $Id$
+ *
+ * (C) 2012 see Authors.txt
+ *
+ * This file is part of MPC-HC.
+ *
+ * MPC-HC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * MPC-HC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "stdafx.h"
+#include "SysVersion.h"
+
+
+const OSVERSIONINFOEX SysVersion::fullVersion = InitFullVersion();
+const DWORD SysVersion::version = MAKEWORD(fullVersion.dwMinorVersion, fullVersion.dwMajorVersion);
+
+OSVERSIONINFOEX SysVersion::InitFullVersion()
+{
+ OSVERSIONINFOEX fullVersion = {0};
+ fullVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ GetVersionEx((LPOSVERSIONINFO)&fullVersion);
+
+ return fullVersion;
+}
diff --git a/src/DSUtil/SysVersion.h b/src/DSUtil/SysVersion.h new file mode 100644 index 000000000..231db4e6d --- /dev/null +++ b/src/DSUtil/SysVersion.h @@ -0,0 +1,46 @@ +/*
+ * $Id$
+ *
+ * (C) 2012 see Authors.txt
+ *
+ * This file is part of MPC-HC.
+ *
+ * MPC-HC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * MPC-HC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include <Windows.h>
+
+class SysVersion
+{
+ SysVersion() {};
+
+ static OSVERSIONINFOEX InitFullVersion();
+
+ static const OSVERSIONINFOEX fullVersion;
+ static const DWORD version;
+
+public:
+ static OSVERSIONINFOEX GetFullVersion() { return fullVersion; }
+ static DWORD GetVersion() { return version; }
+
+ static bool IsXPOrLater() { return (version >= 0x0501); }
+ static bool IsVista() { return (version == 0x0600); }
+ static bool IsVistaOrLater() { return (version >= 0x0600); }
+ static bool Is7() { return (version == 0x0601); }
+ static bool Is7OrLater() { return (version >= 0x0601); }
+ //static bool Is8() { return (version == 0x0602); }
+};
diff --git a/src/DSUtil/WinAPIUtils.cpp b/src/DSUtil/WinAPIUtils.cpp index e4bbff527..350da36a6 100644 --- a/src/DSUtil/WinAPIUtils.cpp +++ b/src/DSUtil/WinAPIUtils.cpp @@ -25,76 +25,6 @@ #include "WinAPIUtils.h"
-BOOL IsWinXPOrLater()
-{
- OSVERSIONINFOEX osvi = {0};
- DWORDLONG dwlConditionMask = 0;
-
- // Initialize the OSVERSIONINFOEX structure.
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 5;
- osvi.dwMinorVersion = 1;
-
- // Initialize the condition mask.
- VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
-
- // Perform the test.
-
- return VerifyVersionInfo(&osvi, VER_MAJORVERSION|VER_MINORVERSION, dwlConditionMask);
-}
-
-BOOL IsWinVistaOrLater()
-{
- OSVERSIONINFOEX osvi = {0};
- DWORDLONG dwlConditionMask = 0;
-
- // Initialize the OSVERSIONINFOEX structure.
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 6;
-
- // Initialize the condition mask.
- VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
-
- // Perform the test.
- return VerifyVersionInfo(&osvi, VER_MAJORVERSION, dwlConditionMask);
-}
-
-BOOL IsWin7OrLater()
-{
- OSVERSIONINFOEX osvi = {0};
- DWORDLONG dwlConditionMask = 0;
-
- // Initialize the OSVERSIONINFOEX structure.
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 6;
- osvi.dwMinorVersion = 1;
-
- // Initialize the condition mask.
- VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
-
- // Perform the test.
- return VerifyVersionInfo(&osvi, VER_MAJORVERSION|VER_MINORVERSION, dwlConditionMask);
-}
-
-/*BOOL IsWin8()
-{
- OSVERSIONINFOEX osvi = {0};
- DWORDLONG dwlConditionMask = 0;
-
- // Initialize the OSVERSIONINFOEX structure.
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 6;
- osvi.dwMinorVersion = 2;
-
- // Initialize the condition mask.
- VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION|VER_MINORVERSION, VER_EQUAL);
-
- // Perform the test.
- return VerifyVersionInfo(&osvi, VER_MAJORVERSION|VER_MINORVERSION, dwlConditionMask);
-}*/
-
bool SetPrivilege(LPCTSTR privilege, bool bEnable)
{
HANDLE hToken;
diff --git a/src/DSUtil/WinAPIUtils.h b/src/DSUtil/WinAPIUtils.h index ba491132c..cfdad3c4e 100644 --- a/src/DSUtil/WinAPIUtils.h +++ b/src/DSUtil/WinAPIUtils.h @@ -26,10 +26,6 @@ struct IDirect3D9;
-BOOL IsWinXPOrLater();
-BOOL IsWinVistaOrLater();
-BOOL IsWin7OrLater();
-//BOOL IsWin8();
bool SetPrivilege(LPCTSTR privilege, bool bEnable=true);
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.h b/src/filters/renderer/VideoRenderers/RenderersSettings.h index 80ecd7369..2744dc0f3 100644 --- a/src/filters/renderer/VideoRenderers/RenderersSettings.h +++ b/src/filters/renderer/VideoRenderers/RenderersSettings.h @@ -164,4 +164,3 @@ extern CRenderersData* GetRenderersData(); extern CRenderersSettings& GetRenderersSettings();
extern bool LoadResource(UINT resid, CStringA& str, LPCTSTR restype);
-extern BOOL IsWinVistaOrLater();
diff --git a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp index 2e2906b15..1683ed216 100644 --- a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp +++ b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp @@ -27,6 +27,8 @@ #include "IPinHook.h"
#include "MacrovisionKicker.h"
+#include "../../../DSUtil/SysVersion.h"
+
// ISubPicAllocatorPresenter
@@ -129,7 +131,7 @@ STDMETHODIMP CVMR9AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) // See http://msdn.microsoft.com/en-us/library/dd390928(VS.85).aspx
dwPrefs |= MixerPref9_NonSquareMixing;
dwPrefs |= MixerPref9_NoDecimation;
- if (s.fVMR9MixerYUV && !IsWinVistaOrLater()) {
+ if (s.fVMR9MixerYUV && !SysVersion::IsVistaOrLater()) {
dwPrefs &= ~MixerPref9_RenderTargetMask;
dwPrefs |= MixerPref9_RenderTargetYUV;
}
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp index 6f8a74ce9..2bf679e0f 100644 --- a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp @@ -31,7 +31,7 @@ #include "FfmpegContext.h"
-extern BOOL IsWinVistaOrLater(); // requires linking with DSUtil which is always the case
+#include "../../../DSUtil/SysVersion.h"
extern "C" {
#include <ffmpeg/libavcodec/dsputil.h>
@@ -165,7 +165,7 @@ int FFH264CheckCompatibility(int nWidth, int nHeight, struct AVCodecContext* pAV if (nPCIVendor == PCIV_nVidia) {
// nVidia cards support level 5.1 since drivers v6.14.11.7800 for XP and drivers v7.15.11.7800 for Vista/7
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
if (DriverVersionCheck(VideoDriverVersion, 7, 15, 11, 7800)) {
no_level51_support = 0;
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index e50781bf5..00db8ed10 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -43,6 +43,8 @@ extern "C" #include "../../../DSUtil/DSUtil.h"
#include "../../../DSUtil/MediaTypes.h"
+#include "../../../DSUtil/SysVersion.h"
+#include "../../../DSUtil/WinAPIUtils.h"
#include "../../parser/MpegSplitter/MpegSplitter.h"
#include "../../parser/OggSplitter/OggSplitter.h"
#include "../../parser/RealMediaSplitter/RealMediaSplitter.h"
@@ -50,8 +52,6 @@ extern "C" #include "DXVADecoderH264.h"
#include "../../../mpc-hc/FilterEnum.h"
-#include "../../../DSUtil/WinAPIUtils.h"
-
#define MAX_SUPPORTED_MODE 5
#define ROUND_FRAMERATE(var,FrameRate) if (labs ((long)(var - FrameRate)) < FrameRate*1/100) var = FrameRate;
#define AVRTIMEPERFRAME_VC1_EVO 417083
@@ -532,7 +532,7 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) {
HWND hWnd = NULL;
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
for (int i=0; i<_countof(ffCodecs); i++) {
if (ffCodecs[i].nFFCodec == CODEC_ID_H264) {
ffCodecs[i].DXVAModes = &DXVA_H264_VISTA;
diff --git a/src/mpc-hc/AppSettings.cpp b/src/mpc-hc/AppSettings.cpp index 2b2e50d77..de8f8d4f2 100644 --- a/src/mpc-hc/AppSettings.cpp +++ b/src/mpc-hc/AppSettings.cpp @@ -25,7 +25,7 @@ #include "mplayerc.h"
#include "AppSettings.h"
#include "MiniDump.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
#include "UpdateChecker.h"
@@ -933,7 +933,7 @@ void CAppSettings::UpdateData(bool fSave) fLoopForever = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_LOOP, 0);
fRewind = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_REWIND, FALSE);
iZoomLevel = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ZOOM, 1);
- iDSVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_DSVIDEORENDERERTYPE, (IsWinVistaOrLater() ? (HasEVR() ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_DEFAULT) : VIDRNDT_DS_VMR7WINDOWED));
+ iDSVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_DSVIDEORENDERERTYPE, (SysVersion::IsVistaOrLater() ? (HasEVR() ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_DEFAULT) : VIDRNDT_DS_VMR7WINDOWED));
iRMVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_RMVIDEORENDERERTYPE, VIDRNDT_RM_DEFAULT);
iQTVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_QTVIDEORENDERERTYPE, VIDRNDT_QT_DEFAULT);
@@ -941,7 +941,7 @@ void CAppSettings::UpdateData(bool fSave) strAudioRendererDisplayName = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_AUDIORENDERERTYPE, _T(""));
fAutoloadAudio = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_AUTOLOADAUDIO, TRUE);
- fAutoloadSubtitles = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_AUTOLOADSUBTITLES, !IsVSFilterInstalled() || (IsWinVistaOrLater() && HasEVR()));
+ fAutoloadSubtitles = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_AUTOLOADSUBTITLES, !IsVSFilterInstalled() || (SysVersion::IsVistaOrLater() && HasEVR()));
strSubtitlesLanguageOrder = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_SUBTITLESLANGORDER, _T(""));
strAudiosLanguageOrder = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_AUDIOSLANGORDER, _T(""));
fBlockVSFilter = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_BLOCKVSFILTER, TRUE);
@@ -960,15 +960,15 @@ void CAppSettings::UpdateData(bool fSave) strFullScreenMonitor = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_FULLSCREENMONITOR, _T(""));
// Prevent Minimize when in Fullscreen mode on non default monitor
fPreventMinimize = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_PREVENT_MINIMIZE, 0);
- fUseWin7TaskBar = IsWin7OrLater() ? !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_WIN7TASKBAR, TRUE) : FALSE;
+ fUseWin7TaskBar = SysVersion::Is7OrLater() ? !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_WIN7TASKBAR, TRUE) : FALSE;
fExitAfterPlayback = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_EXIT_AFTER_PB, 0);
fNextInDirAfterPlayback = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_NEXT_AFTER_PB, 0);
// TODO: Change IDS_RS_MPC_NO_SEARCH_IN_FOLDER into IDS_RS_SEARCH_IN_FOLDER
fUseSearchInFolder = !pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_NO_SEARCH_IN_FOLDER, 0);
fUseTimeTooltip = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_USE_TIME_TOOLTIP, TRUE);
nTimeTooltipPosition = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_TIME_TOOLTIP_POSITION, TIME_TOOLTIP_ABOVE_SEEKBAR);
- nOSDSize = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_OSD_SIZE, IsWinVistaOrLater() ? 18 : 20);
- strOSDFont= pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_MPC_OSD_FONT, IsWinVistaOrLater() ? _T("Calibri") : _T("Arial"));
+ nOSDSize = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_OSD_SIZE, SysVersion::IsVistaOrLater() ? 18 : 20);
+ strOSDFont= pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_MPC_OSD_FONT, SysVersion::IsVistaOrLater() ? _T("Calibri") : _T("Arial"));
// Associated types with icon or not...
fAssociatedWithIcons = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ASSOCIATED_WITH_ICON, 1);
@@ -1539,7 +1539,7 @@ void CAppSettings::UpdateRenderersData(bool fSave) pApp->WriteProfileString(IDS_R_SETTINGS, IDS_D3D9RENDERDEVICE, r.D3D9RenderDevice);
} else {
- r.iAPSurfaceUsage = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, (IsWinVistaOrLater() ? VIDRNDT_AP_TEXTURE3D : VIDRNDT_AP_TEXTURE2D));
+ r.iAPSurfaceUsage = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, (SysVersion::IsVistaOrLater() ? VIDRNDT_AP_TEXTURE3D : VIDRNDT_AP_TEXTURE2D));
r.iDX9Resizer = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_DX9_RESIZER, 1);
r.fVMR9MixerMode = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_VMR9MIXERMODE, TRUE);
r.fVMR9MixerYUV = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_VMR9MIXERYUV, FALSE);
diff --git a/src/mpc-hc/FGManagerBDA.cpp b/src/mpc-hc/FGManagerBDA.cpp index 16ebf3342..f5898ba6d 100644 --- a/src/mpc-hc/FGManagerBDA.cpp +++ b/src/mpc-hc/FGManagerBDA.cpp @@ -39,7 +39,7 @@ #include "DVBChannel.h"
#include "Mpeg2SectionData.h"
#include "MainFrm.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
/// Format, Video MPEG2
@@ -258,7 +258,7 @@ CFGManagerBDA::CFGManagerBDA(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) m_DVBStreams[DVB_EPG] = CDVBStream(L"epg", &mt_Epg);
// Warning : MEDIA_ELEMENTARY_STREAM didn't work for subtitles with Windows XP!
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
m_DVBStreams[DVB_SUB] = CDVBStream(L"sub", &mt_Subtitle/*, false, MEDIA_TRANSPORT_PAYLOAD*/);
} else {
m_DVBStreams[DVB_SUB] = CDVBStream(L"sub", &mt_Subtitle, false, MEDIA_TRANSPORT_PAYLOAD);
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp index f172008f3..c0f185f14 100644 --- a/src/mpc-hc/MainFrm.cpp +++ b/src/mpc-hc/MainFrm.cpp @@ -33,6 +33,7 @@ #include <atlrx.h>
#include <atlsync.h>
+#include "../DSUtil/SysVersion.h"
#include "../DSUtil/WinAPIUtils.h"
#include "OpenFileDlg.h"
#include "OpenDlg.h"
@@ -4375,7 +4376,7 @@ void CMainFrame::OnFileOpendvd() CString strTitle = ResStr(IDS_MAINFRM_46);
CString path;
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
CFileDialog dlg(TRUE);
IFileOpenDialog *openDlgPtr = dlg.GetIFileOpenDialog();
@@ -5739,7 +5740,7 @@ void CMainFrame::OnUpdateViewDisableDesktopComposition(CCmdUI* pCmdUI) s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS ||
s.iDSVideoRendererType == VIDRNDT_DS_SYNC) &&
r.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D &&
- IsWinVistaOrLater());
+ SysVersion::IsVistaOrLater());
pCmdUI->Enable(supported);
pCmdUI->SetCheck(r.m_RenderSettings.iVMRDisableDesktopComposition);
@@ -15373,7 +15374,7 @@ void CMainFrame::OnFileOpendirectory() CString strTitle = ResStr(IDS_MAINFRM_DIR_TITLE);
CString path;
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
CFileDialog dlg(TRUE);
dlg.AddCheckButton(IDS_MAINFRM_DIR_CHECK, ResStr(IDS_MAINFRM_DIR_CHECK), TRUE);
IFileOpenDialog *openDlgPtr = dlg.GetIFileOpenDialog();
@@ -15447,7 +15448,7 @@ void CMainFrame::OnFileOpendirectory() HRESULT CMainFrame::CreateThumbnailToolbar()
{
- if (!AfxGetAppSettings().fUseWin7TaskBar || !IsWin7OrLater()) {
+ if (!AfxGetAppSettings().fUseWin7TaskBar || !SysVersion::Is7OrLater()) {
return E_FAIL;
}
diff --git a/src/mpc-hc/PPageDVD.cpp b/src/mpc-hc/PPageDVD.cpp index cbc760232..c00d83955 100644 --- a/src/mpc-hc/PPageDVD.cpp +++ b/src/mpc-hc/PPageDVD.cpp @@ -25,7 +25,7 @@ #include "mplayerc.h"
#include "MainFrm.h"
#include "PPageDVD.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
struct {
@@ -287,7 +287,7 @@ void CPPageDVD::OnBnClickedButton1() CString path;
CString strTitle = ResStr(IDS_MAINFRM_46);
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
CFileDialog dlg(TRUE);
IFileOpenDialog *openDlgPtr = dlg.GetIFileOpenDialog();
diff --git a/src/mpc-hc/PPageFormats.cpp b/src/mpc-hc/PPageFormats.cpp index 96d721ad5..389973455 100644 --- a/src/mpc-hc/PPageFormats.cpp +++ b/src/mpc-hc/PPageFormats.cpp @@ -24,7 +24,7 @@ #include "stdafx.h"
#include "mplayerc.h"
#include "PPageFormats.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
#include <psapi.h>
#include <string>
@@ -630,7 +630,7 @@ BOOL CPPageFormats::OnInitDialog() CreateToolTip();
- if (IsWinVistaOrLater() && !IsUserAnAdmin()) {
+ if (SysVersion::IsVistaOrLater() && !IsUserAnAdmin()) {
GetDlgItem(IDC_BUTTON1)->ShowWindow (SW_HIDE);
GetDlgItem(IDC_BUTTON3)->ShowWindow (SW_HIDE);
GetDlgItem(IDC_BUTTON4)->ShowWindow (SW_HIDE);
diff --git a/src/mpc-hc/PPageOutput.cpp b/src/mpc-hc/PPageOutput.cpp index e3f24c08e..070b9b606 100644 --- a/src/mpc-hc/PPageOutput.cpp +++ b/src/mpc-hc/PPageOutput.cpp @@ -24,7 +24,7 @@ #include "stdafx.h"
#include "mplayerc.h"
#include "PPageOutput.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
#include <moreuuids.h>
#include "Monitors.h"
@@ -259,7 +259,7 @@ BOOL CPPageOutput::OnInitDialog() }
// YUV mixing is not compatible with Vista
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
GetDlgItem(IDC_DSVMR9YUVMIXER)->ShowWindow (SW_HIDE);
}
diff --git a/src/mpc-hc/PPageTweaks.cpp b/src/mpc-hc/PPageTweaks.cpp index d55896513..dac49aab3 100644 --- a/src/mpc-hc/PPageTweaks.cpp +++ b/src/mpc-hc/PPageTweaks.cpp @@ -25,7 +25,7 @@ #include "mplayerc.h"
#include "PPageTweaks.h"
#include "MainFrm.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
// CPPageTweaks dialog
@@ -90,7 +90,7 @@ BOOL CPPageTweaks::OnInitDialog() m_fPreventMinimize = s.fPreventMinimize;
m_fUseWin7TaskBar = s.fUseWin7TaskBar;
- if (!IsWin7OrLater()) {
+ if (!SysVersion::Is7OrLater()) {
GetDlgItem(IDC_CHECK_WIN7)->EnableWindow(FALSE);
}
diff --git a/src/mpc-hc/PPageWebServer.cpp b/src/mpc-hc/PPageWebServer.cpp index e8895b04d..d30b2ff23 100644 --- a/src/mpc-hc/PPageWebServer.cpp +++ b/src/mpc-hc/PPageWebServer.cpp @@ -25,7 +25,7 @@ #include "mplayerc.h"
#include "MainFrm.h"
#include "PPageWebServer.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
// CPPageWebServer dialog
@@ -182,7 +182,7 @@ bool CPPageWebServer::PickDir(CString& dir) CString strTitle = ResStr(IDS_PPAGEWEBSERVER_0);
bool success = false;
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
CFileDialog dlg(TRUE);
IFileOpenDialog *openDlgPtr = dlg.GetIFileOpenDialog();
diff --git a/src/mpc-hc/StatusLabel.cpp b/src/mpc-hc/StatusLabel.cpp index 5f7389314..1b5f72ebd 100644 --- a/src/mpc-hc/StatusLabel.cpp +++ b/src/mpc-hc/StatusLabel.cpp @@ -24,7 +24,7 @@ #include "stdafx.h"
#include "mplayerc.h"
#include "StatusLabel.h"
-#include "../DSUtil/WinAPIUtils.h"
+#include "../DSUtil/SysVersion.h"
// CStatusLabel
@@ -39,8 +39,8 @@ CStatusLabel::CStatusLabel(bool fRightAlign, bool fAddEllipses) ::ReleaseDC(0, hdc);
m_font.m_hObject = NULL;
- int size = IsWinVistaOrLater() ? 16 : 14;
- CString face = IsWinVistaOrLater() ? _T("Segoe UI") : _T("Microsoft Sans Serif");
+ int size = SysVersion::IsVistaOrLater() ? 16 : 14;
+ CString face = SysVersion::IsVistaOrLater() ? _T("Segoe UI") : _T("Microsoft Sans Serif");
m_font.CreateFont(int(size * scale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
face);
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp index 68ba9fd61..92ce65e12 100644 --- a/src/mpc-hc/mplayerc.cpp +++ b/src/mpc-hc/mplayerc.cpp @@ -2146,7 +2146,7 @@ void CMPlayerCApp::SetLanguage(const LanguageResource& languageResource) /*HRESULT CMPlayerCApp::GetElevationType(TOKEN_ELEVATION_TYPE* ptet )
{
- ASSERT( IsWinVistaOrLater() );
+ ASSERT( SysVersion::IsVistaOrLater() );
ASSERT( ptet );
HRESULT hResult = E_FAIL; // assume an error occurred
diff --git a/src/thirdparty/ui/TreePropSheet/PropPageFrameDefault.cpp b/src/thirdparty/ui/TreePropSheet/PropPageFrameDefault.cpp index eab4e86c8..3779f425a 100644 --- a/src/thirdparty/ui/TreePropSheet/PropPageFrameDefault.cpp +++ b/src/thirdparty/ui/TreePropSheet/PropPageFrameDefault.cpp @@ -20,7 +20,7 @@ #include "stdafx.h"
#include "PropPageFrameDefault.h"
// <MPC-HC Custom Code>
-#include "../../../DSUtil/WinAPIUtils.h"
+#include "../../../DSUtil/SysVersion.h"
// </MPC-HC Custom Code>
@@ -320,7 +320,7 @@ void CPropPageFrameDefault::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaptio lf.lfHeight = rect.Height();
lf.lfWidth = 0;
// <MPC-HC Custom Code>
- CString face = IsWinVistaOrLater() ? _T("Segoe UI") : _T("Arial");
+ CString face = SysVersion::IsVistaOrLater() ? _T("Segoe UI") : _T("Arial");
_tcscpy_s(lf.lfFaceName, face);
// <MPC-HC Custom Code>
CFont f;
|