Skip to content

Commit

Permalink
По умолчанию выбираем MPC Video Renderer, если он установлен и доступ…
Browse files Browse the repository at this point in the history
…ен. В противном случае будет выбран EVR-CP.
  • Loading branch information
v0lt committed Dec 13, 2024
1 parent 68d1ca9 commit ca33b7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
28 changes: 16 additions & 12 deletions src/apps/mplayerc/PPageVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void CPPageVideo::DoDataExchange(CDataExchange* pDX)
}

BEGIN_MESSAGE_MAP(CPPageVideo, CPPageBase)
ON_CBN_SELCHANGE(IDC_VIDRND_COMBO, OnDSRendererChange)
ON_CBN_SELCHANGE(IDC_VIDRND_COMBO, OnVideoRendererChange)
ON_BN_CLICKED(IDC_D3D9DEVICE_CHECK, OnD3D9DeviceCheck)
ON_BN_CLICKED(IDC_RESETDEVICE, OnResetDevice)
ON_BN_CLICKED(IDC_EXCLUSIVE_FULLSCREEN_CHECK, OnFullscreenCheck)
Expand Down Expand Up @@ -215,7 +215,7 @@ BOOL CPPageVideo::OnInitDialog()
CreateToolTip();
m_wndToolTip.AddTool(GetDlgItem(IDC_VIDRND_COMBO), L"");

OnDSRendererChange();
OnVideoRendererChange();

AddStringData(m_cbDX9PresentMode, L"Copy", 0);
AddStringData(m_cbDX9PresentMode, L"Flip/FlipEx", 1);
Expand Down Expand Up @@ -285,16 +285,16 @@ BOOL CPPageVideo::OnApply()
CAppSettings& s = AfxGetAppSettings();
CRenderersSettings& rs = s.m_VRSettings;

rs.iVideoRenderer = m_iVideoRendererType = m_iVideoRendererType_store = GetCurItemData(m_cbVideoRenderer);
rs.ExtraSets.iResizer = GetCurItemData(m_cbDX9Resizer);
rs.ExtraSets.iDownscaler = GetCurItemData(m_cbDownscaler);
rs.bExclusiveFullscreen = !!m_chkD3DFullscreen.GetCheck();
rs.ExtraSets.bResetDevice = !!m_bResetDevice;
rs.iVideoRenderer = m_iVideoRendererType = m_iVideoRendererType_store = GetCurItemData(m_cbVideoRenderer);
rs.ExtraSets.iResizer = GetCurItemData(m_cbDX9Resizer);
rs.ExtraSets.iDownscaler = GetCurItemData(m_cbDownscaler);
rs.bExclusiveFullscreen = !!m_chkD3DFullscreen.GetCheck();
rs.ExtraSets.bResetDevice = !!m_bResetDevice;

rs.ExtraSets.iPresentMode = (int)GetCurItemData(m_cbDX9PresentMode);
rs.ExtraSets.iSurfaceFormat = (D3DFORMAT)GetCurItemData(m_cbDX9SurfaceFormat);
rs.ExtraSets.b10BitOutput = !!m_chk10bitOutput.GetCheck();
rs.ExtraSets.iEVROutputRange = m_cbEVROutputRange.GetCurSel();
rs.ExtraSets.iPresentMode = (int)GetCurItemData(m_cbDX9PresentMode);
rs.ExtraSets.iSurfaceFormat = (D3DFORMAT)GetCurItemData(m_cbDX9SurfaceFormat);
rs.ExtraSets.b10BitOutput = !!m_chk10bitOutput.GetCheck();
rs.ExtraSets.iEVROutputRange = m_cbEVROutputRange.GetCurSel();

rs.ExtraSets.nEVRBuffers = m_iEvrBuffers;

Expand Down Expand Up @@ -375,7 +375,7 @@ void CPPageVideo::UpdateDownscalerList(int select)
m_cbDownscaler.SetRedraw(TRUE);
}

void CPPageVideo::OnDSRendererChange()
void CPPageVideo::OnVideoRendererChange()
{
int CurrentVR = (int)GetCurItemData(m_cbVideoRenderer);

Expand Down Expand Up @@ -534,6 +534,9 @@ void CPPageVideo::OnBnClickedDefault()

UpdateData(FALSE);

HRESULT hr = CheckFilterCLSID(CLSID_MPCVR);
SelectByItemData(m_cbVideoRenderer, (S_OK == hr) ? VIDRNDT_MPCVR : VIDRNDT_EVR_CP);

m_cbEVROutputRange.SetCurSel(0);

m_chkD3DFullscreen.SetCheck(BST_UNCHECKED);
Expand All @@ -546,6 +549,7 @@ void CPPageVideo::OnBnClickedDefault()

OnFullscreenCheck();
OnSurfaceFormatChange();
OnVideoRendererChange();

m_chkMPCVRFullscreenControl.SetCheck(BST_UNCHECKED);

Expand Down
2 changes: 1 addition & 1 deletion src/apps/mplayerc/PPageVideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CPPageVideo : public CPPageBase
DECLARE_MESSAGE_MAP()

public:
afx_msg void OnDSRendererChange();
afx_msg void OnVideoRendererChange();
afx_msg void OnResetDevice();
afx_msg void OnFullscreenCheck();
afx_msg void OnD3D9DeviceCheck();
Expand Down
10 changes: 8 additions & 2 deletions src/apps/mplayerc/VideoSettings.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) 2022-2023 see Authors.txt
* (C) 2022-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand All @@ -19,6 +19,7 @@
*/

#include "stdafx.h"
#include <clsids.h>
#include "VideoSettings.h"

#define IDS_R_VIDEO L"Video"
Expand Down Expand Up @@ -70,7 +71,12 @@

void CRenderersSettings::SetDefault()
{
iVideoRenderer = VIDRNDT_EVR_CP;
HRESULT hr = CheckFilterCLSID(CLSID_MPCVR);
if (S_OK == hr) {
iVideoRenderer = VIDRNDT_MPCVR;
} else {
iVideoRenderer = VIDRNDT_EVR_CP;
};

bExclusiveFullscreen = false;

Expand Down

0 comments on commit ca33b7b

Please sign in to comment.