diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2007-08-25 18:36:49 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2007-08-25 18:36:49 +0400 |
commit | 9b543b7df8611a5504ea4a33e99aa96a7f9f622e (patch) | |
tree | 2772a81970c17bd79fbfc5dc9e9ba6d46e534aac /src/apps | |
parent | 57aef48cecb4f620729b6f1101cbdb5d7ed44787 (diff) |
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@168 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps')
-rw-r--r-- | src/apps/mplayerc/AllocatorCommon.h | 1 | ||||
-rw-r--r-- | src/apps/mplayerc/DX9AllocatorPresenter.cpp | 41 | ||||
-rw-r--r-- | src/apps/mplayerc/EVRAllocatorPresenter.cpp | 146 | ||||
-rw-r--r-- | src/apps/mplayerc/History.txt | 5 | ||||
-rw-r--r-- | src/apps/mplayerc/MainFrm.cpp | 3 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageCasimir.cpp | 6 | ||||
-rw-r--r-- | src/apps/mplayerc/VMROSD.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.cpp | 57 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.h | 4 |
9 files changed, 186 insertions, 79 deletions
diff --git a/src/apps/mplayerc/AllocatorCommon.h b/src/apps/mplayerc/AllocatorCommon.h index da4dacb82..bcabab867 100644 --- a/src/apps/mplayerc/AllocatorCommon.h +++ b/src/apps/mplayerc/AllocatorCommon.h @@ -113,6 +113,7 @@ namespace DSObjects int m_nCurSurface; // Surface currently displayed
long m_nUsedBuffer;
+ double m_fAvrFps; // Estimate the real FPS
LONGLONG m_pllJitter [NB_JITTER]; // Jitter buffer for stats
LONGLONG m_llLastPerf;
int m_nNextJitter;
diff --git a/src/apps/mplayerc/DX9AllocatorPresenter.cpp b/src/apps/mplayerc/DX9AllocatorPresenter.cpp index fc33caf51..ce43d784f 100644 --- a/src/apps/mplayerc/DX9AllocatorPresenter.cpp +++ b/src/apps/mplayerc/DX9AllocatorPresenter.cpp @@ -232,6 +232,7 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, HRESULT& hr) m_nNextJitter = 0;
m_llLastPerf = 0;
m_rtTimePerFrame = 0;
+ m_fAvrFps = 0.0;
}
CDX9AllocatorPresenter::~CDX9AllocatorPresenter()
@@ -573,7 +574,7 @@ HRESULT CDX9AllocatorPresenter::InitResizers(float bicubicA) if(m_bicubicA)
{
if(FAILED(m_pD3DDev->CreateTexture(
- min(max(2048, m_ScreenSize.cx), m_caps.MaxTextureWidth), m_NativeVideoSize.cy, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
+ min(max(2048, m_ScreenSize.cx), (int)m_caps.MaxTextureWidth), m_NativeVideoSize.cy, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, &m_pResizerBicubic1stPass, NULL)))
{
ASSERT(0);
@@ -757,7 +758,7 @@ HRESULT CDX9AllocatorPresenter::TextureResizeBicubic2pass(CComPtr<IDirect3DTextu ASSERT(dst1.Height() == desc.Height);
- if(dst1.Width() > desc.Width || dst1.Height() > desc.Height)
+ if(dst1.Width() > (int)desc.Width || dst1.Height() > (int)desc.Height)
// if(dst1.Width() != desc.Width || dst1.Height() != desc.Height)
return TextureResizeBicubic1pass(pTexture, dst);
@@ -1108,10 +1109,16 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll) // Calculate the jitter!
LONGLONG llPerf = AfxGetMyApp()->GetPerfCounter();
- if ((m_rtTimePerFrame != 0) && (labs (llPerf - m_llLastPerf) < m_rtTimePerFrame*3))
+ if ((m_rtTimePerFrame != 0) && (labs ((long)(llPerf - m_llLastPerf)) < m_rtTimePerFrame*3) )
{
m_nNextJitter = (m_nNextJitter+1) % NB_JITTER;
m_pllJitter[m_nNextJitter] = llPerf - m_llLastPerf - m_rtTimePerFrame;
+
+ // Calculate the real FPS
+ LONGLONG llJitterSum = 0;
+ for (int i=0; i<NB_JITTER; i++)
+ llJitterSum += m_pllJitter[i];
+ m_fAvrFps = 10000000.0/(llJitterSum/125 + m_rtTimePerFrame);
}
m_llLastPerf = llPerf;
@@ -1148,8 +1155,6 @@ void CDX9AllocatorPresenter::DrawStats() D3DXVECTOR2 Points[NB_JITTER];
int nIndex;
RECT rc = {700, 40, 0, 0 };
- double fAvrFps;
- LONGLONG llJitterSum = 0;
LONGLONG llMaxJitter = MINLONG64;
LONGLONG llMinJitter = MAXLONG64;
@@ -1157,12 +1162,12 @@ void CDX9AllocatorPresenter::DrawStats() m_pLine->SetWidth(1.0); // Width
for (int i=10; i<500; i+= 20)
{
- Points[0].x = 0;
- Points[0].y = i;
- Points[1].x = (i-10)%80 ? 50 : 625;
- Points[1].y = i;
+ Points[0].x = (FLOAT)0;
+ Points[0].y = (FLOAT)i;
+ Points[1].x = (FLOAT)((i-10)%80 ? 50 : 625);
+ Points[1].y = (FLOAT)i;
if (i == 250) Points[1].x += 50;
- m_pLine->SetWidth(i == 250 ? 2.0 : 1.0); // Width
+ m_pLine->SetWidth(i == 250 ? 2.0F : 1.0F); // Width
m_pLine->Begin();
m_pLine->Draw (Points, 2, D3DCOLOR_XRGB(0,0,255));
m_pLine->End();
@@ -1174,9 +1179,8 @@ void CDX9AllocatorPresenter::DrawStats() for (int i=0; i<NB_JITTER; i++)
{
nIndex = (m_nNextJitter+i) % NB_JITTER;
- Points[i].x = i*5+5;
- Points[i].y = m_pllJitter[nIndex]/5000 + 250;
- llJitterSum += m_pllJitter[nIndex];
+ Points[i].x = (FLOAT)(i*5+5);
+ Points[i].y = (FLOAT)(m_pllJitter[nIndex]/5000 + 250);
llMaxJitter = max(llMaxJitter, m_pllJitter[nIndex]);
llMinJitter = min(llMinJitter, m_pllJitter[nIndex]);
}
@@ -1186,9 +1190,8 @@ void CDX9AllocatorPresenter::DrawStats() // === Text
CString strText;
- fAvrFps = 10000000.0/(llJitterSum/125 + m_rtTimePerFrame);
- strText.Format(L"Frame rate : %.03f (%I64d µs)", fAvrFps, m_rtTimePerFrame / 10);
+ strText.Format(L"Frame rate : %.03f (%I64d µs)", m_fAvrFps, m_rtTimePerFrame / 10);
m_pFont->DrawText( NULL, strText, -1, &rc, DT_NOCLIP, D3DXCOLOR( 1.0f, 0.0f, 0.0f, 1.0f ));
OffsetRect (&rc, 0, 30);
@@ -1294,22 +1297,22 @@ void CDX9AllocatorPresenter::EstimateFrameRate (REFERENCE_TIME rtStart) REFERENCE_TIME rtCurDuration = rtStart - rtLast;
- if (labs (rtCurDuration - m_rtCandidate) <= 20000)
+ if (labs ((long)(rtCurDuration - m_rtCandidate)) <= 20000)
{
if (nCount <= 6) nCount++;
if (nCount == 5)
{
- if ( labs(rtCurDuration - 417080) < FRAMERATE_MAX_DELTA)
+ if ( labs(long (rtCurDuration - 417080)) < FRAMERATE_MAX_DELTA)
{
m_rtTimePerFrame = 417080;
m_fps = 23.976;
}
- else if ( labs(rtCurDuration - 400000) < FRAMERATE_MAX_DELTA)
+ else if (labs((long)(rtCurDuration - 400000)) < FRAMERATE_MAX_DELTA)
{
m_rtTimePerFrame = 400000;
m_fps = 25.000;
}
- else if ( labs(rtCurDuration - 333600) < FRAMERATE_MAX_DELTA)
+ else if (labs((long)(rtCurDuration - 333600)) < FRAMERATE_MAX_DELTA)
{
m_rtTimePerFrame = 333600;
m_fps = 29.976;
diff --git a/src/apps/mplayerc/EVRAllocatorPresenter.cpp b/src/apps/mplayerc/EVRAllocatorPresenter.cpp index dd933d90e..b9bacdb49 100644 --- a/src/apps/mplayerc/EVRAllocatorPresenter.cpp +++ b/src/apps/mplayerc/EVRAllocatorPresenter.cpp @@ -187,10 +187,10 @@ class CEVRAllocatorPresenter : public IMFAsyncCallback,
public IQualProp,
- public IMFRateSupport // Non mandatory EVR Presenter Interfaces (see later...)
+ public IMFRateSupport, // Non mandatory EVR Presenter Interfaces (see later...)
+ public IMFVideoDisplayControl
/* public IMFVideoPositionMapper,
public IEVRTrustedVideoPlugin,
- public IMFVideoDisplayControl
*/
{
public:
@@ -250,6 +250,23 @@ public: STDMETHODIMP GetParameters( /* [out] */ __RPC__out DWORD *pdwFlags, /* [out] */ __RPC__out DWORD *pdwQueue);
STDMETHODIMP Invoke ( /* [in] */ __RPC__in_opt IMFAsyncResult *pAsyncResult);
+ // IMFVideoDisplayControl
+ STDMETHODIMP GetNativeVideoSize(SIZE *pszVideo, SIZE *pszARVideo);
+ STDMETHODIMP GetIdealVideoSize(SIZE *pszMin, SIZE *pszMax);
+ STDMETHODIMP SetVideoPosition(const MFVideoNormalizedRect *pnrcSource, const LPRECT prcDest);
+ STDMETHODIMP GetVideoPosition(MFVideoNormalizedRect *pnrcSource, LPRECT prcDest);
+ STDMETHODIMP SetAspectRatioMode(DWORD dwAspectRatioMode);
+ STDMETHODIMP GetAspectRatioMode(DWORD *pdwAspectRatioMode);
+ STDMETHODIMP SetVideoWindow(HWND hwndVideo);
+ STDMETHODIMP GetVideoWindow(HWND *phwndVideo);
+ STDMETHODIMP RepaintVideo( void);
+ STDMETHODIMP GetCurrentImage(BITMAPINFOHEADER *pBih, BYTE **pDib, DWORD *pcbDib, LONGLONG *pTimeStamp);
+ STDMETHODIMP SetBorderColor(COLORREF Clr);
+ STDMETHODIMP GetBorderColor(COLORREF *pClr);
+ STDMETHODIMP SetRenderingPrefs(DWORD dwRenderFlags);
+ STDMETHODIMP GetRenderingPrefs(DWORD *pdwRenderFlags);
+ STDMETHODIMP SetFullscreen(BOOL fFullscreen);
+ STDMETHODIMP GetFullscreen(BOOL *pfFullscreen);
// IDirect3DDeviceManager9
STDMETHODIMP ResetDevice(IDirect3DDevice9 *pDevice,UINT resetToken);
@@ -298,8 +315,6 @@ private : // Stats variable for IQualProp
UINT m_pcFrames;
UINT m_pcFramesDrawn; // Retrieves the number of frames drawn since streaming started
- UINT m_piAvgFrameRate;
- UINT m_iJitter;
UINT m_piAvg;
UINT m_piDev;
@@ -422,8 +437,6 @@ void CEVRAllocatorPresenter::ResetStats() {
m_pcFrames = 0;
m_pcFramesDrawn = 0;
- m_piAvgFrameRate = 0;
- m_iJitter = 100;
m_piAvg = 0;
m_piDev = 0;
}
@@ -557,6 +570,8 @@ STDMETHODIMP CEVRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, vo hr = GetInterface((IMFGetService*)this, ppv);
else if(riid == __uuidof(IMFAsyncCallback))
hr = GetInterface((IMFAsyncCallback*)this, ppv);
+ else if(riid == __uuidof(IMFVideoDisplayControl))
+ hr = GetInterface((IMFVideoDisplayControl*)this, ppv);
else if(riid == IID_IQualProp)
hr = GetInterface((IQualProp*)this, ppv);
else if(riid == __uuidof(IMFRateSupport))
@@ -628,12 +643,12 @@ STDMETHODIMP CEVRAllocatorPresenter::get_FramesDrawn(int *pcFramesDrawn) }
STDMETHODIMP CEVRAllocatorPresenter::get_AvgFrameRate(int *piAvgFrameRate)
{
- *piAvgFrameRate = m_piAvgFrameRate;
+ *piAvgFrameRate = (int)(m_fAvrFps * 100);
return S_OK;
}
STDMETHODIMP CEVRAllocatorPresenter::get_Jitter(int *iJitter)
{
- *iJitter = m_iJitter;
+ *iJitter = (int)(m_pllJitter[m_nNextJitter]/5000);
return S_OK;
}
STDMETHODIMP CEVRAllocatorPresenter::get_AvgSyncOffset(int *piAvg)
@@ -851,6 +866,9 @@ HRESULT CEVRAllocatorPresenter::CreateProposedOutputType(IMFMediaType* pMixerTyp VideoFormat = (MFVIDEOFORMAT*)pAMMedia->pbFormat;
hr = pfMFCreateVideoMediaType (VideoFormat, &m_pMediaType);
+ m_AspectRatio.cx = VideoFormat->videoInfo.PixelAspectRatio.Numerator;
+ m_AspectRatio.cy = VideoFormat->videoInfo.PixelAspectRatio.Denominator;
+
if (SUCCEEDED (hr))
{
i64Size.HighPart = VideoFormat->videoInfo.dwWidth;
@@ -859,8 +877,8 @@ HRESULT CEVRAllocatorPresenter::CreateProposedOutputType(IMFMediaType* pMixerTyp m_pMediaType->SetUINT32 (MF_MT_PAN_SCAN_ENABLED, 0);
- i64Size.HighPart = 1;
- i64Size.LowPart = 1;
+ i64Size.HighPart = m_AspectRatio.cx;
+ i64Size.LowPart = m_AspectRatio.cy;
m_pMediaType->SetUINT64 (MF_MT_PIXEL_ASPECT_RATIO, i64Size.QuadPart);
MFVideoArea Area = MakeArea (0, 0, VideoFormat->videoInfo.dwWidth, VideoFormat->videoInfo.dwHeight);
@@ -1027,7 +1045,7 @@ HRESULT CEVRAllocatorPresenter::GetImageFromMixer() MFTIME nsDuration;
float m_fps;
Buffer.pSample->GetSampleDuration(&nsDuration);
- m_fps = 10000000.0 / nsDuration;
+ m_fps = (float)(10000000.0 / nsDuration);
m_pSubPicQueue->SetFPS(m_fps);
__super::SetTime (g_tSegmentStart + nsSampleTime);
}
@@ -1144,6 +1162,98 @@ STDMETHODIMP CEVRAllocatorPresenter::Invoke ( /* [in] */ __RPC__in_opt IMFAsyn }
+// IMFVideoDisplayControl
+STDMETHODIMP CEVRAllocatorPresenter::GetNativeVideoSize(SIZE *pszVideo, SIZE *pszARVideo)
+{
+ if (pszVideo)
+ {
+ pszVideo->cx = m_NativeVideoSize.cx;
+ pszVideo->cy = m_NativeVideoSize.cy;
+ }
+ if (pszARVideo)
+ {
+ pszARVideo->cx = m_NativeVideoSize.cx * m_AspectRatio.cx;
+ pszARVideo->cy = m_NativeVideoSize.cy * m_AspectRatio.cy;
+ }
+ return S_OK;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetIdealVideoSize(SIZE *pszMin, SIZE *pszMax)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetVideoPosition(const MFVideoNormalizedRect *pnrcSource, const LPRECT prcDest)
+{
+// ASSERT (FALSE);
+ return S_OK;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetVideoPosition(MFVideoNormalizedRect *pnrcSource, LPRECT prcDest)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetAspectRatioMode(DWORD dwAspectRatioMode)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetAspectRatioMode(DWORD *pdwAspectRatioMode)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetVideoWindow(HWND hwndVideo)
+{
+// ASSERT (FALSE);
+ return S_OK;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetVideoWindow(HWND *phwndVideo)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::RepaintVideo()
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetCurrentImage(BITMAPINFOHEADER *pBih, BYTE **pDib, DWORD *pcbDib, LONGLONG *pTimeStamp)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetBorderColor(COLORREF Clr)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetBorderColor(COLORREF *pClr)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetRenderingPrefs(DWORD dwRenderFlags)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetRenderingPrefs(DWORD *pdwRenderFlags)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::SetFullscreen(BOOL fFullscreen)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+STDMETHODIMP CEVRAllocatorPresenter::GetFullscreen(BOOL *pfFullscreen)
+{
+ ASSERT (FALSE);
+ return E_NOTIMPL;
+}
+
+
// IDirect3DDeviceManager9
STDMETHODIMP CEVRAllocatorPresenter::ResetDevice(IDirect3DDevice9 *pDevice,UINT resetToken)
{
@@ -1198,6 +1308,9 @@ STDMETHODIMP CEVRAllocatorPresenter::GetVideoService(HANDLE hDevice, REFIID riid STDMETHODIMP CEVRAllocatorPresenter::GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight)
{
+ // This function should be called...
+ ASSERT (FALSE);
+
if(lpWidth) *lpWidth = m_NativeVideoSize.cx;
if(lpHeight) *lpHeight = m_NativeVideoSize.cy;
if(lpARWidth) *lpARWidth = m_AspectRatio.cx;
@@ -1263,7 +1376,7 @@ STDMETHODIMP CEVRAllocatorPresenter::InitializeDevice(AM_MEDIA_TYPE* pMediaType) int w = vih2->bmiHeader.biWidth;
int h = abs(vih2->bmiHeader.biHeight);
- m_NativeVideoSize = m_AspectRatio = CSize(w, h);
+ m_NativeVideoSize = CSize(w, h);
// TODO : mauvais aspect ratio ici !!!
// int arx = vih2->dwPictAspectRatioX, ary = vih2->dwPictAspectRatioY;
@@ -1310,8 +1423,6 @@ void CEVRAllocatorPresenter::RenderThread() DWORD dwUser = 0;
DWORD dwObject;
- LONGLONG llPerfTotalPlay = 0;
- LONGLONG llPerfLastFrame = 0;
UINT nNbPlayingFrame = 0;
// Tell Vista Multimedia Class Scheduler we are a playback thretad (increase priority)
@@ -1382,14 +1493,7 @@ void CEVRAllocatorPresenter::RenderThread() dwUser = timeSetEvent (lDelay, dwResolution, (LPTIMECALLBACK)m_hEvtFrameTimer, NULL, TIME_CALLBACK_EVENT_SET);
// Update statistics
- LONGLONG llPerfCurrent = AfxGetMyApp()->GetPerfCounter();
-
- llPerfTotalPlay += (llPerfCurrent - llPerfLastFrame);
nNbPlayingFrame++;
- m_piAvgFrameRate = (UINT)(Int32x32To64(nNbPlayingFrame, 1000000000) / llPerfTotalPlay);
- m_iJitter = (UINT)(((llPerfCurrent - llPerfLastFrame) - m_rtTimePerFrame)/10000);
-
- llPerfLastFrame = llPerfCurrent;
}
else
{
diff --git a/src/apps/mplayerc/History.txt b/src/apps/mplayerc/History.txt index 54e803295..e91ab1dd9 100644 --- a/src/apps/mplayerc/History.txt +++ b/src/apps/mplayerc/History.txt @@ -1,8 +1,9 @@ -- TODO : problème d'aspect ratio !!!
+- Fixed : wrong aspect ration with EVR custom (definitely i hope :-)
- Added : latests Clsid patches (Bento4 0.9.3, faad2 2.6b, dtsdec 0.0.2, libmad 0.15.1b, libpng 1.2.18, zlib 1.2.3, mpeg decoder: progressive frames fix, mpeg decoder: dsutil interlaced fix v2)
- Added : command line "/d3dfs" to start MPC in D3D fullscreen mode
-- Added : command line "/exitafterpb" to exist MPC automaticly after end of playback
- Added : logitech lcd support (g15)
+- Modify : remember file position and DVD position work only when "Keep history" is set
+- Modify : screen saver is now kick only when a video is playing
1.0.9.0
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index 9f23bb556..476f4d50b 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -1163,7 +1163,7 @@ void CMainFrame::OnDisplayChange() // untested, not sure if it's working... void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
- if( ((nID & 0xFFF0) == SC_SCREENSAVE) || ((nID & 0xFFF0) == SC_MONITORPOWER))
+ if ((GetMediaState() == State_Running) && (((nID & 0xFFF0) == SC_SCREENSAVE) || ((nID & 0xFFF0) == SC_MONITORPOWER)))
{
TRACE(_T("SC_SCREENSAVE, nID = %d, lParam = %d\n"), nID, lParam);
return;
@@ -1788,7 +1788,6 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) else
{
if(s.fRewind) SendMessage(WM_COMMAND, ID_PLAY_STOP);
- if(s.ExitAfterPlayback()) SendMessage(WM_COMMAND, ID_FILE_EXIT);
else m_fEndOfStream = true;
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
diff --git a/src/apps/mplayerc/PPageCasimir.cpp b/src/apps/mplayerc/PPageCasimir.cpp index 689460bf3..e437bda3a 100644 --- a/src/apps/mplayerc/PPageCasimir.cpp +++ b/src/apps/mplayerc/PPageCasimir.cpp @@ -123,6 +123,9 @@ BOOL CPPageCasimir::OnInitDialog() m_SliSaturation.SetPos ((int)(m_dSaturation*100));
}
+ GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
+ GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
+
GetDlgItem(IDC_INSTALLPN31)->SendMessage (BCM_SETSHIELD, 0, 1);
GetDlgItem(IDC_UNINSTALLPN31)->SendMessage (BCM_SETSHIELD, 0, 1);
@@ -135,6 +138,9 @@ BOOL CPPageCasimir::OnApply() AppSettings& s = AfxGetAppSettings();
+ GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
+ GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
+
s.dBrightness = m_dBrightness;
s.dContrast = m_dContrast;
s.dHue = m_dHue;
diff --git a/src/apps/mplayerc/VMROSD.cpp b/src/apps/mplayerc/VMROSD.cpp index a30294759..5b74e45ae 100644 --- a/src/apps/mplayerc/VMROSD.cpp +++ b/src/apps/mplayerc/VMROSD.cpp @@ -225,7 +225,7 @@ void CVMROSD::DrawSlider(CRect* rect, __int64 llMin, __int64 llMax, __int64 llPo if (llMax == llMin)
m_rectCursor.left = m_rectBar.left;
else
- m_rectCursor.left = m_rectBar.left + (m_rectBar.Width() - SLIDER_CURSOR_WIDTH) * llPos / (llMax-llMin);
+ m_rectCursor.left = m_rectBar.left + (long)((m_rectBar.Width() - SLIDER_CURSOR_WIDTH) * llPos / (llMax-llMin));
m_rectCursor.right = m_rectCursor.left + SLIDER_CURSOR_WIDTH;
m_rectCursor.top = rect->top + (rect->Height() - SLIDER_CURSOR_HEIGHT) / 2;
m_rectCursor.bottom = m_rectCursor.top + SLIDER_CURSOR_HEIGHT;
diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index bba6a05f9..46c170f26 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -1166,13 +1166,6 @@ bool CMPlayerCApp::Settings::IsD3DFullscreen() return fD3DFullscreen;
}
-bool CMPlayerCApp::Settings::ExitAfterPlayback()
-{
- if(nCLSwitches&CLSW_EXITAFTERPLAYBACK)
- return true;
- else
- return false;
-}
DVD_POSITION* CMPlayerCApp::Settings::CurrentDVDPosition()
{
@@ -1364,28 +1357,31 @@ void CMPlayerCApp::Settings::UpdateData(bool fSave) // Position de lecture des derniers DVD's
pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DVDPOS), (int)fRememberDVDPos);
- for (int i=0; i<MAX_DVD_POSITION; i++)
- {
- CString strDVDPos;
- CString strValue;
-
- strDVDPos.Format (_T("DVD Position %d"), i);
- strValue = SerializeHex((BYTE*)&DvdPosition[i], sizeof(DVD_POSITION));
- pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strDVDPos, strValue);
- }
-
- // Position de lecture des derniers fichiers
pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FILEPOS), (int)fRememberFilePos);
- for (int i=0; i<MAX_FILE_POSITION; i++)
+ if (fKeepHistory)
{
- CString strFilePos;
- CString strValue;
+ for (int i=0; i<MAX_DVD_POSITION; i++)
+ {
+ CString strDVDPos;
+ CString strValue;
- strFilePos.Format (_T("File Name %d"), i);
- pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strFilePos, FilePosition[i].strFile);
- strFilePos.Format (_T("File Position %d"), i);
- strValue.Format (_T("%I64d"), FilePosition[i].llPosition);
- pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strFilePos, strValue);
+ strDVDPos.Format (_T("DVD Position %d"), i);
+ strValue = SerializeHex((BYTE*)&DvdPosition[i], sizeof(DVD_POSITION));
+ pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strDVDPos, strValue);
+ }
+
+ // Position de lecture des derniers fichiers
+ for (int i=0; i<MAX_FILE_POSITION; i++)
+ {
+ CString strFilePos;
+ CString strValue;
+
+ strFilePos.Format (_T("File Name %d"), i);
+ pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strFilePos, FilePosition[i].strFile);
+ strFilePos.Format (_T("File Position %d"), i);
+ strValue.Format (_T("%I64d"), FilePosition[i].llPosition);
+ pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), strFilePos, strValue);
+ }
}
pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTFULLSCREEN), (int)fLastFullScreen);
@@ -1958,10 +1954,10 @@ void CMPlayerCApp::Settings::UpdateData(bool fSave) dSaturation = _tstof(pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_COLOR_SATURATION), _T("1")));
strShaderList = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SHADERLIST), _T(""));
iEvrBuffers = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_EVR_BUFFERS), 5);
- fShowOSD = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SHOWOSD), 1);
+ fShowOSD = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SHOWOSD), 1);
// Position de lecture des derniers DVD's
- fRememberDVDPos = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DVDPOS), 0);
+ fRememberDVDPos = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DVDPOS), 0);
nCurrentDvdPosition = -1;
memset (DvdPosition, 0, sizeof(DvdPosition));
for (int i=0; i<MAX_DVD_POSITION; i++)
@@ -1978,7 +1974,7 @@ void CMPlayerCApp::Settings::UpdateData(bool fSave) }
// Position de lecture des derniers fichiers
- fRememberFilePos = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FILEPOS), 0);
+ fRememberFilePos = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FILEPOS), 0);
nCurrentFilePosition = -1;
for (int i=0; i<MAX_FILE_POSITION; i++)
{
@@ -1993,7 +1989,7 @@ void CMPlayerCApp::Settings::UpdateData(bool fSave) FilePosition[i].llPosition = _tstoi64 (strValue);
}
- fLastFullScreen = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTFULLSCREEN), 0);
+ fLastFullScreen = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTFULLSCREEN), 0);
// CASIMIR666 : fin nouveaux settings
@@ -2055,7 +2051,6 @@ void CMPlayerCApp::Settings::ParseCommandLine(CAtlList<CString>& cmdln) else if(sw == _T("installpn31")) nCLSwitches |= CLSW_INSTALLPN31;
else if(sw == _T("uninstallpn31")) nCLSwitches |= CLSW_UNINSTALLPN31;
else if(sw == _T("d3dfs")) nCLSwitches |= CLSW_D3DFULLSCREEN;
- else if(sw == _T("exitafterpb")) nCLSwitches |= CLSW_EXITAFTERPLAYBACK;
else if(sw == _T("fixedsize") && pos)
{
CAtlList<CString> sl;
diff --git a/src/apps/mplayerc/mplayerc.h b/src/apps/mplayerc/mplayerc.h index 10e584872..3ce2582b4 100644 --- a/src/apps/mplayerc/mplayerc.h +++ b/src/apps/mplayerc/mplayerc.h @@ -139,8 +139,7 @@ enum CLSW_INSTALLPN31=CLSW_MONITOR<<1,
CLSW_UNINSTALLPN31=CLSW_INSTALLPN31<<1,
CLSW_D3DFULLSCREEN=CLSW_UNINSTALLPN31<<1,
- CLSW_EXITAFTERPLAYBACK=CLSW_D3DFULLSCREEN<<1,
- CLSW_UNRECOGNIZEDSWITCH=CLSW_EXITAFTERPLAYBACK<<1
+ CLSW_UNRECOGNIZEDSWITCH=CLSW_D3DFULLSCREEN<<1
};
enum
@@ -562,7 +561,6 @@ public: bool IsD3DFullscreen();
- bool ExitAfterPlayback();
DVD_POSITION* CurrentDVDPosition();
bool NewDvd(ULONGLONG llDVDGuid);
FILE_POSITION* CurrentFilePosition();
|