diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2009-12-31 15:44:23 +0300 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2009-12-31 15:44:23 +0300 |
commit | 5c99409014dc5c036bedc83925fa80c70798a136 (patch) | |
tree | b67d77163616d8464b59c1a01fcb57cfb8a17241 /src/apps/mplayerc | |
parent | fc80dbbc3c0aab4994cdcca30f2a69e7a0d27304 (diff) |
Change : improve options for fullscreen monitor and resolution;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1456 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc')
23 files changed, 119 insertions, 108 deletions
diff --git a/src/apps/mplayerc/PPageOutput.cpp b/src/apps/mplayerc/PPageOutput.cpp index 1dc185f4d..810c16d23 100644 --- a/src/apps/mplayerc/PPageOutput.cpp +++ b/src/apps/mplayerc/PPageOutput.cpp @@ -28,7 +28,6 @@ #include <moreuuids.h>
#include "Monitors.h"
-#include "MultiMonitor.h"
// CPPageOutput dialog
@@ -73,9 +72,6 @@ void CPPageOutput::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_FULLSCREEN_MONITOR_CHECK, m_fD3DFullscreen);
DDX_CBString(pDX, IDC_EVR_BUFFERS, m_iEvrBuffers);
-
- DDX_CBIndex(pDX, IDC_COMBO2, m_iMonitorType);
- DDX_Control(pDX, IDC_COMBO2, m_iMonitorTypeCtrl);
}
BEGIN_MESSAGE_MAP(CPPageOutput, CPPageBase)
@@ -117,56 +113,6 @@ BOOL CPPageOutput::OnInitDialog() m_iEvrBuffers.Format(L"%d", s.iEvrBuffers);
m_fResetDevice = s.fResetDevice;
-
- // Multi-Monitor code
- CString str;
- m_iMonitorType = 0;
-
- CMonitor monitor;
- CMonitors monitors;
-
- m_iMonitorTypeCtrl.AddString(ResStr(IDS_FULLSCREENMONITOR_CURRENT));
- m_MonitorDisplayNames.Add(_T("Current"));
- if(s.f_hmonitor == _T("Current"))
- {
- m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
- }
-
- for ( int i = 0; i < monitors.GetCount(); i++ )
- {
- monitor = monitors.GetMonitor( i );
- monitor.GetName(str);
-
- if(monitor.IsMonitor())
- {
- DISPLAY_DEVICE displayDevice;
- ZeroMemory(&displayDevice, sizeof(displayDevice));
- displayDevice.cb = sizeof(displayDevice);
- VERIFY(EnumDisplayDevices(str, 0, &displayDevice, 0));
-
- m_iMonitorTypeCtrl.AddString(str+_T(" - ")+displayDevice.DeviceString);
- m_MonitorDisplayNames.Add(str);
-
- if(s.f_hmonitor == str && m_iMonitorType == 0)
- {
- m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
- }
- }
- }
-
- //(m_iMonitorTypeCtrl.GetCount() > 2) ? {GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE)} : GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);
- if(m_iMonitorTypeCtrl.GetCount() > 2)
- {
- GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);
- GetDlgItem(IDC_RESETDEVICE)->EnableWindow(TRUE);
- }
- else
- {
- m_iMonitorType = 0;
- GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);
- GetDlgItem(IDC_RESETDEVICE)->EnableWindow(FALSE);
- }
-
m_AudioRendererDisplayNames.Add(_T(""));
m_iAudioRendererTypeCtrl.AddString(_T("System Default"));
m_iAudioRendererType = 0;
@@ -308,12 +254,6 @@ BOOL CPPageOutput::OnApply() else
s.iEvrBuffers = 5;
- if(!(s.f_hmonitor == m_MonitorDisplayNames[m_iMonitorType]))
- {
- memset(&s.dmFullscreenRes, 0, sizeof(s.dmFullscreenRes));
- }
- s.f_hmonitor = m_MonitorDisplayNames[m_iMonitorType];
-
return __super::OnApply();
}
diff --git a/src/apps/mplayerc/PPageOutput.h b/src/apps/mplayerc/PPageOutput.h index efa9a727a..c35d1fa39 100644 --- a/src/apps/mplayerc/PPageOutput.h +++ b/src/apps/mplayerc/PPageOutput.h @@ -35,8 +35,6 @@ class CPPageOutput : public CPPageBase private:
CStringArray m_AudioRendererDisplayNames;
- CStringArray m_MonitorDisplayNames;
-
void DisableRadioButton(UINT nID, UINT nDefID);
public:
@@ -60,9 +58,6 @@ public: BOOL m_fResetDevice;
CString m_iEvrBuffers;
- int m_iMonitorType;
- CComboBox m_iMonitorTypeCtrl;
-
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
diff --git a/src/apps/mplayerc/PPagePlayback.cpp b/src/apps/mplayerc/PPagePlayback.cpp index 7319a79db..1b791094f 100644 --- a/src/apps/mplayerc/PPagePlayback.cpp +++ b/src/apps/mplayerc/PPagePlayback.cpp @@ -27,6 +27,7 @@ #include "PPagePlayback.h"
#include "Monitors.h"
+#include "MultiMonitor.h"
// CPPagePlayback dialog
@@ -72,10 +73,10 @@ void CPPagePlayback::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_CHECK3, m_fAutoloadSubtitles);
DDX_Check(pDX, IDC_CHECK7, m_fEnableWorkerThreadForOpening);
DDX_Check(pDX, IDC_CHECK6, m_fReportFailedPins);
+ DDX_CBIndex(pDX, IDC_COMBO3, m_iMonitorType);
+ DDX_Control(pDX, IDC_COMBO3, m_iMonitorTypeCtrl);
}
-
-
BEGIN_MESSAGE_MAP(CPPagePlayback, CPPageBase)
ON_WM_HSCROLL()
ON_CONTROL_RANGE(BN_CLICKED, IDC_RADIO1, IDC_RADIO2, OnBnClickedRadio12)
@@ -83,6 +84,7 @@ BEGIN_MESSAGE_MAP(CPPagePlayback, CPPageBase) ON_UPDATE_COMMAND_UI(IDC_STATIC1, OnUpdateLoopNum)
ON_UPDATE_COMMAND_UI(IDC_COMBO1, OnUpdateAutoZoomCombo)
ON_UPDATE_COMMAND_UI(IDC_COMBO2, OnUpdateDispModeCombo)
+ ON_CBN_SELCHANGE(IDC_COMBO3, OnUpdateFullScrCombo)
END_MESSAGE_MAP()
@@ -105,50 +107,58 @@ BOOL CPPagePlayback::OnInitDialog() m_fRewind = s.fRewind;
m_iZoomLevel = s.iZoomLevel;
m_iRememberZoomLevel = s.fRememberZoomLevel;
+ m_dmFullscreenRes = s.dmFullscreenRes;
+ m_f_hmonitor = s.f_hmonitor;
- CMonitors monitors;
- m_fSetFullscreenRes = s.dmFullscreenRes.fValid;
- int iSel = -1;
- dispmode dm, dmtoset = s.dmFullscreenRes;
- if(!dmtoset.fValid) GetCurDispMode(dmtoset, s.f_hmonitor);
+ //-> Multi-Monitor code
CString str;
- dispmode dm1;
- for(int i = 0, j = 0, ModeExist = true; ; i++)
+ m_iMonitorType = 0;
+
+ CMonitor monitor;
+ CMonitors monitors;
+
+ m_iMonitorTypeCtrl.AddString(ResStr(IDS_FULLSCREENMONITOR_CURRENT));
+ m_MonitorDisplayNames.Add(_T("Current"));
+ if(m_f_hmonitor == _T("Current"))
{
- ModeExist = GetDispMode(i, dm, s.f_hmonitor);
- if (!ModeExist) break;
- if(dm.bpp <= 8) continue;
- if(dm.size.cx == 1920 && dm.size.cy == 1080 && dm.freq==24) //HDMI MODE EXIST,
- //ADD Modes 1920x1080 16bpp AUTO, 1920x1080 24bpp AUTO, 1920x1080 32bpp AUTO.
+ m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
+ }
+
+ for ( int i = 0; i < monitors.GetCount(); i++ )
+ {
+ monitor = monitors.GetMonitor( i );
+ monitor.GetName(str);
+
+ if(monitor.IsMonitor())
{
- dm1=dm;
- dm1.freq=-1; //AUTO1 Mode Marker
- m_dms.Add(dm1); // Add AUTO-HDMI Mode To Modes Array.
- str.Format(_T("%dx%d %dbpp AUTO 23.97@24, 25.00@25, 29.97@30"), dm.size.cx, dm.size.cy, dm.bpp);
- m_dispmodecombo.AddString(str);
- j++;
- dm1.freq=-2; //AUTO2 Mode Marker
- m_dms.Add(dm1); // Add AUTO-HDMI Mode To Modes Array.
- str.Format(_T("%dx%d %dbpp AUTO 23.97@24, 25.00@50, 29.97@60"), dm.size.cx, dm.size.cy, dm.bpp);
- m_dispmodecombo.AddString(str);
- j++;
+ DISPLAY_DEVICE displayDevice;
+ ZeroMemory(&displayDevice, sizeof(displayDevice));
+ displayDevice.cb = sizeof(displayDevice);
+ VERIFY(EnumDisplayDevices(str, 0, &displayDevice, 0));
+
+ m_iMonitorTypeCtrl.AddString(str+_T(" - ")+displayDevice.DeviceString);
+ m_MonitorDisplayNames.Add(str);
+
+ if(m_f_hmonitor == str && m_iMonitorType == 0)
+ {
+ m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
+ }
}
- m_dms.Add(dm); // 1920x1080 16bpp 24Hz, 1920x1080 24bpp 25Hz, 1920x1080 32bpp 30Hz also exist
- str.Format(_T("%dx%d %dbpp %dHz"), dm.size.cx, dm.size.cy, dm.bpp, dm.freq);
- m_dispmodecombo.AddString(str);
-
- if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
- && dm.bpp == dmtoset.bpp && dm.freq == dmtoset.freq)
- iSel = j;
- if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
- && dm.bpp == dmtoset.bpp && dmtoset.freq== -1 && dm.freq==24)
- iSel = j-2;
- if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
- && dm.bpp == dmtoset.bpp && dmtoset.freq== -2 && dm.freq==24)
- iSel = j-1;
- j++;
}
- m_dispmodecombo.SetCurSel(iSel);
+
+ //(m_iMonitorTypeCtrl.GetCount() > 2) ? {GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE)} : GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);
+ if(m_iMonitorTypeCtrl.GetCount() > 2)
+ {
+ GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);
+ }
+ else
+ {
+ m_iMonitorType = 0;
+ GetDlgItem(IDC_COMBO3)->EnableWindow(FALSE);
+ }
+ //<- Multi-Monitor code
+
+ CPPagePlayback::ModesUpdate();
m_fAutoloadAudio = s.fAutoloadAudio;
m_fAutoloadSubtitles = s.fAutoloadSubtitles;
@@ -181,6 +191,8 @@ BOOL CPPagePlayback::OnApply() s.fAutoloadSubtitles = !!m_fAutoloadSubtitles;
s.fEnableWorkerThreadForOpening = !!m_fEnableWorkerThreadForOpening;
s.fReportFailedPins = !!m_fReportFailedPins;
+ s.dmFullscreenRes = m_dmFullscreenRes;
+ s.f_hmonitor = m_f_hmonitor;
return __super::OnApply();
}
@@ -232,3 +244,59 @@ void CPPagePlayback::OnUpdateDispModeCombo(CCmdUI* pCmdUI) {
pCmdUI->Enable(!!IsDlgButtonChecked(IDC_CHECK4));
}
+
+void CPPagePlayback::OnUpdateFullScrCombo()
+{
+ CMonitors monitors;
+ m_f_hmonitor = m_MonitorDisplayNames[m_iMonitorTypeCtrl.GetCurSel()];
+ ModesUpdate();
+}
+void CPPagePlayback::ModesUpdate()
+{
+ CMonitors monitors;
+ m_fSetFullscreenRes = m_dmFullscreenRes.fValid;
+ int iSel = -1;
+ dispmode dm, dmtoset = m_dmFullscreenRes;
+ if(!dmtoset.fValid) GetCurDispMode(dmtoset, m_f_hmonitor);
+ CString str;
+ dispmode dm1;
+
+ ComboBox_ResetContent(m_dispmodecombo);
+ m_dms.IsEmpty();
+ for(int i = 0, j = 0, ModeExist = true; ; i++)
+ {
+ ModeExist = GetDispMode(i, dm, m_f_hmonitor);
+ if (!ModeExist) break;
+ if(dm.bpp <= 8) continue;
+ if(dm.size.cx == 1920 && dm.size.cy == 1080 && dm.freq==24) //HDMI MODE EXIST,
+ //ADD Modes 1920x1080 16bpp AUTO, 1920x1080 24bpp AUTO, 1920x1080 32bpp AUTO.
+ {
+ dm1=dm;
+ dm1.freq=-1; //AUTO1 Mode Marker
+ m_dms.Add(dm1); // Add AUTO-HDMI Mode To Modes Array.
+ str.Format(_T("%dx%d %dbpp AUTO 23.97@24, 25.00@25, 29.97@30"), dm.size.cx, dm.size.cy, dm.bpp);
+ m_dispmodecombo.AddString(str);
+ j++;
+ dm1.freq=-2; //AUTO2 Mode Marker
+ m_dms.Add(dm1); // Add AUTO-HDMI Mode To Modes Array.
+ str.Format(_T("%dx%d %dbpp AUTO 23.97@24, 25.00@50, 29.97@60"), dm.size.cx, dm.size.cy, dm.bpp);
+ m_dispmodecombo.AddString(str);
+ j++;
+ }
+ m_dms.Add(dm); // 1920x1080 16bpp 24Hz, 1920x1080 24bpp 25Hz, 1920x1080 32bpp 30Hz also exist
+ str.Format(_T("%dx%d %dbpp %dHz"), dm.size.cx, dm.size.cy, dm.bpp, dm.freq);
+ m_dispmodecombo.AddString(str);
+
+ if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
+ && dm.bpp == dmtoset.bpp && dm.freq == dmtoset.freq)
+ iSel = j;
+ if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
+ && dm.bpp == dmtoset.bpp && dmtoset.freq== -1 && dm.freq==24)
+ iSel = j-2;
+ if(iSel < 0 && dmtoset.fValid && dm.size == dmtoset.size
+ && dm.bpp == dmtoset.bpp && dmtoset.freq== -2 && dm.freq==24)
+ iSel = j-1;
+ j++;
+ }
+ m_dispmodecombo.SetCurSel(iSel);
+}
diff --git a/src/apps/mplayerc/PPagePlayback.h b/src/apps/mplayerc/PPagePlayback.h index b345df771..070c432b3 100644 --- a/src/apps/mplayerc/PPagePlayback.h +++ b/src/apps/mplayerc/PPagePlayback.h @@ -34,7 +34,7 @@ class CPPagePlayback : public CPPageBase private:
CAtlArray<dispmode> m_dms;
-
+ CStringArray m_MonitorDisplayNames;
public:
CPPagePlayback();
virtual ~CPPagePlayback();
@@ -55,6 +55,11 @@ public: BOOL m_fAutoloadSubtitles;
BOOL m_fEnableWorkerThreadForOpening;
BOOL m_fReportFailedPins;
+
+ dispmode m_dmFullscreenRes;
+ CStringW m_f_hmonitor;
+ int m_iMonitorType;
+ CComboBox m_iMonitorTypeCtrl;
// Dialog Data
enum { IDD = IDD_PPAGEPLAYBACK };
@@ -73,4 +78,6 @@ public: afx_msg void OnUpdateLoopNum(CCmdUI* pCmdUI);
afx_msg void OnUpdateAutoZoomCombo(CCmdUI* pCmdUI);
afx_msg void OnUpdateDispModeCombo(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateFullScrCombo();
+ void ModesUpdate();
};
diff --git a/src/apps/mplayerc/mplayerc.br.rc b/src/apps/mplayerc/mplayerc.br.rc Binary files differindex 6b1c09fd5..41f2e9b4f 100644 --- a/src/apps/mplayerc/mplayerc.br.rc +++ b/src/apps/mplayerc/mplayerc.br.rc diff --git a/src/apps/mplayerc/mplayerc.by.rc b/src/apps/mplayerc/mplayerc.by.rc Binary files differindex 428c9bf64..0e80c3e6a 100644 --- a/src/apps/mplayerc/mplayerc.by.rc +++ b/src/apps/mplayerc/mplayerc.by.rc diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index fe4e6cc79..29cfd36b2 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -2702,15 +2702,16 @@ void GetCurDispMode(dispmode& dm, CString& DisplayName) bool GetDispMode(int i, dispmode& dm, CString& DisplayName)
{
DEVMODE devmode;
+ CString DisplayName1 = DisplayName;
devmode.dmSize = sizeof(DEVMODE);
if ((DisplayName == _T("Current")) || (DisplayName == _T("")))
{
CMonitor monitor;
CMonitors monitors;
monitor = monitors.GetPrimaryMonitor();
- monitor.GetName(DisplayName);
+ monitor.GetName(DisplayName1);
}
- if(!EnumDisplaySettings(DisplayName, i, &devmode))
+ if(!EnumDisplaySettings(DisplayName1, i, &devmode))
return(false);
dm.fValid = true;
dm.size = CSize(devmode.dmPelsWidth, devmode.dmPelsHeight);
diff --git a/src/apps/mplayerc/mplayerc.cz.rc b/src/apps/mplayerc/mplayerc.cz.rc Binary files differindex 309008113..60293dff8 100644 --- a/src/apps/mplayerc/mplayerc.cz.rc +++ b/src/apps/mplayerc/mplayerc.cz.rc diff --git a/src/apps/mplayerc/mplayerc.de.rc b/src/apps/mplayerc/mplayerc.de.rc Binary files differindex 107479695..23e5c1c75 100644 --- a/src/apps/mplayerc/mplayerc.de.rc +++ b/src/apps/mplayerc/mplayerc.de.rc diff --git a/src/apps/mplayerc/mplayerc.es.rc b/src/apps/mplayerc/mplayerc.es.rc Binary files differindex dcd01b741..314cd6a1f 100644 --- a/src/apps/mplayerc/mplayerc.es.rc +++ b/src/apps/mplayerc/mplayerc.es.rc diff --git a/src/apps/mplayerc/mplayerc.fr.rc b/src/apps/mplayerc/mplayerc.fr.rc Binary files differindex b29cefe77..4a629e4a0 100644 --- a/src/apps/mplayerc/mplayerc.fr.rc +++ b/src/apps/mplayerc/mplayerc.fr.rc diff --git a/src/apps/mplayerc/mplayerc.hu.rc b/src/apps/mplayerc/mplayerc.hu.rc Binary files differindex 78d4a4da2..6ddbbda29 100644 --- a/src/apps/mplayerc/mplayerc.hu.rc +++ b/src/apps/mplayerc/mplayerc.hu.rc diff --git a/src/apps/mplayerc/mplayerc.it.rc b/src/apps/mplayerc/mplayerc.it.rc Binary files differindex 69e5f310e..eb00c971c 100644 --- a/src/apps/mplayerc/mplayerc.it.rc +++ b/src/apps/mplayerc/mplayerc.it.rc diff --git a/src/apps/mplayerc/mplayerc.kr.rc b/src/apps/mplayerc/mplayerc.kr.rc Binary files differindex ac7f4b040..c4596478d 100644 --- a/src/apps/mplayerc/mplayerc.kr.rc +++ b/src/apps/mplayerc/mplayerc.kr.rc diff --git a/src/apps/mplayerc/mplayerc.pl.rc b/src/apps/mplayerc/mplayerc.pl.rc Binary files differindex 8ba0d027c..72f645313 100644 --- a/src/apps/mplayerc/mplayerc.pl.rc +++ b/src/apps/mplayerc/mplayerc.pl.rc diff --git a/src/apps/mplayerc/mplayerc.rc b/src/apps/mplayerc/mplayerc.rc Binary files differindex c1af36d2e..cd99ce68b 100644 --- a/src/apps/mplayerc/mplayerc.rc +++ b/src/apps/mplayerc/mplayerc.rc diff --git a/src/apps/mplayerc/mplayerc.ru.rc b/src/apps/mplayerc/mplayerc.ru.rc Binary files differindex 6dfb1e769..3aa57e1bb 100644 --- a/src/apps/mplayerc/mplayerc.ru.rc +++ b/src/apps/mplayerc/mplayerc.ru.rc diff --git a/src/apps/mplayerc/mplayerc.sc.rc b/src/apps/mplayerc/mplayerc.sc.rc Binary files differindex d1861a79e..7575b6195 100644 --- a/src/apps/mplayerc/mplayerc.sc.rc +++ b/src/apps/mplayerc/mplayerc.sc.rc diff --git a/src/apps/mplayerc/mplayerc.sk.rc b/src/apps/mplayerc/mplayerc.sk.rc Binary files differindex bf5a42ff3..cc79f155e 100644 --- a/src/apps/mplayerc/mplayerc.sk.rc +++ b/src/apps/mplayerc/mplayerc.sk.rc diff --git a/src/apps/mplayerc/mplayerc.sv.rc b/src/apps/mplayerc/mplayerc.sv.rc Binary files differindex 3b9dfed33..58d373fe4 100644 --- a/src/apps/mplayerc/mplayerc.sv.rc +++ b/src/apps/mplayerc/mplayerc.sv.rc diff --git a/src/apps/mplayerc/mplayerc.tc.rc b/src/apps/mplayerc/mplayerc.tc.rc Binary files differindex 672e37e1c..8e25ebed3 100644 --- a/src/apps/mplayerc/mplayerc.tc.rc +++ b/src/apps/mplayerc/mplayerc.tc.rc diff --git a/src/apps/mplayerc/mplayerc.tr.rc b/src/apps/mplayerc/mplayerc.tr.rc Binary files differindex 487ae8def..d919a0574 100644 --- a/src/apps/mplayerc/mplayerc.tr.rc +++ b/src/apps/mplayerc/mplayerc.tr.rc diff --git a/src/apps/mplayerc/mplayerc.ua.rc b/src/apps/mplayerc/mplayerc.ua.rc Binary files differindex a01224960..f156f66ec 100644 --- a/src/apps/mplayerc/mplayerc.ua.rc +++ b/src/apps/mplayerc/mplayerc.ua.rc |