Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2016-04-17 18:55:26 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-07-29 21:19:33 +0300
commite2d8bba5d216d5b25d2f759e87d1c31449e8858b (patch)
treeb8e27c715d588a18be7d761834c278a16965849d /src
parent3e5afbc869f00f11d5b8349156185719814dbaf3 (diff)
Remove legacy code.
Diffstat (limited to 'src')
-rw-r--r--src/DSUtil/DSUtil.vcxproj2
-rw-r--r--src/DSUtil/DSUtil.vcxproj.filters6
-rw-r--r--src/DSUtil/SysVersion.cpp107
-rw-r--r--src/DSUtil/SysVersion.h41
-rw-r--r--src/DSUtil/WinAPIUtils.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.cpp3
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.h3
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp7
-rw-r--r--src/mpc-hc/AboutDlg.cpp17
-rw-r--r--src/mpc-hc/AppSettings.cpp28
-rw-r--r--src/mpc-hc/AuthDlg.cpp121
-rw-r--r--src/mpc-hc/FGFilterLAV.cpp22
-rw-r--r--src/mpc-hc/FGManagerBDA.cpp9
-rw-r--r--src/mpc-hc/FileAssoc.cpp12
-rw-r--r--src/mpc-hc/MainFrm.cpp102
-rw-r--r--src/mpc-hc/MouseTouch.h6
-rw-r--r--src/mpc-hc/PPageDVD.cpp42
-rw-r--r--src/mpc-hc/PPageFormats.cpp8
-rw-r--r--src/mpc-hc/PPageOutput.cpp44
-rw-r--r--src/mpc-hc/PPageOutput.h2
-rw-r--r--src/mpc-hc/PPageSheet.cpp8
-rw-r--r--src/mpc-hc/PPageTweaks.cpp6
-rw-r--r--src/mpc-hc/PPageWebServer.cpp52
-rw-r--r--src/mpc-hc/SaveImageDialog.cpp82
-rw-r--r--src/mpc-hc/SaveImageDialog.h3
-rw-r--r--src/mpc-hc/SaveSubtitlesFileDialog.cpp100
-rw-r--r--src/mpc-hc/SaveSubtitlesFileDialog.h3
-rw-r--r--src/mpc-hc/SaveTextFileDialog.cpp81
-rw-r--r--src/mpc-hc/SaveTextFileDialog.h3
-rw-r--r--src/mpc-hc/SaveThumbnailsDialog.cpp105
-rw-r--r--src/mpc-hc/SaveThumbnailsDialog.h3
-rw-r--r--src/mpc-hc/ShockwaveGraph.cpp25
-rw-r--r--src/mpc-hc/StatusLabel.cpp21
-rw-r--r--src/mpc-hc/UpdateChecker.cpp18
-rw-r--r--src/mpc-hc/mpc-hc.rc2
-rw-r--r--src/mpc-hc/mplayerc.cpp4
-rw-r--r--src/mpc-hc/resource.h1
-rw-r--r--src/thirdparty/TreePropSheet/PropPageFrameDefault.cpp5
40 files changed, 298 insertions, 818 deletions
diff --git a/src/DSUtil/DSUtil.vcxproj b/src/DSUtil/DSUtil.vcxproj
index 6b7399178..992583072 100644
--- a/src/DSUtil/DSUtil.vcxproj
+++ b/src/DSUtil/DSUtil.vcxproj
@@ -63,7 +63,6 @@
<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">
@@ -90,7 +89,6 @@
<ClInclude Include="PathUtils.h" />
<ClInclude Include="SharedInclude.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 6ce084b64..99177b902 100644
--- a/src/DSUtil/DSUtil.vcxproj.filters
+++ b/src/DSUtil/DSUtil.vcxproj.filters
@@ -44,9 +44,6 @@
<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>
@@ -109,9 +106,6 @@
<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
deleted file mode 100644
index 6db223293..000000000
--- a/src/DSUtil/SysVersion.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * (C) 2012-2015 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"
-
-static OSVERSIONINFOEX InitFullVersion()
-{
- OSVERSIONINFOEX fullVersion;
- ZeroMemory(&fullVersion, sizeof(OSVERSIONINFOEX));
- fullVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- GetVersionEx((LPOSVERSIONINFO)&fullVersion);
-
- return fullVersion;
-}
-
-static bool InitIs64Bit()
-{
-#if defined(_WIN64)
- return true; // 64-bit programs run only on Win64
-#else
- // 32-bit programs run on both 32-bit and 64-bit Windows
- // so must sniff
- BOOL f64 = FALSE;
- return (IsWow64Process(GetCurrentProcess(), &f64) && f64);
-#endif
-}
-
-OSVERSIONINFOEX SysVersion::GetFullVersion()
-{
- static const OSVERSIONINFOEX fullVersion = InitFullVersion();
- return fullVersion;
-}
-
-DWORD SysVersion::GetVersion()
-{
- static const DWORD version = MAKEWORD(GetFullVersion().dwMinorVersion, GetFullVersion().dwMajorVersion);
- return version;
-}
-
-bool SysVersion::IsXPOrLater()
-{
- return (GetVersion() >= 0x0501);
-}
-
-bool SysVersion::IsVista()
-{
- return (GetVersion() == 0x0600);
-}
-
-bool SysVersion::IsVistaOrLater()
-{
- return (GetVersion() >= 0x0600);
-}
-
-bool SysVersion::Is7()
-{
- return (GetVersion() == 0x0601);
-}
-
-bool SysVersion::Is7OrLater()
-{
- return (GetVersion() >= 0x0601);
-}
-
-bool SysVersion::Is8()
-{
- return (GetVersion() == 0x0602);
-}
-
-bool SysVersion::Is8OrLater()
-{
- return (GetVersion() >= 0x0602);
-}
-
-bool SysVersion::Is81OrLater()
-{
- return (GetVersion() >= 0x0603);
-}
-
-bool SysVersion::Is10OrLater()
-{
- return (GetVersion() >= 0x0A00);
-}
-
-bool SysVersion::Is64Bit()
-{
- const bool bIs64Bit = InitIs64Bit();
- return bIs64Bit;
-}
diff --git a/src/DSUtil/SysVersion.h b/src/DSUtil/SysVersion.h
deleted file mode 100644
index 8669abe07..000000000
--- a/src/DSUtil/SysVersion.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (C) 2012-2015 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>
-
-namespace SysVersion
-{
- OSVERSIONINFOEX GetFullVersion();
- DWORD GetVersion();
-
- bool IsXPOrLater();
- bool IsVista();
- bool IsVistaOrLater();
- bool Is7();
- bool Is7OrLater();
- bool Is8();
- bool Is8OrLater();
- bool Is81OrLater();
- bool Is10OrLater();
-
- bool Is64Bit();
-};
diff --git a/src/DSUtil/WinAPIUtils.cpp b/src/DSUtil/WinAPIUtils.cpp
index c6c51d53c..3288b691b 100644
--- a/src/DSUtil/WinAPIUtils.cpp
+++ b/src/DSUtil/WinAPIUtils.cpp
@@ -22,7 +22,6 @@
#include <d3d9.h>
#include <Shlobj.h>
#include "WinAPIUtils.h"
-#include "SysVersion.h"
#include "PathUtils.h"
@@ -212,9 +211,6 @@ namespace
{
ZeroMemory(ncm, sizeof(NONCLIENTMETRICS));
ncm->cbSize = sizeof(NONCLIENTMETRICS);
- if (!SysVersion::IsVistaOrLater()) {
- ncm->cbSize -= sizeof(ncm->iPaddedBorderWidth);
- }
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm->cbSize, ncm, 0));
}
}
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
index d882270ee..df3ecaa70 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
@@ -28,7 +28,6 @@
#include "../../../SubPic/SubPicQueueImpl.h"
#include "IPinHook.h"
#include "FocusThread.h"
-#include "../../../DSUtil/SysVersion.h"
#include "../../../DSUtil/vd.h"
#include <mpc-hc_config.h>
@@ -1763,8 +1762,7 @@ void CDX9AllocatorPresenter::InitStats()
ASSERT(FALSE);
}
m_pD3DXCreateFont(m_pD3DDev, newHeight, 0, newHeight < BOLD_THRESHOLD ? FW_NORMAL : FW_BOLD,
- 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
- SysVersion::IsXPOrLater() ? CLEARTYPE_NATURAL_QUALITY : ANTIALIASED_QUALITY,
+ 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLEARTYPE_NATURAL_QUALITY,
FIXED_PITCH | FF_DONTCARE, L"Lucida Console", &m_pFont);
currentHeight = newHeight;
}
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
index e26450504..7d6f0103a 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
@@ -23,7 +23,6 @@
#include "RenderersSettings.h"
#include "../../../mpc-hc/AppSettings.h"
#include "../../../mpc-hc/mplayerc.h"
-#include "../../../DSUtil/SysVersion.h"
#include <d3d9.h>
#include <d3d10.h>
#include <dxgi.h>
@@ -40,7 +39,7 @@ void CRenderersSettings::CAdvRendererSettings::SetDefault()
iVMR9VSyncOffset = 0;
bVMR9VSyncAccurate = false;
bVMR9FullscreenGUISupport = false;
- bVMR9VSync = !SysVersion::IsVistaOrLater();
+ bVMR9VSync = false;
bVMR9FullFloatingPointProcessing = false;
bVMR9HalfFloatingPointProcessing = false;
bVMR9ColorManagementEnable = false;
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.h b/src/filters/renderer/VideoRenderers/RenderersSettings.h
index 8a74fe118..4bba423ca 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.h
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -122,7 +122,6 @@ public:
int iAPSurfaceUsage;
int iDX9Resizer;
bool fVMR9MixerMode;
- bool fVMR9MixerYUV;
int iEvrBuffers;
SubPicQueueSettings subPicQueueSettings;
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index 3abbcbcb4..43ce1ea64 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -43,7 +43,6 @@
#include "IPinHook.h"
#include "PixelShaderCompiler.h"
#include "FocusThread.h"
-#include "../../../DSUtil/SysVersion.h"
#include "../../../DSUtil/vd.h"
#include <mpc-hc_config.h>
@@ -1956,8 +1955,7 @@ void CBaseAP::InitStats()
ASSERT(FALSE);
}
m_pD3DXCreateFont(m_pD3DDev, newHeight, 0, newHeight < BOLD_THRESHOLD ? FW_NORMAL : FW_BOLD,
- 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
- SysVersion::IsXPOrLater() ? CLEARTYPE_NATURAL_QUALITY : ANTIALIASED_QUALITY,
+ 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLEARTYPE_NATURAL_QUALITY,
FIXED_PITCH | FF_DONTCARE, L"Lucida Console", &m_pFont);
currentHeight = newHeight;
}
diff --git a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
index 5a1e43c92..430f32f74 100644
--- a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2006-2014, 2016 see Authors.txt
+ * (C) 2006-2014, 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -26,7 +26,6 @@
#include "IPinHook.h"
#include "MacrovisionKicker.h"
-#include "../../../DSUtil/SysVersion.h"
// ISubPicAllocatorPresenter
@@ -126,10 +125,6 @@ STDMETHODIMP CVMR9AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
// See http://msdn.microsoft.com/en-us/library/dd390928(VS.85).aspx
dwPrefs |= MixerPref9_NonSquareMixing;
dwPrefs |= MixerPref9_NoDecimation;
- if (r.fVMR9MixerYUV && !SysVersion::IsVistaOrLater()) {
- dwPrefs &= ~MixerPref9_RenderTargetMask;
- dwPrefs |= MixerPref9_RenderTargetYUV;
- }
pMC->SetMixingPrefs(dwPrefs);
}
}
diff --git a/src/mpc-hc/AboutDlg.cpp b/src/mpc-hc/AboutDlg.cpp
index 7da4f0355..42560e5f5 100644
--- a/src/mpc-hc/AboutDlg.cpp
+++ b/src/mpc-hc/AboutDlg.cpp
@@ -27,7 +27,6 @@
#include "mplayerc.h"
#include "FileVersionInfo.h"
#include "PathUtils.h"
-#include "SysVersion.h"
#include "VersionInfo.h"
#include "WinapiFunc.h"
#include <afxole.h>
@@ -156,7 +155,12 @@ BOOL CAboutDlg::OnInitDialog()
m_buildDate = VersionInfo::GetBuildDateString();
- OSVERSIONINFOEX osVersion = SysVersion::GetFullVersion();
+#pragma warning(push)
+#pragma warning(disable: 4996)
+ OSVERSIONINFOEX osVersion = { sizeof(OSVERSIONINFOEX) };
+ GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osVersion));
+#pragma warning(pop)
+
m_OSName.Format(_T("Windows NT %1u.%1u (build %u"),
osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.dwBuildNumber);
if (osVersion.szCSDVersion[0]) {
@@ -165,7 +169,14 @@ BOOL CAboutDlg::OnInitDialog()
m_OSName += _T(")");
}
m_OSVersion.Format(_T("%1u.%1u"), osVersion.dwMajorVersion, osVersion.dwMinorVersion);
- if (SysVersion::Is64Bit()) {
+
+#if !defined(_WIN64)
+ // 32-bit programs run on both 32-bit and 64-bit Windows
+ // so must sniff
+ BOOL f64 = FALSE;
+ if (IsWow64Process(GetCurrentProcess(), &f64) && f64)
+#endif
+ {
m_OSVersion += _T(" (64-bit)");
}
diff --git a/src/mpc-hc/AppSettings.cpp b/src/mpc-hc/AppSettings.cpp
index 9fedd4332..1cac947e1 100644
--- a/src/mpc-hc/AppSettings.cpp
+++ b/src/mpc-hc/AppSettings.cpp
@@ -26,15 +26,15 @@
#include "FakeFilterMapper2.h"
#include "FileAssoc.h"
#include "ExceptionHandler.h"
-#include "SysVersion.h"
#include "PathUtils.h"
#include "Translations.h"
#include "UpdateChecker.h"
#include "WinAPIUtils.h"
#include "moreuuids.h"
#include "mplayerc.h"
-#include <mvrInterfaces.h>
#include "../thirdparty/sanear/sanear/src/Factory.h"
+#include <VersionHelpers.h>
+#include <mvrInterfaces.h>
#pragma warning(push)
#pragma warning(disable: 4351) // new behavior: elements of array 'array' will be default initialized
@@ -1339,7 +1339,7 @@ void CAppSettings::LoadSettings()
eLoopMode = static_cast<LoopMode>(pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_LOOPMODE, static_cast<int>(LoopMode::PLAYLIST)));
iZoomLevel = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ZOOM, 1);
iDSVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_DSVIDEORENDERERTYPE,
- (SysVersion::IsVistaOrLater() && IsVideoRendererAvailable(VIDRNDT_DS_EVR_CUSTOM)) ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_VMR9RENDERLESS);
+ IsVideoRendererAvailable(VIDRNDT_DS_EVR_CUSTOM) ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_VMR9RENDERLESS);
iRMVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_RMVIDEORENDERERTYPE, VIDRNDT_RM_DEFAULT);
iQTVideoRendererType = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_QTVIDEORENDERERTYPE, VIDRNDT_QT_DEFAULT);
nVolumeStep = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_VOLUMESTEP, 5);
@@ -1376,18 +1376,14 @@ void CAppSettings::LoadSettings()
strFullScreenMonitor = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_FULLSCREENMONITOR);
// Prevent Minimize when in fullscreen mode on non default monitor
fPreventMinimize = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_PREVENT_MINIMIZE, FALSE);
- bUseEnhancedTaskBar = SysVersion::Is7OrLater() ? !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ENHANCED_TASKBAR, TRUE) : FALSE;
+ bUseEnhancedTaskBar = IsWindows7OrGreater() ? !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ENHANCED_TASKBAR, TRUE) : FALSE;
fUseSearchInFolder = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_SEARCH_IN_FOLDER, TRUE);
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, SysVersion::IsVistaOrLater() ? 18 : 20);
- if (SysVersion::IsVistaOrLater()) {
- LOGFONT lf;
- GetMessageFont(&lf);
- strOSDFont = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_MPC_OSD_FONT, lf.lfFaceName);
- } else {
- strOSDFont = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_MPC_OSD_FONT, _T("Arial"));
- }
+ nOSDSize = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_MPC_OSD_SIZE, 18);
+ LOGFONT lf;
+ GetMessageFont(&lf);
+ strOSDFont = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_MPC_OSD_FONT, lf.lfFaceName);
// Associated types with icon or not...
fAssociatedWithIcons = !!pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ASSOCIATED_WITH_ICON, TRUE);
@@ -1847,7 +1843,6 @@ void CAppSettings::UpdateRenderersData(bool fSave)
pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, r.iAPSurfaceUsage);
pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_DX9_RESIZER, r.iDX9Resizer);
pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_VMR9MIXERMODE, r.fVMR9MixerMode);
- pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_VMR9MIXERYUV, r.fVMR9MixerYUV);
pApp->WriteProfileInt(IDS_R_SETTINGS, _T("VMRAlternateVSync"), ars.bVMR9AlterativeVSync);
pApp->WriteProfileInt(IDS_R_SETTINGS, _T("VMRVSyncOffset"), ars.iVMR9VSyncOffset);
@@ -1897,10 +1892,9 @@ void CAppSettings::UpdateRenderersData(bool fSave)
pApp->WriteProfileString(IDS_R_SETTINGS, IDS_RS_D3D9RENDERDEVICE, r.D3D9RenderDevice);
} else {
- r.iAPSurfaceUsage = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, (SysVersion::IsVistaOrLater() ? VIDRNDT_AP_TEXTURE3D : VIDRNDT_AP_TEXTURE2D));
+ r.iAPSurfaceUsage = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, VIDRNDT_AP_TEXTURE3D);
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);
CRenderersSettings::CAdvRendererSettings DefaultSettings;
ars.bVMR9AlterativeVSync = !!pApp->GetProfileInt(IDS_R_SETTINGS, _T("VMRAlternateVSync"), DefaultSettings.bVMR9AlterativeVSync);
@@ -1953,7 +1947,7 @@ void CAppSettings::UpdateRenderersData(bool fSave)
ars.sShaderCachePath = PathUtils::CombinePaths(ars.sShaderCachePath, IDS_R_SHADER_CACHE);
}
- r.fResetDevice = !!pApp->GetProfileInt(IDS_R_SETTINGS, _T("ResetDevice"), !SysVersion::IsVistaOrLater());
+ r.fResetDevice = !!pApp->GetProfileInt(IDS_R_SETTINGS, _T("ResetDevice"), FALSE);
r.subPicQueueSettings.nSize = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_SPCSIZE, 10);
r.subPicQueueSettings.nMaxRes = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_SPCMAXRES, 0);
@@ -2564,7 +2558,7 @@ void CAppSettings::UpdateSettings()
subrenderer = SubtitleRenderer::VS_FILTER;
}
if (IsSubtitleRendererRegistered(SubtitleRenderer::XY_SUB_FILTER)) {
- int renderer = (SysVersion::IsVistaOrLater() && IsVideoRendererAvailable(VIDRNDT_DS_EVR_CUSTOM)) ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_VMR9RENDERLESS;
+ int renderer = IsVideoRendererAvailable(VIDRNDT_DS_EVR_CUSTOM) ? VIDRNDT_DS_EVR_CUSTOM : VIDRNDT_DS_VMR9RENDERLESS;
renderer = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_DSVIDEORENDERERTYPE, renderer);
if (IsSubtitleRendererSupported(SubtitleRenderer::XY_SUB_FILTER, renderer)) {
subrenderer = SubtitleRenderer::XY_SUB_FILTER;
diff --git a/src/mpc-hc/AuthDlg.cpp b/src/mpc-hc/AuthDlg.cpp
index 6c0b2af2d..ddb06bd24 100644
--- a/src/mpc-hc/AuthDlg.cpp
+++ b/src/mpc-hc/AuthDlg.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -21,8 +21,6 @@
#include "stdafx.h"
#include "AuthDlg.h"
-#include "SysVersion.h"
-#include "VersionInfo.h"
// We need to dynamically link to the functions provided by CredUI.lib in order
// to be able to use the features available to the OS.
@@ -40,88 +38,55 @@ HRESULT PromptForCredentials(HWND hWnd, const CString& strCaptionText, const CSt
DWORD dwPassword = CREDUI_MAX_PASSWORD_LENGTH + 1;
DWORD dwDomain = CREDUI_MAX_GENERIC_TARGET_LENGTH + 1;
- if (SysVersion::IsVistaOrLater()) {
- // Define CredUI.dll functions for Windows Vista+
- const WinapiFunc<decltype(CredPackAuthenticationBufferW)>
- fnCredPackAuthenticationBufferW = { _T("CREDUI.DLL"), "CredPackAuthenticationBufferW" };
-
- const WinapiFunc<decltype(CredUIPromptForWindowsCredentialsW)>
- fnCredUIPromptForWindowsCredentialsW = { _T("CREDUI.DLL"), "CredUIPromptForWindowsCredentialsW" };
-
- const WinapiFunc<decltype(CredUnPackAuthenticationBufferW)>
- fnCredUnPackAuthenticationBufferW = { _T("CREDUI.DLL"), "CredUnPackAuthenticationBufferW" };
-
- if (fnCredPackAuthenticationBufferW && fnCredUIPromptForWindowsCredentialsW && fnCredUnPackAuthenticationBufferW) {
- PVOID pvInAuthBlob = nullptr;
- ULONG cbInAuthBlob = 0;
- PVOID pvAuthBlob = nullptr;
- ULONG cbAuthBlob = 0;
- ULONG ulAuthPackage = 0;
-
- // Call CredPackAuthenticationBufferW once to determine the size, in bytes, of the authentication buffer.
- if (strUsername.GetLength()) {
- BOOL bResult = fnCredPackAuthenticationBufferW(0, (LPTSTR)(LPCTSTR)strUsername, (LPTSTR)(LPCTSTR)strPassword, nullptr, &cbInAuthBlob);
- if (!bResult && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- if ((pvInAuthBlob = CoTaskMemAlloc(cbInAuthBlob)) != nullptr) {
- VERIFY(fnCredPackAuthenticationBufferW(0, (LPTSTR)(LPCTSTR)strUsername, (LPTSTR)(LPCTSTR)strPassword, (PBYTE)pvInAuthBlob, &cbInAuthBlob));
- }
+ // Define CredUI.dll functions for Windows Vista+
+ const WinapiFunc<decltype(CredPackAuthenticationBufferW)>
+ fnCredPackAuthenticationBufferW = { _T("CREDUI.DLL"), "CredPackAuthenticationBufferW" };
+
+ const WinapiFunc<decltype(CredUIPromptForWindowsCredentialsW)>
+ fnCredUIPromptForWindowsCredentialsW = { _T("CREDUI.DLL"), "CredUIPromptForWindowsCredentialsW" };
+
+ const WinapiFunc<decltype(CredUnPackAuthenticationBufferW)>
+ fnCredUnPackAuthenticationBufferW = { _T("CREDUI.DLL"), "CredUnPackAuthenticationBufferW" };
+
+ if (fnCredPackAuthenticationBufferW && fnCredUIPromptForWindowsCredentialsW && fnCredUnPackAuthenticationBufferW) {
+ PVOID pvInAuthBlob = nullptr;
+ ULONG cbInAuthBlob = 0;
+ PVOID pvAuthBlob = nullptr;
+ ULONG cbAuthBlob = 0;
+ ULONG ulAuthPackage = 0;
+
+ // Call CredPackAuthenticationBufferW once to determine the size, in bytes, of the authentication buffer.
+ if (strUsername.GetLength()) {
+ BOOL bResult = fnCredPackAuthenticationBufferW(0, (LPTSTR)(LPCTSTR)strUsername, (LPTSTR)(LPCTSTR)strPassword, nullptr, &cbInAuthBlob);
+ if (!bResult && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+ if ((pvInAuthBlob = CoTaskMemAlloc(cbInAuthBlob)) != nullptr) {
+ VERIFY(fnCredPackAuthenticationBufferW(0, (LPTSTR)(LPCTSTR)strUsername, (LPTSTR)(LPCTSTR)strPassword, (PBYTE)pvInAuthBlob, &cbInAuthBlob));
}
}
- const DWORD dwFlags = CREDUIWIN_GENERIC | CREDUIWIN_ENUMERATE_CURRENT_USER | (bSave ? CREDUIWIN_CHECKBOX : 0);
- DWORD dwResult = fnCredUIPromptForWindowsCredentialsW(&info, 0, &ulAuthPackage, pvInAuthBlob, cbInAuthBlob, &pvAuthBlob, &cbAuthBlob, bSave, dwFlags);
- if (dwResult == ERROR_SUCCESS) {
- VERIFY(fnCredUnPackAuthenticationBufferW(0, pvAuthBlob, cbAuthBlob, strUsername.GetBufferSetLength(dwUsername), &dwUsername, strDomain.GetBufferSetLength(dwDomain), &dwDomain, strPassword.GetBufferSetLength(dwPassword), &dwPassword));
- strUsername.ReleaseBuffer();
- strPassword.ReleaseBuffer();
- strDomain.ReleaseBuffer();
- }
-
- // Delete the input authentication byte array.
- if (pvInAuthBlob) {
- SecureZeroMemory(pvInAuthBlob, cbInAuthBlob);
- CoTaskMemFree(pvInAuthBlob);
- pvInAuthBlob = nullptr;
- }
- // Delete the output authentication byte array.
- if (pvAuthBlob) {
- SecureZeroMemory(pvAuthBlob, cbAuthBlob);
- CoTaskMemFree(pvAuthBlob);
- pvAuthBlob = nullptr;
- }
- return dwResult; // ERROR_SUCCESS / ERROR_CANCELLED
}
- } else if (SysVersion::IsXPOrLater()) {
- // Define CredUI.dll functions for Windows XP
- const WinapiFunc<decltype(CredUIPromptForCredentialsW)>
- fnCredUIPromptForCredentialsW = { _T("CREDUI.DLL"), "CredUIPromptForCredentialsW" };
-
- const WinapiFunc<decltype(CredUIParseUserNameW)>
- fnCredUIParseUserNameW = { _T("CREDUI.DLL"), "CredUIParseUserNameW" };
-
- if (fnCredUIPromptForCredentialsW && fnCredUIParseUserNameW) {
- const DWORD dwAuthError = 0;
- const DWORD dwFlags = CREDUI_FLAGS_ALWAYS_SHOW_UI | CREDUI_FLAGS_GENERIC_CREDENTIALS/* | CREDUI_FLAGS_EXPECT_CONFIRMATION*/ | CREDUI_FLAGS_COMPLETE_USERNAME | CREDUI_FLAGS_DO_NOT_PERSIST | (bSave ? CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX : 0);
- CString strUserDomain(strUsername);
- if (!strDomain.GetLength()) {
- strDomain = _T("mpc-hc/") + VersionInfo::GetVersionString();
- }
-
- DWORD dwResult = fnCredUIPromptForCredentialsW(&info, strDomain.Left(dwDomain), nullptr, dwAuthError,
- strUserDomain.GetBufferSetLength(dwUsername), dwUsername, strPassword.GetBufferSetLength(dwPassword), dwPassword, bSave, dwFlags);
- strUserDomain.ReleaseBuffer();
- strPassword.ReleaseBuffer();
-
- fnCredUIParseUserNameW(strUserDomain, strUsername.GetBufferSetLength(dwUsername), dwUsername, strDomain.GetBufferSetLength(dwDomain), dwDomain);
+ const DWORD dwFlags = CREDUIWIN_GENERIC | CREDUIWIN_ENUMERATE_CURRENT_USER | (bSave ? CREDUIWIN_CHECKBOX : 0);
+ DWORD dwResult = fnCredUIPromptForWindowsCredentialsW(&info, 0, &ulAuthPackage, pvInAuthBlob, cbInAuthBlob, &pvAuthBlob, &cbAuthBlob, bSave, dwFlags);
+ if (dwResult == ERROR_SUCCESS) {
+ VERIFY(fnCredUnPackAuthenticationBufferW(0, pvAuthBlob, cbAuthBlob, strUsername.GetBufferSetLength(dwUsername), &dwUsername, strDomain.GetBufferSetLength(dwDomain), &dwDomain, strPassword.GetBufferSetLength(dwPassword), &dwPassword));
strUsername.ReleaseBuffer();
+ strPassword.ReleaseBuffer();
strDomain.ReleaseBuffer();
- //dwResult = CredUIConfirmCredentials(szDomain.Left(cchDomain), TRUE);
-
- if (strDomain == _T("mpc-hc/") + VersionInfo::GetVersionString()) {
- strDomain.Empty();
- }
+ }
- return dwResult; // ERROR_SUCCESS / ERROR_CANCELLED
+ // Delete the input authentication byte array.
+ if (pvInAuthBlob) {
+ SecureZeroMemory(pvInAuthBlob, cbInAuthBlob);
+ CoTaskMemFree(pvInAuthBlob);
+ pvInAuthBlob = nullptr;
}
+ // Delete the output authentication byte array.
+ if (pvAuthBlob) {
+ SecureZeroMemory(pvAuthBlob, cbAuthBlob);
+ CoTaskMemFree(pvAuthBlob);
+ pvAuthBlob = nullptr;
+ }
+ return dwResult; // ERROR_SUCCESS / ERROR_CANCELLED
}
+
return ERROR_CALL_NOT_IMPLEMENTED;
}
diff --git a/src/mpc-hc/FGFilterLAV.cpp b/src/mpc-hc/FGFilterLAV.cpp
index f72d263bb..fe50b712a 100644
--- a/src/mpc-hc/FGFilterLAV.cpp
+++ b/src/mpc-hc/FGFilterLAV.cpp
@@ -21,7 +21,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "PathUtils.h"
-#include "SysVersion.h"
#include "../filters/InternalPropertyPage.h"
#include "../filters/PinInfoWnd.h"
#include <FileVersionInfo.h>
@@ -612,26 +611,7 @@ void CFGFilterLAVVideo::Settings::LoadSettings()
dwHWAccel = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWAccel"), -1);
if (dwHWAccel == DWORD(-1)) {
- dwHWAccel = HWAccel_None; // Ensure that a valid state is selected if no HW acceleration is available
-
- // We enable by default DXVA2 native on Vista+ and CUVID on XP if an NVIDIA adapter is found
- if (SysVersion::IsVistaOrLater()) {
- dwHWAccel = HWAccel_DXVA2Native;
- } else {
- const WinapiFunc<decltype(Direct3DCreate9)> fnDirect3DCreate9 = { _T("d3d9.dll"), "Direct3DCreate9" };
- CComPtr<IDirect3D9> pD3D9;
- if (fnDirect3DCreate9 && (pD3D9 = fnDirect3DCreate9(D3D_SDK_VERSION))) {
- D3DADAPTER_IDENTIFIER9 adapterIdentifier;
-
- for (UINT adp = 0, num_adp = pD3D9->GetAdapterCount(); adp < num_adp; ++adp) {
- if (pD3D9->GetAdapterIdentifier(adp, 0, &adapterIdentifier) == S_OK
- && adapterIdentifier.VendorId == 0x10DE) {
- dwHWAccel = HWAccel_CUDA;
- break;
- }
- }
- }
- }
+ dwHWAccel = HWAccel_DXVA2Native;
}
bHWFormats[HWCodec_H264] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("h264"), bHWFormats[HWCodec_H264]);
diff --git a/src/mpc-hc/FGManagerBDA.cpp b/src/mpc-hc/FGManagerBDA.cpp
index 0c48d65c4..22ed25a11 100644
--- a/src/mpc-hc/FGManagerBDA.cpp
+++ b/src/mpc-hc/FGManagerBDA.cpp
@@ -24,7 +24,6 @@
#include "MainFrm.h"
#include "Logger.h"
#include <ISOLang.h>
-#include <SysVersion.h>
#include <moreuuids.h>
#include <dvdmedia.h>
#include <ks.h>
@@ -342,13 +341,7 @@ CFGManagerBDA::CFGManagerBDA(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd)
m_DVBStreams[DVB_PSI] = CDVBStream(L"psi", &mt_Psi, true, MEDIA_MPEG2_PSI);
m_DVBStreams[DVB_TIF] = CDVBStream(L"tif", &mt_Tif, true);
m_DVBStreams[DVB_EPG] = CDVBStream(L"epg", &mt_Epg);
-
- // Warning : MEDIA_ELEMENTARY_STREAM didn't work for subtitles with Windows XP!
- 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);
- }
+ m_DVBStreams[DVB_SUB] = CDVBStream(L"sub", &mt_Subtitle/*, false, MEDIA_TRANSPORT_PAYLOAD*/);
if (pChannel) {
m_nCurVideoType = pChannel->GetVideoType();
diff --git a/src/mpc-hc/FileAssoc.cpp b/src/mpc-hc/FileAssoc.cpp
index 8a8215830..8c4578de1 100644
--- a/src/mpc-hc/FileAssoc.cpp
+++ b/src/mpc-hc/FileAssoc.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014, 2016 see Authors.txt
+ * (C) 2006-2014, 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -20,10 +20,10 @@
*/
#include "stdafx.h"
+#include <VersionHelpers.h>
#include "mplayerc.h"
#include "FileAssoc.h"
#include "resource.h"
-#include "SysVersion.h"
#include "PathUtils.h"
@@ -166,7 +166,7 @@ bool CFileAssoc::Register(CString ext, CString strLabel, bool bRegister, bool bR
if (!bRegister) {
// On Windows 8, an app can't set itself as the default handler for a format
- if (!SysVersion::Is8OrLater() && bRegister != IsRegistered(ext)) {
+ if (!IsWindows8OrGreater() && bRegister != IsRegistered(ext)) {
SetFileAssociation(ext, strProgID, bRegister);
}
@@ -255,7 +255,7 @@ bool CFileAssoc::Register(CString ext, CString strLabel, bool bRegister, bool bR
}
// On Windows 8, an app can't set itself as the default handler for a format
- if (!SysVersion::Is8OrLater() && bRegister != IsRegistered(ext)) {
+ if (!IsWindows8OrGreater() && bRegister != IsRegistered(ext)) {
SetFileAssociation(ext, strProgID, bRegister);
}
@@ -386,7 +386,7 @@ bool CFileAssoc::IsRegistered(CString ext) const
BOOL bIsDefault = FALSE;
CString strProgID = PROGID + ext;
- if (SysVersion::Is8OrLater()) {
+ if (IsWindows8OrGreater()) {
// The Eight way
bIsDefault = TRUE; // Check only if MPC-HC is registered as able to handle that format, not if it's the default.
} else if (m_pAAR) {
@@ -778,7 +778,7 @@ void CFileAssoc::CheckIconsAssocThread()
if (nCurrentVersion != nLastVersion && GetAssociatedExtensionsFromRegistry(registeredExts)) {
iconLib->SaveVersion();
- if (SysVersion::IsVistaOrLater() && !IsUserAnAdmin()) {
+ if (!IsUserAnAdmin()) {
TASKDIALOGCONFIG config;
ZeroMemory(&config, sizeof(TASKDIALOGCONFIG));
config.cbSize = sizeof(config);
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index 175ceea75..5ff487755 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -100,6 +100,7 @@
#include <dvdevcod.h>
#include <dvdmedia.h>
#include <strsafe.h>
+#include <VersionHelpers.h>
#include <initguid.h>
#include <qnetwork.h>
@@ -833,7 +834,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
return -1;
}
- if (SysVersion::Is81OrLater()) {
+ if (IsWindows8Point1OrGreater()) {
m_dpi.Override(m_hWnd);
}
@@ -4056,7 +4057,7 @@ void CMainFrame::OnFileOpendvd()
if (s.fUseDVDPath && !s.strDVDPath.IsEmpty()) {
path = s.strDVDPath;
- } else if (SysVersion::IsVistaOrLater()) {
+ } else {
CFileDialog dlg(TRUE);
IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
@@ -4071,25 +4072,6 @@ void CMainFrame::OnFileOpendvd()
path = dlg.GetFolderPath();
}
- } else {
- TCHAR _path[MAX_PATH];
-
- BROWSEINFO bi;
- bi.hwndOwner = m_hWnd;
- bi.pidlRoot = nullptr;
- bi.pszDisplayName = _path;
- bi.lpszTitle = strTitle;
- bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_VALIDATE | BIF_USENEWUI | BIF_NONEWFOLDERBUTTON;
- bi.lpfn = BrowseCallbackProc;
- bi.lParam = 0;
- bi.iImage = 0;
-
- static PIDLIST_ABSOLUTE iil;
- iil = SHBrowseForFolder(&bi);
- if (iil) {
- SHGetPathFromIDList(iil, _path);
- path = _path;
- }
}
if (!path.IsEmpty()) {
@@ -5505,7 +5487,7 @@ void CMainFrame::OnUpdateViewDisableDesktopComposition(CCmdUI* pCmdUI)
|| s.iDSVideoRendererType == VIDRNDT_DS_EVR_CUSTOM
|| s.iDSVideoRendererType == VIDRNDT_DS_SYNC)
&& r.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D
- && (SysVersion::IsVista() || SysVersion::Is7()));
+ && !IsWindows8OrGreater());
pCmdUI->Enable(supported);
pCmdUI->SetCheck(supported && r.m_AdvRendSets.bVMRDisableDesktopComposition);
@@ -9258,7 +9240,7 @@ CRect CMainFrame::GetInvisibleBorderSize() const
{
CRect invisibleBorders;
- if (SysVersion::Is10OrLater()) {
+ if (IsWindows10OrGreater()) {
static const WinapiFunc<decltype(DwmGetWindowAttribute)>
fnDwmGetWindowAttribute = { _T("Dwmapi.dll"), "DwmGetWindowAttribute" };
@@ -9971,7 +9953,7 @@ CSize CMainFrame::GetZoomWindowSize(double dScale)
if (workRect.Width() && workRect.Height()) {
// account for invisible borders on Windows 10 by allowing
// the window to go out of screen a bit
- if (SysVersion::Is10OrLater()) {
+ if (IsWindows10OrGreater()) {
workRect.InflateRect(GetInvisibleBorderSize());
}
@@ -10020,7 +10002,7 @@ CRect CMainFrame::GetZoomWindowRect(const CSize& size)
CRect rcWork = mi.rcWork;
// account for invisible borders on Windows 10 by allowing
// the window to go out of screen a bit
- if (SysVersion::Is10OrLater()) {
+ if (IsWindows10OrGreater()) {
rcWork.InflateRect(GetInvisibleBorderSize());
}
@@ -10144,7 +10126,7 @@ double CMainFrame::GetZoomAutoFitScale(bool bLargerOnly)
decorationsSize.cy += 2 * ::GetSystemMetrics(SM_CYSIZEFRAME);
// account for invisible borders on Windows 10
- if (SysVersion::Is10OrLater()) {
+ if (IsWindows10OrGreater()) {
RECT invisibleBorders = GetInvisibleBorderSize();
decorationsSize.cx -= (invisibleBorders.left + invisibleBorders.right);
@@ -13995,11 +13977,7 @@ void CMainFrame::SeekTo(REFERENCE_TIME rtPos, bool bShowOSD /*= true*/)
m_pMS->SetPositions(&rtPos, AM_SEEKING_AbsolutePositioning, nullptr, AM_SEEKING_NoPositioning);
UpdateChapterInInfoBar();
} else if (GetPlaybackMode() == PM_DVD && m_iDVDDomain == DVD_DOMAIN_Title) {
- if (!SysVersion::IsVistaOrLater() && fs != State_Running) {
- // DVD Navigator hangs on XP if we call IDvdControl2::PlayAtTime twice in paused state.
- SendMessage(WM_COMMAND, ID_PLAY_PLAY);
- fs = State_Running;
- } else if (fs == State_Stopped) {
+ if (fs == State_Stopped) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
fs = State_Paused;
}
@@ -15891,56 +15869,26 @@ void CMainFrame::OnFileOpendirectory()
CString strTitle(StrRes(IDS_MAINFRM_DIR_TITLE));
CString path;
- if (SysVersion::IsVistaOrLater()) {
- CFileDialog dlg(TRUE);
- dlg.AddCheckButton(IDS_MAINFRM_DIR_CHECK, ResStr(IDS_MAINFRM_DIR_CHECK), TRUE);
- IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
+ CFileDialog dlg(TRUE);
+ dlg.AddCheckButton(IDS_MAINFRM_DIR_CHECK, ResStr(IDS_MAINFRM_DIR_CHECK), TRUE);
+ IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
- if (openDlgPtr != nullptr) {
- openDlgPtr->SetTitle(strTitle);
- openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
- if (FAILED(openDlgPtr->Show(m_hWnd))) {
- openDlgPtr->Release();
- return;
- }
+ if (openDlgPtr != nullptr) {
+ openDlgPtr->SetTitle(strTitle);
+ openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
+ if (FAILED(openDlgPtr->Show(m_hWnd))) {
openDlgPtr->Release();
-
- path = dlg.GetFolderPath();
-
- BOOL recur = TRUE;
- dlg.GetCheckButtonState(IDS_MAINFRM_DIR_CHECK, recur);
- COpenDirHelper::m_incl_subdir = !!recur;
- } else {
return;
}
+ openDlgPtr->Release();
+
+ path = dlg.GetFolderPath();
+
+ BOOL recur = TRUE;
+ dlg.GetCheckButtonState(IDS_MAINFRM_DIR_CHECK, recur);
+ COpenDirHelper::m_incl_subdir = !!recur;
} else {
- CString filter;
- CAtlArray<CString> mask;
- s.m_Formats.GetFilter(filter, mask);
-
- COpenDirHelper::strLastOpenDir = s.strLastOpenDir;
-
- TCHAR _path[MAX_PATH];
- COpenDirHelper::m_incl_subdir = TRUE;
-
- BROWSEINFO bi;
- bi.hwndOwner = m_hWnd;
- bi.pidlRoot = nullptr;
- bi.pszDisplayName = _path;
- bi.lpszTitle = strTitle;
- bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_VALIDATE | BIF_STATUSTEXT;
- bi.lpfn = COpenDirHelper::BrowseCallbackProcDIR;
- bi.lParam = 0;
- bi.iImage = 0;
-
- static PIDLIST_ABSOLUTE iil;
- iil = SHBrowseForFolder(&bi);
- if (iil) {
- SHGetPathFromIDList(iil, _path);
- } else {
- return;
- }
- path = _path;
+ return;
}
// If we got a link file that points to a directory, follow the link
@@ -15967,7 +15915,7 @@ void CMainFrame::OnFileOpendirectory()
HRESULT CMainFrame::CreateThumbnailToolbar()
{
- if (!AfxGetAppSettings().bUseEnhancedTaskBar || !SysVersion::Is7OrLater()) {
+ if (!AfxGetAppSettings().bUseEnhancedTaskBar || !IsWindows7OrGreater()) {
return E_FAIL;
}
diff --git a/src/mpc-hc/MouseTouch.h b/src/mpc-hc/MouseTouch.h
index 8dbb32dc5..df1c1e352 100644
--- a/src/mpc-hc/MouseTouch.h
+++ b/src/mpc-hc/MouseTouch.h
@@ -1,5 +1,5 @@
/*
- * (C) 2013-2015 see Authors.txt
+ * (C) 2013-2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -22,9 +22,9 @@
#include <map>
#include <unordered_set>
+#include <VersionHelpers.h>
#include "EventDispatcher.h"
-#include "SysVersion.h"
// TODO: handle touch gestures
@@ -219,7 +219,7 @@ class CMouseWheelHook
public:
CMouseWheelHook() {
- if (SysVersion::Is10OrLater()) {
+ if (IsWindows10OrGreater()) {
m_hHook = SetWindowsHookEx(WH_MOUSE, MouseProc, nullptr, GetCurrentThreadId());
ASSERT(m_hHook);
}
diff --git a/src/mpc-hc/PPageDVD.cpp b/src/mpc-hc/PPageDVD.cpp
index 697dcc51b..d9cf155e5 100644
--- a/src/mpc-hc/PPageDVD.cpp
+++ b/src/mpc-hc/PPageDVD.cpp
@@ -23,7 +23,6 @@
#include "mplayerc.h"
#include "MainFrm.h"
#include "PPageDVD.h"
-#include "SysVersion.h"
struct {
@@ -283,40 +282,19 @@ void CPPageDVD::OnBnClickedButton1()
{
CString path;
CString strTitle(StrRes(IDS_MAINFRM_46));
+ CFileDialog dlg(TRUE);
+ IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
- if (SysVersion::IsVistaOrLater()) {
- CFileDialog dlg(TRUE);
- IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
-
- if (openDlgPtr != nullptr) {
- openDlgPtr->SetTitle(strTitle);
- openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
- if (FAILED(openDlgPtr->Show(m_hWnd))) {
- openDlgPtr->Release();
- return;
- }
+ if (openDlgPtr != nullptr) {
+ openDlgPtr->SetTitle(strTitle);
+ openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
+ if (FAILED(openDlgPtr->Show(m_hWnd))) {
openDlgPtr->Release();
-
- path = dlg.GetFolderPath();
- }
- } else {
- TCHAR _path[MAX_PATH];
-
- BROWSEINFO bi;
- bi.hwndOwner = m_hWnd;
- bi.pidlRoot = nullptr;
- bi.pszDisplayName = _path;
- bi.lpszTitle = strTitle;
- bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_VALIDATE | BIF_USENEWUI | BIF_NONEWFOLDERBUTTON;
- bi.lpfn = nullptr;
- bi.lParam = 0;
- bi.iImage = 0;
-
- PIDLIST_ABSOLUTE iil = SHBrowseForFolder(&bi);
- if (iil) {
- SHGetPathFromIDList(iil, _path);
- path = _path;
+ return;
}
+ openDlgPtr->Release();
+
+ path = dlg.GetFolderPath();
}
if (!path.IsEmpty()) {
diff --git a/src/mpc-hc/PPageFormats.cpp b/src/mpc-hc/PPageFormats.cpp
index 0fdeccb03..5c287324b 100644
--- a/src/mpc-hc/PPageFormats.cpp
+++ b/src/mpc-hc/PPageFormats.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2015 see Authors.txt
+ * (C) 2006-2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -20,11 +20,11 @@
*/
#include "stdafx.h"
+#include <VersionHelpers.h>
#include "mplayerc.h"
#include "PPageFormats.h"
#include "FileAssoc.h"
#include "PathUtils.h"
-#include "SysVersion.h"
#include <psapi.h>
#include <string>
#include <atlimage.h>
@@ -223,7 +223,7 @@ BOOL CPPageFormats::OnInitDialog()
SetButtonIcon(IDC_ASSOCIATE_VIDEO_FORMATS, IDB_CHECK_VIDEO);
SetButtonIcon(IDC_CLEAR_ALL_ASSOCIATIONS, IDB_UNCHECK_ALL);
- if (SysVersion::IsVistaOrLater() && !IsUserAnAdmin()) {
+ if (!IsUserAnAdmin()) {
GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
GetDlgItem(IDC_ASSOCIATE_ALL_FORMATS)->EnableWindow(FALSE);
GetDlgItem(IDC_ASSOCIATE_AUDIO_FORMATS)->EnableWindow(FALSE);
@@ -251,7 +251,7 @@ BOOL CPPageFormats::OnInitDialog()
GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);
}
- if (SysVersion::Is8OrLater()) {
+ if (IsWindows8OrGreater()) {
GetDlgItem(IDC_BUTTON7)->ShowWindow(SW_SHOW);
auto offsetControlBottomRight = [this](int nID, int dx, int dy) {
diff --git a/src/mpc-hc/PPageOutput.cpp b/src/mpc-hc/PPageOutput.cpp
index f39768681..1459ce244 100644
--- a/src/mpc-hc/PPageOutput.cpp
+++ b/src/mpc-hc/PPageOutput.cpp
@@ -22,7 +22,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "PPageOutput.h"
-#include "SysVersion.h"
#include "moreuuids.h"
#include "Monitors.h"
#include "MPCPngImage.h"
@@ -43,7 +42,6 @@ CPPageOutput::CPPageOutput()
, m_lastSubrenderer{false, CAppSettings::SubtitleRenderer::INTERNAL}
, m_iDX9Resizer(0)
, m_fVMR9MixerMode(FALSE)
- , m_fVMR9MixerYUV(FALSE)
, m_fD3DFullscreen(FALSE)
, m_fVMR9AlterativeVSync(FALSE)
, m_fResetDevice(FALSE)
@@ -91,7 +89,6 @@ void CPPageOutput::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_FULLSCREEN_MONITOR_CHECK, m_fD3DFullscreen);
DDX_Check(pDX, IDC_DSVMR9ALTERNATIVEVSYNC, m_fVMR9AlterativeVSync);
DDX_Check(pDX, IDC_DSVMR9LOADMIXER, m_fVMR9MixerMode);
- DDX_Check(pDX, IDC_DSVMR9YUVMIXER, m_fVMR9MixerYUV);
DDX_CBString(pDX, IDC_EVR_BUFFERS, m_iEvrBuffers);
}
@@ -103,7 +100,6 @@ BEGIN_MESSAGE_MAP(CPPageOutput, CPPageBase)
ON_CBN_SELCHANGE(IDC_DX_SURFACE, &CPPageOutput::OnSurfaceChange)
ON_BN_CLICKED(IDC_D3D9DEVICE, OnD3D9DeviceCheck)
ON_BN_CLICKED(IDC_FULLSCREEN_MONITOR_CHECK, OnFullscreenCheck)
- ON_UPDATE_COMMAND_UI(IDC_DSVMR9YUVMIXER, OnUpdateMixerYUV)
END_MESSAGE_MAP()
// CPPageOutput message handlers
@@ -136,7 +132,6 @@ BOOL CPPageOutput::OnInitDialog()
m_iDX9Resizer = r.iDX9Resizer;
m_fVMR9MixerMode = r.fVMR9MixerMode;
- m_fVMR9MixerYUV = r.fVMR9MixerYUV;
m_fVMR9AlterativeVSync = r.m_AdvRendSets.bVMR9AlterativeVSync;
m_fD3DFullscreen = s.fD3DFullscreen;
@@ -210,13 +205,11 @@ BOOL CPPageOutput::OnInitDialog()
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount() - 1;
}
- if (SysVersion::IsVistaOrLater()) {
- Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_INTERNAL_REND));
- m_AudioRendererDisplayNames.Add(AUDRNDT_INTERNAL);
- m_iAudioRendererTypeCtrl.AddString(Cbstr);
- if (s.strAudioRendererDisplayName == AUDRNDT_INTERNAL && m_iAudioRendererType == 0) {
- m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount() - 1;
- }
+ Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_INTERNAL_REND));
+ m_AudioRendererDisplayNames.Add(AUDRNDT_INTERNAL);
+ m_iAudioRendererTypeCtrl.AddString(Cbstr);
+ if (s.strAudioRendererDisplayName == AUDRNDT_INTERNAL && m_iAudioRendererType == 0) {
+ m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount() - 1;
}
CorrectComboListWidth(m_iAudioRendererTypeCtrl);
@@ -386,11 +379,6 @@ BOOL CPPageOutput::OnInitDialog()
OnQTRendererChange();
OnSurfaceChange();
- // YUV mixing is incompatible with Vista+
- if (SysVersion::IsVistaOrLater()) {
- GetDlgItem(IDC_DSVMR9YUVMIXER)->EnableWindow(FALSE);
- }
-
CheckDlgButton(IDC_D3D9DEVICE, BST_CHECKED);
GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(TRUE);
@@ -446,7 +434,6 @@ BOOL CPPageOutput::OnApply()
r.iAPSurfaceUsage = m_iAPSurfaceUsage;
r.iDX9Resizer = m_iDX9Resizer;
r.fVMR9MixerMode = !!m_fVMR9MixerMode;
- r.fVMR9MixerYUV = !!m_fVMR9MixerYUV;
r.m_AdvRendSets.bVMR9AlterativeVSync = m_fVMR9AlterativeVSync != FALSE;
s.strAudioRendererDisplayName = m_AudioRendererDisplayNames[m_iAudioRendererType];
s.fD3DFullscreen = m_fD3DFullscreen ? true : false;
@@ -470,11 +457,6 @@ BOOL CPPageOutput::OnApply()
return __super::OnApply();
}
-void CPPageOutput::OnUpdateMixerYUV(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(!!IsDlgButtonChecked(IDC_DSVMR9LOADMIXER) && (m_iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS) && !SysVersion::IsVistaOrLater());
-}
-
void CPPageOutput::OnSurfaceChange()
{
UpdateData();
@@ -518,7 +500,6 @@ void CPPageOutput::OnDSRendererChange()
GetDlgItem(IDC_DX9RESIZER_COMBO)->EnableWindow(FALSE);
GetDlgItem(IDC_FULLSCREEN_MONITOR_CHECK)->EnableWindow(FALSE);
GetDlgItem(IDC_DSVMR9LOADMIXER)->EnableWindow(FALSE);
- GetDlgItem(IDC_DSVMR9YUVMIXER)->EnableWindow(FALSE);
GetDlgItem(IDC_DSVMR9ALTERNATIVEVSYNC)->EnableWindow(FALSE);
GetDlgItem(IDC_RESETDEVICE)->EnableWindow(FALSE);
GetDlgItem(IDC_CACHESHADERS)->EnableWindow(FALSE);
@@ -549,18 +530,13 @@ void CPPageOutput::OnDSRendererChange()
break;
case VIDRNDT_DS_OVERLAYMIXER:
m_wndToolTip.UpdateTipText(ResStr(IDC_DSOVERLAYMIXER), GetDlgItem(IDC_VIDRND_COMBO));
- if (!SysVersion::IsVistaOrLater()) {
- m_iDSDXVASupport.SetIcon(m_tick);
- }
break;
case VIDRNDT_DS_VMR9WINDOWED:
m_iDSSaveImageSupport.SetIcon(m_tick);
m_wndToolTip.UpdateTipText(ResStr(IDC_DSVMR9WIN), GetDlgItem(IDC_VIDRND_COMBO));
break;
case VIDRNDT_DS_EVR:
- if (SysVersion::IsVistaOrLater()) {
- m_iDSDXVASupport.SetIcon(m_tick);
- }
+ m_iDSDXVASupport.SetIcon(m_tick);
m_iDSSaveImageSupport.SetIcon(m_tick);
break;
case VIDRNDT_DS_NULL_COMP:
@@ -571,7 +547,6 @@ void CPPageOutput::OnDSRendererChange()
break;
case VIDRNDT_DS_VMR9RENDERLESS:
GetDlgItem(IDC_DSVMR9LOADMIXER)->EnableWindow(TRUE);
- GetDlgItem(IDC_DSVMR9YUVMIXER)->EnableWindow(TRUE);
GetDlgItem(IDC_DSVMR9ALTERNATIVEVSYNC)->EnableWindow(TRUE);
GetDlgItem(IDC_RESETDEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_CACHESHADERS)->EnableWindow(TRUE);
@@ -579,9 +554,6 @@ void CPPageOutput::OnDSRendererChange()
GetDlgItem(IDC_DX9RESIZER_COMBO)->EnableWindow(TRUE);
GetDlgItem(IDC_FULLSCREEN_MONITOR_CHECK)->EnableWindow(TRUE);
- if (!SysVersion::IsVistaOrLater()) {
- m_iDSDXVASupport.SetIcon(m_tick);
- }
if (m_iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) {
m_iDSShaderSupport.SetIcon(m_tick);
m_iDSRotationSupport.SetIcon(m_tick);
@@ -606,9 +578,7 @@ void CPPageOutput::OnDSRendererChange()
GetDlgItem(IDC_DX_SURFACE)->EnableWindow(FALSE);
((CComboBox*)GetDlgItem(IDC_DX_SURFACE))->SetCurSel(2);
- if (SysVersion::IsVistaOrLater()) {
- m_iDSDXVASupport.SetIcon(m_tick);
- }
+ m_iDSDXVASupport.SetIcon(m_tick);
m_iDSSaveImageSupport.SetIcon(m_tick);
m_iDSShaderSupport.SetIcon(m_tick);
m_iDSRotationSupport.SetIcon(m_tick);
diff --git a/src/mpc-hc/PPageOutput.h b/src/mpc-hc/PPageOutput.h
index 2db2f8619..9aabe0085 100644
--- a/src/mpc-hc/PPageOutput.h
+++ b/src/mpc-hc/PPageOutput.h
@@ -75,7 +75,6 @@ public:
std::pair<bool, CAppSettings::SubtitleRenderer> m_lastSubrenderer;
int m_iDX9Resizer;
BOOL m_fVMR9MixerMode;
- BOOL m_fVMR9MixerYUV;
BOOL m_fD3DFullscreen;
BOOL m_fVMR9AlterativeVSync;
BOOL m_fResetDevice;
@@ -94,7 +93,6 @@ protected:
DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnUpdateMixerYUV(CCmdUI* pCmdUI);
afx_msg void OnSurfaceChange();
afx_msg void OnDSRendererChange();
afx_msg void OnRMRendererChange();
diff --git a/src/mpc-hc/PPageSheet.cpp b/src/mpc-hc/PPageSheet.cpp
index b780e11db..787f94853 100644
--- a/src/mpc-hc/PPageSheet.cpp
+++ b/src/mpc-hc/PPageSheet.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014, 2016 see Authors.txt
+ * (C) 2006-2014, 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -23,7 +23,6 @@
#include "mplayerc.h"
#include "PPageSheet.h"
#include "SettingsDefines.h"
-#include "SysVersion.h"
// CPPageSheet
@@ -56,9 +55,8 @@ CPPageSheet::CPPageSheet(LPCTSTR pszCaption, IFilterGraph* pFG, CWnd* pParentWnd
AddPage(&m_internalfilters);
#endif
AddPage(&m_audioswitcher);
- if (SysVersion::IsVistaOrLater()) {
- AddPage(&m_audiorenderer);
- }
+ AddPage(&m_audiorenderer);
+
AddPage(&m_externalfilters);
AddPage(&m_subtitles);
AddPage(&m_substyle);
diff --git a/src/mpc-hc/PPageTweaks.cpp b/src/mpc-hc/PPageTweaks.cpp
index 0533b3486..2d9aa6440 100644
--- a/src/mpc-hc/PPageTweaks.cpp
+++ b/src/mpc-hc/PPageTweaks.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2015 see Authors.txt
+ * (C) 2006-2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -20,10 +20,10 @@
*/
#include "stdafx.h"
+#include <VersionHelpers.h>
#include "mplayerc.h"
#include "PPageTweaks.h"
#include "MainFrm.h"
-#include "SysVersion.h"
// CPPageTweaks dialog
@@ -97,7 +97,7 @@ BOOL CPPageTweaks::OnInitDialog()
m_fPreventMinimize = s.fPreventMinimize;
m_bUseEnhancedTaskBar = s.bUseEnhancedTaskBar;
- if (!SysVersion::Is7OrLater()) {
+ if (!IsWindows7OrGreater()) {
GetDlgItem(IDC_CHECK_ENHANCED_TASKBAR)->EnableWindow(FALSE);
}
diff --git a/src/mpc-hc/PPageWebServer.cpp b/src/mpc-hc/PPageWebServer.cpp
index 6da605395..e8ca5b4d1 100644
--- a/src/mpc-hc/PPageWebServer.cpp
+++ b/src/mpc-hc/PPageWebServer.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2015 see Authors.txt
+ * (C) 2006-2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -23,7 +23,6 @@
#include "mplayerc.h"
#include "MainFrm.h"
#include "PPageWebServer.h"
-#include "SysVersion.h"
#include "PathUtils.h"
#include <afxglobals.h>
#include "WebServer.h"
@@ -175,47 +174,26 @@ bool CPPageWebServer::PickDir(CString& dir)
CString strTitle(StrRes(IDS_PPAGEWEBSERVER_0));
bool success = false;
- if (SysVersion::IsVistaOrLater()) {
- CFileDialog dlg(TRUE);
- IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
+ CFileDialog dlg(TRUE);
+ IFileOpenDialog* openDlgPtr = dlg.GetIFileOpenDialog();
- if (openDlgPtr != nullptr) {
- openDlgPtr->SetTitle(strTitle);
- openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
+ if (openDlgPtr != nullptr) {
+ openDlgPtr->SetTitle(strTitle);
+ openDlgPtr->SetOptions(FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST);
- if (!dir.IsEmpty()) {
- CComPtr<IShellItem> psiFolder;
- if (SUCCEEDED(afxGlobalData.ShellCreateItemFromParsingName(dir, nullptr, IID_PPV_ARGS(&psiFolder)))) {
- openDlgPtr->SetFolder(psiFolder);
- }
+ if (!dir.IsEmpty()) {
+ CComPtr<IShellItem> psiFolder;
+ if (SUCCEEDED(afxGlobalData.ShellCreateItemFromParsingName(dir, nullptr, IID_PPV_ARGS(&psiFolder)))) {
+ openDlgPtr->SetFolder(psiFolder);
}
-
- if (SUCCEEDED(openDlgPtr->Show(m_hWnd))) {
- dir = dlg.GetFolderPath();
- success = true;
- }
-
- openDlgPtr->Release();
}
- } else {
- TCHAR buff[MAX_PATH];
-
- BROWSEINFO bi;
- bi.hwndOwner = m_hWnd;
- bi.pidlRoot = nullptr;
- bi.pszDisplayName = buff;
- bi.lpszTitle = strTitle;
- bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_VALIDATE | BIF_USENEWUI;
- bi.lpfn = BrowseCtrlCallback;
- bi.lParam = (LPARAM)(LPCTSTR)dir;
- bi.iImage = 0;
-
- PIDLIST_ABSOLUTE iil = SHBrowseForFolder(&bi);
- if (iil) {
- SHGetPathFromIDList(iil, buff);
- dir = buff;
+
+ if (SUCCEEDED(openDlgPtr->Show(m_hWnd))) {
+ dir = dlg.GetFolderPath();
success = true;
}
+
+ openDlgPtr->Release();
}
return success;
diff --git a/src/mpc-hc/SaveImageDialog.cpp b/src/mpc-hc/SaveImageDialog.cpp
index 025ca3c2a..66c350c99 100644
--- a/src/mpc-hc/SaveImageDialog.cpp
+++ b/src/mpc-hc/SaveImageDialog.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2014 see Authors.txt
+ * (C) 2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -21,7 +21,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "SaveImageDialog.h"
-#include "SysVersion.h"
IMPLEMENT_DYNAMIC(CSaveImageDialog, CFileDialog)
@@ -34,46 +33,25 @@ CSaveImageDialog::CSaveImageDialog(
lpszFilter, pParentWnd, 0),
m_nJpegQuality(nJpegQuality)
{
- if (SysVersion::IsVistaOrLater()) {
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- CString str;
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ CString str;
- pfdc->StartVisualGroup(IDS_IMAGE_JPEG_QUALITY, ResStr(IDS_IMAGE_JPEG_QUALITY));
- pfdc->AddText(IDS_IMAGE_QUALITY, ResStr(IDS_IMAGE_QUALITY));
- str.Format(L"%d", std::max(0, std::min(100, m_nJpegQuality)));
- pfdc->AddEditBox(IDC_EDIT1, str);
- pfdc->EndVisualGroup();
+ pfdc->StartVisualGroup(IDS_IMAGE_JPEG_QUALITY, ResStr(IDS_IMAGE_JPEG_QUALITY));
+ pfdc->AddText(IDS_IMAGE_QUALITY, ResStr(IDS_IMAGE_QUALITY));
+ str.Format(L"%d", std::max(0, std::min(100, m_nJpegQuality)));
+ pfdc->AddEditBox(IDC_EDIT1, str);
+ pfdc->EndVisualGroup();
- pfdc->Release();
- } else {
- SetTemplate(0, IDD_SAVEIMAGEDIALOGTEMPL);
- }
+ pfdc->Release();
}
CSaveImageDialog::~CSaveImageDialog()
{
}
-void CSaveImageDialog::DoDataExchange(CDataExchange* pDX)
-{
- if (!SysVersion::IsVistaOrLater()) {
- DDX_Control(pDX, IDC_SPIN1, m_jpegQualitySpin);
- DDX_Control(pDX, IDC_EDIT1, m_jpegQualityEdit);
- }
- __super::DoDataExchange(pDX);
-}
-
BOOL CSaveImageDialog::OnInitDialog()
{
__super::OnInitDialog();
-
- if (!SysVersion::IsVistaOrLater()) {
- m_jpegQualitySpin.SetRange32(0, 100);
- m_jpegQualitySpin.SetPos(m_nJpegQuality);
-
- OnTypeChange();
- }
-
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -83,15 +61,11 @@ END_MESSAGE_MAP()
BOOL CSaveImageDialog::OnFileNameOK()
{
- if (SysVersion::IsVistaOrLater()) {
- CComPtr<IFileDialogCustomize> pfdc = GetIFileDialogCustomize();
- CComHeapPtr<WCHAR> result;
+ CComPtr<IFileDialogCustomize> pfdc = GetIFileDialogCustomize();
+ CComHeapPtr<WCHAR> result;
- if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT1, &result))) {
- m_nJpegQuality = _wtoi(result);
- }
- } else {
- m_nJpegQuality = m_jpegQualitySpin.GetPos32();
+ if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT1, &result))) {
+ m_nJpegQuality = _wtoi(result);
}
m_nJpegQuality = std::max(0, std::min(100, m_nJpegQuality));
@@ -103,27 +77,17 @@ void CSaveImageDialog::OnTypeChange()
{
__super::OnTypeChange();
- if (SysVersion::IsVistaOrLater()) {
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
-
- if (m_pOFN->nFilterIndex == 2) { // JPEG encoding is chosen
- pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_ENABLEDVISIBLE);
- pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_ENABLEDVISIBLE);
- pfdc->SetControlState(IDC_EDIT1, CDCS_ENABLEDVISIBLE);
- } else {
- pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_INACTIVE);
- pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_INACTIVE);
- pfdc->SetControlState(IDC_EDIT1, CDCS_INACTIVE);
- }
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- pfdc->Release();
+ if (m_pOFN->nFilterIndex == 2) { // JPEG encoding is chosen
+ pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_ENABLEDVISIBLE);
+ pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_ENABLEDVISIBLE);
+ pfdc->SetControlState(IDC_EDIT1, CDCS_ENABLEDVISIBLE);
} else {
- if (m_pOFN->nFilterIndex == 2) { // JPEG encoding is chosen
- m_jpegQualitySpin.EnableWindow(TRUE);
- m_jpegQualityEdit.EnableWindow(TRUE);
- } else {
- m_jpegQualitySpin.EnableWindow(FALSE);
- m_jpegQualityEdit.EnableWindow(FALSE);
- }
+ pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_INACTIVE);
+ pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_INACTIVE);
+ pfdc->SetControlState(IDC_EDIT1, CDCS_INACTIVE);
}
+
+ pfdc->Release();
}
diff --git a/src/mpc-hc/SaveImageDialog.h b/src/mpc-hc/SaveImageDialog.h
index 823c5066e..7b211d253 100644
--- a/src/mpc-hc/SaveImageDialog.h
+++ b/src/mpc-hc/SaveImageDialog.h
@@ -1,5 +1,5 @@
/*
- * (C) 2014 see Authors.txt
+ * (C) 2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -38,7 +38,6 @@ protected:
CEdit m_jpegQualityEdit;
DECLARE_MESSAGE_MAP()
- virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual BOOL OnFileNameOK();
virtual void OnTypeChange();
diff --git a/src/mpc-hc/SaveSubtitlesFileDialog.cpp b/src/mpc-hc/SaveSubtitlesFileDialog.cpp
index d325637bc..1de2eb23b 100644
--- a/src/mpc-hc/SaveSubtitlesFileDialog.cpp
+++ b/src/mpc-hc/SaveSubtitlesFileDialog.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2012-2014, 2016 see Authors.txt
+ * (C) 2012-2014, 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -21,7 +21,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "SaveSubtitlesFileDialog.h"
-#include "SysVersion.h"
// CSaveSubtitlesFileDialog
@@ -58,65 +57,36 @@ CSaveSubtitlesFileDialog::CSaveSubtitlesFileDialog(
void CSaveSubtitlesFileDialog::InitCustomization()
{
- if (SysVersion::IsVistaOrLater()) {
- // customization has to be done before OnInitDialog
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- ASSERT(pfdc);
+ // customization has to be done before OnInitDialog
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ ASSERT(pfdc);
- VERIFY(SUCCEEDED(pfdc->StartVisualGroup(IDS_SUBFILE_DELAY, ResStr(IDS_SUBFILE_DELAY))));
+ VERIFY(SUCCEEDED(pfdc->StartVisualGroup(IDS_SUBFILE_DELAY, ResStr(IDS_SUBFILE_DELAY))));
- CString strDelay;
- strDelay.Format(_T("%d"), m_delay);
- VERIFY(SUCCEEDED(pfdc->AddEditBox(IDC_EDIT1, strDelay)));
+ CString strDelay;
+ strDelay.Format(_T("%d"), m_delay);
+ VERIFY(SUCCEEDED(pfdc->AddEditBox(IDC_EDIT1, strDelay)));
- VERIFY(SUCCEEDED(pfdc->EndVisualGroup()));
+ VERIFY(SUCCEEDED(pfdc->EndVisualGroup()));
- VERIFY(SUCCEEDED(pfdc->AddCheckButton(IDC_CHECK1, ResStr(IDS_SUB_SAVE_EXTERNAL_STYLE_FILE), m_bSaveExternalStyleFile)));
- VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_CHECK1, m_bDisableExternalStyleCheckBox ? CDCS_INACTIVE : CDCS_ENABLEDVISIBLE)));
-
- if (m_bDisableEncoding) {
- VERIFY(SUCCEEDED(pfdc->SetControlState(IDS_TEXTFILE_ENC, CDCS_INACTIVE)));
- VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_COMBO1, CDCS_INACTIVE)));
- }
+ VERIFY(SUCCEEDED(pfdc->AddCheckButton(IDC_CHECK1, ResStr(IDS_SUB_SAVE_EXTERNAL_STYLE_FILE), m_bSaveExternalStyleFile)));
+ VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_CHECK1, m_bDisableExternalStyleCheckBox ? CDCS_INACTIVE : CDCS_ENABLEDVISIBLE)));
- pfdc->Release();
- } else {
- SetTemplate(0, IDD_SAVESUBTITLESFILEDIALOGTEMPL);
+ if (m_bDisableEncoding) {
+ VERIFY(SUCCEEDED(pfdc->SetControlState(IDS_TEXTFILE_ENC, CDCS_INACTIVE)));
+ VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_COMBO1, CDCS_INACTIVE)));
}
-}
-CSaveSubtitlesFileDialog::~CSaveSubtitlesFileDialog()
-{
+ pfdc->Release();
}
-void CSaveSubtitlesFileDialog::DoDataExchange(CDataExchange* pDX)
+CSaveSubtitlesFileDialog::~CSaveSubtitlesFileDialog()
{
- if (!SysVersion::IsVistaOrLater()) {
- DDX_Control(pDX, IDC_SPIN1, m_delayCtrl);
- DDX_Text(pDX, IDC_EDIT1, m_delay);
- DDX_Check(pDX, IDC_CHECK1, m_bSaveExternalStyleFile);
- }
- __super::DoDataExchange(pDX);
}
BOOL CSaveSubtitlesFileDialog::OnInitDialog()
{
__super::OnInitDialog();
-
- if (!SysVersion::IsVistaOrLater()) {
- m_delayCtrl.SetRange32(INT_MIN, INT_MAX);
- m_delayCtrl.SetPos32(m_delay);
-
- if (m_bDisableEncoding) {
- GetDlgItem(IDC_STATIC1)->EnableWindow(FALSE);
- GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);
- }
-
- if (m_bDisableExternalStyleCheckBox) {
- GetDlgItem(IDC_CHECK1)->EnableWindow(FALSE);
- }
- }
-
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -128,23 +98,19 @@ END_MESSAGE_MAP()
BOOL CSaveSubtitlesFileDialog::OnFileNameOK()
{
- if (SysVersion::IsVistaOrLater()) {
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- ASSERT(pfdc);
-
- WCHAR* strDelay = nullptr;
- VERIFY(SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT1, &strDelay)));
- if (strDelay) {
- m_delay = _tcstol(strDelay, nullptr, 10);
- CoTaskMemFree(strDelay);
- }
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ ASSERT(pfdc);
+
+ WCHAR* strDelay = nullptr;
+ VERIFY(SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT1, &strDelay)));
+ if (strDelay) {
+ m_delay = _tcstol(strDelay, nullptr, 10);
+ CoTaskMemFree(strDelay);
+ }
- VERIFY(SUCCEEDED(pfdc->GetCheckButtonState(IDC_CHECK1, &m_bSaveExternalStyleFile)));
+ VERIFY(SUCCEEDED(pfdc->GetCheckButtonState(IDC_CHECK1, &m_bSaveExternalStyleFile)));
- pfdc->Release();
- } else {
- UpdateData();
- }
+ pfdc->Release();
return __super::OnFileNameOK();
}
@@ -159,15 +125,11 @@ void CSaveSubtitlesFileDialog::OnTypeChange()
Subtitle::SubType subType = m_types[m_ofn.nFilterIndex - 1];
bool bDisableExternalStyleCheckBox = (subType == Subtitle::SSA || subType == Subtitle::ASS);
- if (SysVersion::IsVistaOrLater()) {
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- ASSERT(pfdc);
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ ASSERT(pfdc);
- VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_CHECK1, bDisableExternalStyleCheckBox ? (CDCS_INACTIVE | CDCS_VISIBLE) : CDCS_ENABLEDVISIBLE)));
+ VERIFY(SUCCEEDED(pfdc->SetControlState(IDC_CHECK1, bDisableExternalStyleCheckBox ? (CDCS_INACTIVE | CDCS_VISIBLE) : CDCS_ENABLEDVISIBLE)));
- pfdc->Release();
- } else {
- GetDlgItem(IDC_CHECK1)->EnableWindow(!bDisableExternalStyleCheckBox);
- }
+ pfdc->Release();
}
}
diff --git a/src/mpc-hc/SaveSubtitlesFileDialog.h b/src/mpc-hc/SaveSubtitlesFileDialog.h
index 96a65999b..e41da0c58 100644
--- a/src/mpc-hc/SaveSubtitlesFileDialog.h
+++ b/src/mpc-hc/SaveSubtitlesFileDialog.h
@@ -1,5 +1,5 @@
/*
- * (C) 2012-2014 see Authors.txt
+ * (C) 2012-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -59,7 +59,6 @@ public:
protected:
DECLARE_MESSAGE_MAP()
- virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual BOOL OnFileNameOK();
virtual void OnTypeChange();
diff --git a/src/mpc-hc/SaveTextFileDialog.cpp b/src/mpc-hc/SaveTextFileDialog.cpp
index 0d4d8c413..a49356bf0 100644
--- a/src/mpc-hc/SaveTextFileDialog.cpp
+++ b/src/mpc-hc/SaveTextFileDialog.cpp
@@ -22,7 +22,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "SaveTextFileDialog.h"
-#include "SysVersion.h"
// CSaveTextFileDialog
@@ -37,66 +36,30 @@ CSaveTextFileDialog::CSaveTextFileDialog(
lpszFilter, pParentWnd, 0)
, m_e(e)
{
- if (SysVersion::IsVistaOrLater()) {
- // customization has to be done before OnInitDialog
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
-
- pfdc->StartVisualGroup(IDS_TEXTFILE_ENC, ResStr(IDS_TEXTFILE_ENC));
- pfdc->AddComboBox(IDC_COMBO1);
- pfdc->AddControlItem(IDC_COMBO1, CTextFile::DEFAULT_ENCODING, _T("Automatic"));
- pfdc->AddControlItem(IDC_COMBO1, CTextFile::ANSI, _T("ANSI"));
- pfdc->AddControlItem(IDC_COMBO1, CTextFile::LE16, _T("Unicode (UTF-16 LE BOM)"));
- pfdc->AddControlItem(IDC_COMBO1, CTextFile::BE16, _T("Unicode (UTF-16 BE BOM)"));
- pfdc->AddControlItem(IDC_COMBO1, CTextFile::UTF8, _T("UTF-8"));
- pfdc->SetSelectedControlItem(IDC_COMBO1, m_e);
- pfdc->EndVisualGroup();
- pfdc->MakeProminent(IDS_TEXTFILE_ENC);
-
- pfdc->Release();
- } else {
- SetTemplate(0, IDD_SAVETEXTFILEDIALOGTEMPL);
- }
+ // customization has to be done before OnInitDialog
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+
+ pfdc->StartVisualGroup(IDS_TEXTFILE_ENC, ResStr(IDS_TEXTFILE_ENC));
+ pfdc->AddComboBox(IDC_COMBO1);
+ pfdc->AddControlItem(IDC_COMBO1, CTextFile::DEFAULT_ENCODING, _T("Automatic"));
+ pfdc->AddControlItem(IDC_COMBO1, CTextFile::ANSI, _T("ANSI"));
+ pfdc->AddControlItem(IDC_COMBO1, CTextFile::LE16, _T("Unicode (UTF-16 LE BOM)"));
+ pfdc->AddControlItem(IDC_COMBO1, CTextFile::BE16, _T("Unicode (UTF-16 BE BOM)"));
+ pfdc->AddControlItem(IDC_COMBO1, CTextFile::UTF8, _T("UTF-8"));
+ pfdc->SetSelectedControlItem(IDC_COMBO1, m_e);
+ pfdc->EndVisualGroup();
+ pfdc->MakeProminent(IDS_TEXTFILE_ENC);
+
+ pfdc->Release();
}
CSaveTextFileDialog::~CSaveTextFileDialog()
{
}
-void CSaveTextFileDialog::DoDataExchange(CDataExchange* pDX)
-{
- if (!SysVersion::IsVistaOrLater()) {
- DDX_Control(pDX, IDC_COMBO1, m_encoding);
- }
- __super::DoDataExchange(pDX);
-}
-
BOOL CSaveTextFileDialog::OnInitDialog()
{
__super::OnInitDialog();
-
- if (!SysVersion::IsVistaOrLater()) {
- m_encoding.SetItemData(m_encoding.AddString(_T("ANSI")), CTextFile::DEFAULT_ENCODING);
- m_encoding.SetItemData(m_encoding.AddString(_T("Unicode (UTF-16 LE BOM)")), CTextFile::LE16);
- m_encoding.SetItemData(m_encoding.AddString(_T("Unicode (UTF-16 BE BOM)")), CTextFile::BE16);
- m_encoding.SetItemData(m_encoding.AddString(_T("UTF-8")), CTextFile::UTF8);
-
- switch (m_e) {
- default:
- case CTextFile::DEFAULT_ENCODING:
- m_encoding.SetCurSel(0);
- break;
- case CTextFile::LE16:
- m_encoding.SetCurSel(1);
- break;
- case CTextFile::BE16:
- m_encoding.SetCurSel(2);
- break;
- case CTextFile::UTF8:
- m_encoding.SetCurSel(3);
- break;
- }
- }
-
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -108,15 +71,11 @@ END_MESSAGE_MAP()
BOOL CSaveTextFileDialog::OnFileNameOK()
{
- if (SysVersion::IsVistaOrLater()) {
- DWORD result;
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- pfdc->GetSelectedControlItem(IDC_COMBO1, &result);
- pfdc->Release();
- m_e = (CTextFile::enc)result;
- } else {
- m_e = (CTextFile::enc)m_encoding.GetItemData(m_encoding.GetCurSel());
- }
+ DWORD result;
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ pfdc->GetSelectedControlItem(IDC_COMBO1, &result);
+ pfdc->Release();
+ m_e = (CTextFile::enc)result;
return __super::OnFileNameOK();
}
diff --git a/src/mpc-hc/SaveTextFileDialog.h b/src/mpc-hc/SaveTextFileDialog.h
index a2e68cdb1..ad0928b41 100644
--- a/src/mpc-hc/SaveTextFileDialog.h
+++ b/src/mpc-hc/SaveTextFileDialog.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2013 see Authors.txt
+ * (C) 2006-2013, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -45,7 +45,6 @@ public:
protected:
DECLARE_MESSAGE_MAP()
- virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual BOOL OnFileNameOK();
diff --git a/src/mpc-hc/SaveThumbnailsDialog.cpp b/src/mpc-hc/SaveThumbnailsDialog.cpp
index a6c746de2..6fd1c0cf4 100644
--- a/src/mpc-hc/SaveThumbnailsDialog.cpp
+++ b/src/mpc-hc/SaveThumbnailsDialog.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -22,7 +22,6 @@
#include "stdafx.h"
#include "mplayerc.h"
#include "SaveThumbnailsDialog.h"
-#include "SysVersion.h"
// CSaveThumbnailsDialog
@@ -37,60 +36,36 @@ CSaveThumbnailsDialog::CSaveThumbnailsDialog(
m_cols(cols),
m_width(width)
{
- if (SysVersion::IsVistaOrLater()) {
- // customization has to be done before OnInitDialog
- IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
- CStringW str;
-
- pfdc->StartVisualGroup(IDS_THUMB_IMAGE_WIDTH, ResStr(IDS_THUMB_IMAGE_WIDTH));
- pfdc->AddText(IDS_THUMB_PIXELS, ResStr(IDS_THUMB_PIXELS));
- str.Format(L"%d", std::max(256, std::min(2560, m_width)));
- pfdc->AddEditBox(IDC_EDIT4, str);
- pfdc->EndVisualGroup();
-
- pfdc->StartVisualGroup(IDS_THUMB_THUMBNAILS, ResStr(IDS_THUMB_THUMBNAILS));
- pfdc->AddText(IDS_THUMB_ROWNUMBER, ResStr(IDS_THUMB_ROWNUMBER));
- str.Format(L"%d", std::max(1, std::min(20, m_rows)));
- pfdc->AddEditBox(IDC_EDIT2, str);
-
- pfdc->AddText(IDS_THUMB_COLNUMBER, ResStr(IDS_THUMB_COLNUMBER));
- str.Format(L"%d", std::max(1, std::min(10, m_cols)));
- pfdc->AddEditBox(IDC_EDIT3, str);
- pfdc->EndVisualGroup();
-
- pfdc->Release();
- } else {
- SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL);
- }
+ // customization has to be done before OnInitDialog
+ IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
+ CStringW str;
+
+ pfdc->StartVisualGroup(IDS_THUMB_IMAGE_WIDTH, ResStr(IDS_THUMB_IMAGE_WIDTH));
+ pfdc->AddText(IDS_THUMB_PIXELS, ResStr(IDS_THUMB_PIXELS));
+ str.Format(L"%d", std::max(256, std::min(2560, m_width)));
+ pfdc->AddEditBox(IDC_EDIT4, str);
+ pfdc->EndVisualGroup();
+
+ pfdc->StartVisualGroup(IDS_THUMB_THUMBNAILS, ResStr(IDS_THUMB_THUMBNAILS));
+ pfdc->AddText(IDS_THUMB_ROWNUMBER, ResStr(IDS_THUMB_ROWNUMBER));
+ str.Format(L"%d", std::max(1, std::min(20, m_rows)));
+ pfdc->AddEditBox(IDC_EDIT2, str);
+
+ pfdc->AddText(IDS_THUMB_COLNUMBER, ResStr(IDS_THUMB_COLNUMBER));
+ str.Format(L"%d", std::max(1, std::min(10, m_cols)));
+ pfdc->AddEditBox(IDC_EDIT3, str);
+ pfdc->EndVisualGroup();
+
+ pfdc->Release();
}
CSaveThumbnailsDialog::~CSaveThumbnailsDialog()
{
}
-void CSaveThumbnailsDialog::DoDataExchange(CDataExchange* pDX)
-{
- if (!SysVersion::IsVistaOrLater()) {
- DDX_Control(pDX, IDC_SPIN2, m_rowsctrl);
- DDX_Control(pDX, IDC_SPIN3, m_colsctrl);
- DDX_Control(pDX, IDC_SPIN4, m_widthctrl);
- }
- __super::DoDataExchange(pDX);
-}
-
BOOL CSaveThumbnailsDialog::OnInitDialog()
{
__super::OnInitDialog();
-
- if (!SysVersion::IsVistaOrLater()) {
- m_rowsctrl.SetRange32(1, 20);
- m_colsctrl.SetRange32(1, 10);
- m_widthctrl.SetRange32(256, 2560);
- m_rowsctrl.SetPos32(m_rows);
- m_colsctrl.SetPos32(m_cols);
- m_widthctrl.SetPos32(m_width);
- }
-
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -102,27 +77,21 @@ END_MESSAGE_MAP()
BOOL CSaveThumbnailsDialog::OnFileNameOK()
{
- if (SysVersion::IsVistaOrLater()) {
- CComPtr<IFileDialogCustomize> pfdc = GetIFileDialogCustomize();
- CComHeapPtr<WCHAR> result;
-
- if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT2, &result))) {
- m_rows = _wtoi(result);
- }
-
- result.Free();
- if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT3, &result))) {
- m_cols = _wtoi(result);
- }
-
- result.Free();
- if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT4, &result))) {
- m_width = _wtoi(result);
- }
- } else {
- m_rows = m_rowsctrl.GetPos32();
- m_cols = m_colsctrl.GetPos32();
- m_width = m_widthctrl.GetPos32();
+ CComPtr<IFileDialogCustomize> pfdc = GetIFileDialogCustomize();
+ CComHeapPtr<WCHAR> result;
+
+ if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT2, &result))) {
+ m_rows = _wtoi(result);
+ }
+
+ result.Free();
+ if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT3, &result))) {
+ m_cols = _wtoi(result);
+ }
+
+ result.Free();
+ if (SUCCEEDED(pfdc->GetEditBoxText(IDC_EDIT4, &result))) {
+ m_width = _wtoi(result);
}
return __super::OnFileNameOK();
diff --git a/src/mpc-hc/SaveThumbnailsDialog.h b/src/mpc-hc/SaveThumbnailsDialog.h
index 6168c5412..cc29c65ed 100644
--- a/src/mpc-hc/SaveThumbnailsDialog.h
+++ b/src/mpc-hc/SaveThumbnailsDialog.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -38,7 +38,6 @@ public:
protected:
DECLARE_MESSAGE_MAP()
- virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual BOOL OnFileNameOK();
diff --git a/src/mpc-hc/ShockwaveGraph.cpp b/src/mpc-hc/ShockwaveGraph.cpp
index 16dfd4fbe..5f6953fab 100644
--- a/src/mpc-hc/ShockwaveGraph.cpp
+++ b/src/mpc-hc/ShockwaveGraph.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -23,7 +23,6 @@
#include "ShockwaveGraph.h"
#include "resource.h"
#include "DSUtil.h"
-#include "SysVersion.h"
#include <cmath>
#include <Audiopolicy.h>
#include <Mmdeviceapi.h>
@@ -49,22 +48,20 @@ CShockwaveGraph::CShockwaveGraph(HWND hParent, HRESULT& hr)
}
m_wndDestFrame.put_BackgroundColor(0);
- if (SysVersion::IsVistaOrLater()) {
- CComPtr<IMMDeviceEnumerator> pDeviceEnumerator;
- if (SUCCEEDED(pDeviceEnumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator)))) {
- CComPtr<IMMDevice> pDevice;
- if (SUCCEEDED(pDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pDevice))) {
- CComPtr<IAudioSessionManager> pSessionManager;
- if (SUCCEEDED(pDevice->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, nullptr,
- reinterpret_cast<void**>(&pSessionManager)))) {
- if (SUCCEEDED(pSessionManager->GetSimpleAudioVolume(nullptr, FALSE, &m_pSimpleVolume))) {
- VERIFY(SUCCEEDED(m_pSimpleVolume->GetMasterVolume(&m_fInitialVolume)));
- }
+ CComPtr<IMMDeviceEnumerator> pDeviceEnumerator;
+ if (SUCCEEDED(pDeviceEnumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator)))) {
+ CComPtr<IMMDevice> pDevice;
+ if (SUCCEEDED(pDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pDevice))) {
+ CComPtr<IAudioSessionManager> pSessionManager;
+ if (SUCCEEDED(pDevice->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, nullptr,
+ reinterpret_cast<void**>(&pSessionManager)))) {
+ if (SUCCEEDED(pSessionManager->GetSimpleAudioVolume(nullptr, FALSE, &m_pSimpleVolume))) {
+ VERIFY(SUCCEEDED(m_pSimpleVolume->GetMasterVolume(&m_fInitialVolume)));
}
}
}
- ASSERT(m_pSimpleVolume);
}
+ ASSERT(m_pSimpleVolume);
}
CShockwaveGraph::~CShockwaveGraph()
diff --git a/src/mpc-hc/StatusLabel.cpp b/src/mpc-hc/StatusLabel.cpp
index d1691364a..ae8ddb282 100644
--- a/src/mpc-hc/StatusLabel.cpp
+++ b/src/mpc-hc/StatusLabel.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2015 see Authors.txt
+ * (C) 2006-2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -23,7 +23,6 @@
#include "mplayerc.h"
#include "StatusLabel.h"
#include "WinAPIUtils.h"
-#include "SysVersion.h"
// CStatusLabel
@@ -43,20 +42,10 @@ CStatusLabel::~CStatusLabel()
void CStatusLabel::ScaleFont(const DpiHelper& dpiHelper)
{
m_font.DeleteObject();
-
- if (SysVersion::IsVistaOrLater()) {
- LOGFONT lf;
- GetStatusFont(&lf);
- lf.lfHeight = dpiHelper.ScaleSystemToOverrideY(lf.lfHeight);
- VERIFY(m_font.CreateFontIndirect(&lf));
- } else {
- HDC hdc = ::GetDC(nullptr);
- double scale = 1.0 * GetDeviceCaps(hdc, LOGPIXELSY) / 96.0;
- ::ReleaseDC(nullptr, hdc);
- VERIFY(m_font.CreateFont(int(14 * scale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
- OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
- _T("Microsoft Sans Serif")));
- }
+ LOGFONT lf;
+ GetStatusFont(&lf);
+ lf.lfHeight = dpiHelper.ScaleSystemToOverrideY(lf.lfHeight);
+ VERIFY(m_font.CreateFontIndirect(&lf));
}
BEGIN_MESSAGE_MAP(CStatusLabel, CStatic)
diff --git a/src/mpc-hc/UpdateChecker.cpp b/src/mpc-hc/UpdateChecker.cpp
index bce4cbdf3..e4a015b8d 100644
--- a/src/mpc-hc/UpdateChecker.cpp
+++ b/src/mpc-hc/UpdateChecker.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2012-2014 see Authors.txt
+ * (C) 2012-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -26,7 +26,6 @@
#include "UpdateCheckerDlg.h"
#include "SettingsDefines.h"
#include "mplayerc.h"
-#include "SysVersion.h"
#include "AppSettings.h"
#include <afxinet.h>
@@ -59,10 +58,21 @@ Update_Status UpdateChecker::IsUpdateAvailable(const Version& currentVersion)
try {
CInternetSession internet;
- OSVERSIONINFOEX osVersion = SysVersion::GetFullVersion();
+#pragma warning(push)
+#pragma warning(disable: 4996)
+ OSVERSIONINFOEX osVersion = { sizeof(OSVERSIONINFOEX) };
+ GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osVersion));
+#pragma warning(pop)
CString osVersionStr;
osVersionStr.Format(_T("Windows %1u.%1u"), osVersion.dwMajorVersion, osVersion.dwMinorVersion);
- if (SysVersion::Is64Bit()) {
+
+#if !defined(_WIN64)
+ // 32-bit programs run on both 32-bit and 64-bit Windows
+ // so must sniff
+ BOOL f64 = FALSE;
+ if (IsWow64Process(GetCurrentProcess(), &f64) && f64)
+#endif
+ {
osVersionStr += _T(" x64");
}
diff --git a/src/mpc-hc/mpc-hc.rc b/src/mpc-hc/mpc-hc.rc
index b1325e9e0..d74d306e1 100644
--- a/src/mpc-hc/mpc-hc.rc
+++ b/src/mpc-hc/mpc-hc.rc
@@ -780,7 +780,6 @@ BEGIN
CONTROL "D3D Fullscreen",IDC_FULLSCREEN_MONITOR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,210,171,10
CONTROL "Alternative VSync",IDC_DSVMR9ALTERNATIVEVSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,199,108,10
CONTROL "VMR-9 Mixer Mode",IDC_DSVMR9LOADMIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,177,108,10
- CONTROL "YUV Mixing",IDC_DSVMR9YUVMIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,188,108,10
RTEXT "EVR Buffers:",IDC_EVR_BUFFERS_TXT,168,216,81,8
COMBOBOX IDC_EVR_BUFFERS,252,213,34,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "DXVA",IDC_STATIC,24,34,30,8
@@ -2516,7 +2515,6 @@ BEGIN
IDC_TEXTURESURF3D "Video surface will be allocated as a texture and drawn as two triangles in 3d. Antialiasing turned on at the display settings may have a bad effect on the rendering speed."
IDC_DX9RESIZER_COMBO "If there is no Pixel Shader 2.0 support, simple bilinear is used automatically."
IDC_DSVMR9LOADMIXER "Puts VMR-9 (renderless) into mixer mode, this means most of the controls on its property page will work and it will use a separate worker thread to renderer frames."
- IDC_DSVMR9YUVMIXER "Improves performance at the cost of some compatibility of the renderer."
END
STRINGTABLE
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp
index b2a878677..9abcfa5ad 100644
--- a/src/mpc-hc/mplayerc.cpp
+++ b/src/mpc-hc/mplayerc.cpp
@@ -28,7 +28,6 @@
#include "FakeFilterMapper2.h"
#include "FileAssoc.h"
#include "FileVersionInfo.h"
-#include "SysVersion.h"
#include "Ifo.h"
#include "MainFrm.h"
#include "MhookHelper.h"
@@ -1443,7 +1442,8 @@ MMRESULT WINAPI Mine_mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETA
BOOL (WINAPI* Real_LockWindowUpdate)(HWND) = LockWindowUpdate;
BOOL WINAPI Mine_LockWindowUpdate(HWND hWndLock)
{
- if (SysVersion::IsVistaOrLater() && hWndLock == ::GetDesktopWindow()) {
+ // TODO: Check if needed on Windows 8+
+ if (hWndLock == ::GetDesktopWindow()) {
// locking the desktop window with aero active locks the entire compositor,
// unfortunately MFC does that (when dragging CControlBar) and we want to prevent it
return FALSE;
diff --git a/src/mpc-hc/resource.h b/src/mpc-hc/resource.h
index fdb2605ff..14fb1fd39 100644
--- a/src/mpc-hc/resource.h
+++ b/src/mpc-hc/resource.h
@@ -481,7 +481,6 @@
#define IDC_DX9RESIZER_COMBO 12130
#define IDC_DSVMR9LOADMIXER 12131
#define IDC_DX_SURFACE 12133
-#define IDC_DSVMR9YUVMIXER 12134
#define IDC_BUTTON_MI 12136
#define IDC_MIEDIT 12137
#define IDC_LISTCHANNELS 12138
diff --git a/src/thirdparty/TreePropSheet/PropPageFrameDefault.cpp b/src/thirdparty/TreePropSheet/PropPageFrameDefault.cpp
index 9a0f909d6..b434221ca 100644
--- a/src/thirdparty/TreePropSheet/PropPageFrameDefault.cpp
+++ b/src/thirdparty/TreePropSheet/PropPageFrameDefault.cpp
@@ -21,7 +21,6 @@
#include "PropPageFrameDefault.h"
// <MPC-HC Custom Code>
#include "../../DSUtil/WinAPIUtils.h"
-#include "../../DSUtil/SysVersion.h"
// </MPC-HC Custom Code>
@@ -299,10 +298,6 @@ void CPropPageFrameDefault::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaptio
GetMessageFont(&lf);
lf.lfHeight = rect.Height();
lf.lfWeight = FW_BOLD;
-
- if (!SysVersion::IsVistaOrLater()) {
- _tcscpy_s(lf.lfFaceName, _T("Arial"));
- }
// <MPC-HC Custom Code>
CFont f;
f.CreateFontIndirect(&lf);