From b85bc674c9c73eb63683009dc60005bf02892fd1 Mon Sep 17 00:00:00 2001 From: psperl Date: Wed, 26 Sep 2007 21:02:05 +0000 Subject: [PATCH] Fullscreen git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@487 6778bc44-b910-0410-a7a0-be141de4315d --- .../projectM-wmp/projectM-wmp.cpp | 50 ++++++++++++++----- src/projectM-wmp/projectM-wmp/projectM-wmp.h | 11 ++-- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/projectM-wmp/projectM-wmp/projectM-wmp.cpp b/src/projectM-wmp/projectM-wmp/projectM-wmp.cpp index 11111c712..08703a4e6 100644 --- a/src/projectM-wmp/projectM-wmp/projectM-wmp.cpp +++ b/src/projectM-wmp/projectM-wmp/projectM-wmp.cpp @@ -181,6 +181,42 @@ STDMETHODIMP CProjectMwmp::GetTitle(BSTR* bstrTitle) return S_OK; } + +STDMETHODIMP CProjectMwmp::RenderFullScreen(TimedLevel *pLevels) +{ + + // NULL parent window should not happen + if (NULL == m_hwndParent) + { + return E_UNEXPECTED; + } + + // At this point the visualization should draw directly into the parent + // window. This sample just calls windowless render for simplicity. + + HDC hdc = ::GetDC(m_hwndParent); + + if (NULL == hdc) + { + return E_FAIL; + } + + RECT rParent = { 0 }; + ::GetClientRect(m_hwndParent, &rParent); + + Render(pLevels, hdc, &rParent); + + ::ReleaseDC(m_hwndParent, hdc); + + return S_OK; +} + +STDMETHODIMP CProjectMwmp::GoFullscreen(BOOL fFullScreen) +{ + + return S_OK; +} + ////////////////////////////////////////////////////////////////////////////// // CProjectMwmp::GetPresetTitle // Invoked when a host wants to obtain the title of the given preset @@ -192,12 +228,7 @@ STDMETHODIMP CProjectMwmp::GetPresetTitle(LONG nPreset, BSTR *bstrPresetTitle) if (NULL == bstrPresetTitle) { return E_POINTER; - } - - if ((nPreset < 0) || (nPreset >= PRESET_COUNT)) - { - return E_INVALIDARG; - } + } CComBSTR bstrTemp; @@ -234,12 +265,7 @@ STDMETHODIMP CProjectMwmp::GetPresetCount(LONG *pnPresetCount) // Invoked when a host wants to change the index of the current preset ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CProjectMwmp::SetCurrentPreset(LONG nPreset) -{ - if ((nPreset < 0) || (nPreset >= PRESET_COUNT)) - { - return E_INVALIDARG; - } - +{ m_nPreset = 0; return S_OK; diff --git a/src/projectM-wmp/projectM-wmp/projectM-wmp.h b/src/projectM-wmp/projectM-wmp/projectM-wmp.h index 61675999b..7d0f35b45 100644 --- a/src/projectM-wmp/projectM-wmp/projectM-wmp.h +++ b/src/projectM-wmp/projectM-wmp/projectM-wmp.h @@ -13,12 +13,7 @@ #include "effects.h" #include "projectM-wmp_h.h" -// preset values -enum { - PRESET_BARS = 0, - PRESET_SCOPE, - PRESET_COUNT -}; + ///////////////////////////////////////////////////////////////////////////// // CProjectMwmp @@ -67,8 +62,8 @@ public: STDMETHOD(Render)(TimedLevel *pLevels, HDC hdc, RECT *rc); STDMETHOD(MediaInfo)(LONG lChannelCount, LONG lSampleRate, BSTR bstrTitle); STDMETHOD(GetCapabilities)(DWORD * pdwCapabilities); - STDMETHOD(GoFullscreen)(BOOL fFullScreen) { return E_NOTIMPL; }; - STDMETHOD(RenderFullScreen)(TimedLevel *pLevels) { return E_NOTIMPL; }; + STDMETHOD(GoFullscreen)(BOOL fFullScreen);// { return E_NOTIMPL; }; + STDMETHOD(RenderFullScreen)(TimedLevel *pLevels);// { return E_NOTIMPL; }; STDMETHOD(DisplayPropertyPage)(HWND hwndOwner) { return E_NOTIMPL; }; STDMETHOD(GetTitle)(BSTR *bstrTitle); STDMETHOD(GetPresetTitle)(LONG nPreset, BSTR *bstrPresetTitle);