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
diff options
context:
space:
mode:
Diffstat (limited to 'src/filters/PinInfoWnd.cpp')
-rw-r--r--src/filters/PinInfoWnd.cpp51
1 files changed, 28 insertions, 23 deletions
diff --git a/src/filters/PinInfoWnd.cpp b/src/filters/PinInfoWnd.cpp
index 8717e2ffa..6e92daa78 100644
--- a/src/filters/PinInfoWnd.cpp
+++ b/src/filters/PinInfoWnd.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2016 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -22,6 +22,8 @@
#include "stdafx.h"
#include "PinInfoWnd.h"
#include "../DSUtil/DSUtil.h"
+#include "../mpc-hc/DpiHelper.h"
+#include "../DSUtil/MediaTypeEx.h"
//
// CPinInfoWnd
@@ -74,17 +76,23 @@ static LRESULT CALLBACK ControlProc(HWND control, UINT message, WPARAM wParam, L
bool CPinInfoWnd::OnActivate()
{
- DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP;
- CPoint p(10, 10);
+ m_dpi.Override(GetSafeHwnd());
- m_pin_static.Create(_T("Pin:"), dwStyle, CRect(p + CPoint(0, 3), CSize(30, m_fontheight)), this);
- m_pin_combo.Create(dwStyle | CBS_DROPDOWNLIST, CRect(p + CPoint(30, 0), CSize(450, 200)), this, IDC_PP_COMBO1);
+ DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP;
+ CPoint p(m_dpi.ScaleX(10), m_dpi.ScaleY(10));
+
+ m_pin_static.Create(_T("Pin:"), dwStyle,
+ CRect(p + CPoint(m_dpi.ScaleX(0), m_dpi.ScaleY(3)), CSize(m_dpi.ScaleX(30), m_fontheight)),
+ this);
+ m_pin_combo.Create(dwStyle | CBS_DROPDOWNLIST,
+ CRect(p + CPoint(m_dpi.ScaleX(30), m_dpi.ScaleY(0)), CSize(m_dpi.ScaleX(520), m_dpi.ScaleY(200))),
+ this, IDC_PP_COMBO1);
BeginEnumPins(m_pBF, pEP, pPin) {
CPinInfo pi;
if (FAILED(pPin->QueryPinInfo(&pi))) {
continue;
}
- CString str = CString(pi.achName);
+ CString str(pi.achName);
if (!str.Find(_T("Apple"))) {
str.Delete(0, 1);
}
@@ -99,7 +107,7 @@ bool CPinInfoWnd::OnActivate()
EndEnumPins;
m_pin_combo.SetCurSel(0);
- p.y += m_fontheight + 20;
+ p.y += m_fontheight + m_dpi.ScaleY(20);
m_info_edit.CreateEx(WS_EX_CLIENTEDGE,
_T("EDIT"),
@@ -109,14 +117,13 @@ bool CPinInfoWnd::OnActivate()
WS_VSCROLL |
WS_HSCROLL |
ES_MULTILINE |
- ES_AUTOHSCROLL |
ES_READONLY,
- CRect(p, CSize(480, m_fontheight * 20)),
+ CRect(p, CSize(m_dpi.ScaleX(550), m_fontheight * 30)),
this,
IDC_PP_EDIT1);
m_info_edit.SetLimitText(60000);
- OnCbnSelchangeCombo1();
+ OnSelectedPinChange();
for (CWnd* pWnd = GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow()) {
pWnd->SetFont(&m_font, FALSE);
@@ -151,7 +158,7 @@ BOOL CPinInfoWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT*
}
BEGIN_MESSAGE_MAP(CPinInfoWnd, CInternalPropertyPageWnd)
- ON_CBN_SELCHANGE(IDC_PP_COMBO1, OnCbnSelchangeCombo1)
+ ON_CBN_SELCHANGE(IDC_PP_COMBO1, OnSelectedPinChange)
END_MESSAGE_MAP()
void CPinInfoWnd::AddLine(CString str)
@@ -162,7 +169,7 @@ void CPinInfoWnd::AddLine(CString str)
m_info_edit.ReplaceSel(str);
}
-void CPinInfoWnd::OnCbnSelchangeCombo1()
+void CPinInfoWnd::OnSelectedPinChange()
{
m_info_edit.SetWindowText(_T(""));
@@ -177,29 +184,27 @@ void CPinInfoWnd::OnCbnSelchangeCombo1()
}
CString str;
- PIN_INFO PinInfo;
+ CPinInfo pinInfo;
- if (SUCCEEDED(pPin->QueryPinInfo(&PinInfo))) {
+ if (SUCCEEDED(pPin->QueryPinInfo(&pinInfo))) {
CString strName;
- CLSID FilterClsid;
- FILTER_INFO FilterInfo;
+ CLSID filterClsid;
+ CFilterInfo filterInfo;
- if (SUCCEEDED(PinInfo.pFilter->QueryFilterInfo(&FilterInfo))) {
+ if (SUCCEEDED(pinInfo.pFilter->QueryFilterInfo(&filterInfo))) {
CRegKey key;
- PinInfo.pFilter->GetClassID(&FilterClsid);
+ pinInfo.pFilter->GetClassID(&filterClsid);
TCHAR buff[128];
ULONG len = _countof(buff);
- if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11D0-BD40-00A0C911CE86}\\Instance\\") + CStringFromGUID(FilterClsid), KEY_READ)
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11D0-BD40-00A0C911CE86}\\Instance\\") + CStringFromGUID(filterClsid), KEY_READ)
&& ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), buff, &len)) {
strName = CString(buff);
} else {
- strName = FilterInfo.achName;
+ strName = filterInfo.achName;
}
- str.Format(_T("Filter : %s - CLSID : %s\n\n"), strName, CStringFromGUID(FilterClsid));
+ str.Format(_T("Filter : %s - CLSID : %s\n\n"), strName, CStringFromGUID(filterClsid));
AddLine(str);
- FilterInfo.pGraph->Release();
}
- PinInfo.pFilter->Release();
}
CMediaTypeEx cmt;