QuicktimeGraph.h

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
00019  *
00020  */
00021 
00022 #pragma once
00023 #include "BaseGraph.h"
00024 #include "DX7AllocatorPresenter.h"
00025 #include "DX9AllocatorPresenter.h"
00026 
00027 namespace DSObjects
00028 {
00029 
00030 class CQuicktimeGraph;
00031 
00032 class CQuicktimeWindow : public CPlayerWindow
00033 {
00034         CDC m_dc;
00035         CBitmap m_bm;
00036         QT::GWorldPtr m_offscreenGWorld;
00037 
00038         CQuicktimeGraph* m_pGraph;
00039         FILTER_STATE m_fs;
00040         UINT m_idEndPoller;
00041 
00042         static QT::OSErr MyMovieDrawingCompleteProc(QT::Movie theMovie, long refCon);
00043 
00044         void ProcessMovieEvent(unsigned int message, unsigned int wParam, long lParam);
00045 
00046 protected:
00047         virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00048 
00049 public:
00050         CQuicktimeWindow(CQuicktimeGraph* pGraph);
00051 
00052         bool OpenMovie(CString fn);
00053         void CloseMovie();
00054 
00055         void Run(), Pause(), Stop();
00056         FILTER_STATE GetState();
00057 
00058         QT::Movie                       theMovie;
00059     QT::MovieController theMC;
00060         CSize                           m_size;
00061 
00062 public:
00063         DECLARE_MESSAGE_MAP()
00064         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00065         afx_msg void OnDestroy();
00066         afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00067         afx_msg void OnTimer(UINT nIDEvent);
00068 };
00069 
00070 class CQuicktimeGraph : public CBaseGraph, public IVideoFrameStep
00071 {
00072 protected:
00073         bool m_fQtInitialized;
00074 
00075         CPlayerWindow m_wndWindowFrame;
00076         CQuicktimeWindow m_wndDestFrame;
00077 
00078         CComPtr<ISubPicAllocatorPresenter> m_pQTAP;
00079 
00080 public:
00081         CQuicktimeGraph(HWND hParent, HRESULT& hr);
00082         virtual ~CQuicktimeGraph();
00083 
00084     DECLARE_IUNKNOWN;
00085     STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00086 
00087 protected:
00088         // IGraphBuilder
00089     STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
00090 
00091         // IMediaControl
00092     STDMETHODIMP Run();
00093     STDMETHODIMP Pause();
00094     STDMETHODIMP Stop();
00095         STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs);
00096 
00097         // IMediaSeeking
00098         STDMETHODIMP GetDuration(LONGLONG* pDuration);
00099         STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent);
00100         STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);
00101         STDMETHODIMP SetRate(double dRate);
00102         STDMETHODIMP GetRate(double* pdRate);
00103 
00104         // IVideoWindow
00105     STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height);
00106 
00107         // IBasicVideo
00108     STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height);
00109     STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
00110 
00111         // IBasicAudio
00112     STDMETHODIMP put_Volume(long lVolume);
00113     STDMETHODIMP get_Volume(long* plVolume);
00114         
00115         // IVideoFrameStep
00116     STDMETHODIMP Step(DWORD dwFrames, IUnknown* pStepObject);
00117     STDMETHODIMP CanStep(long bMultiple, IUnknown* pStepObject);    
00118     STDMETHODIMP CancelStep();
00119 
00120         // IGraphEngine
00121         STDMETHODIMP_(engine_t) GetEngine();
00122 };
00123 
00124 }
00125 using namespace DSObjects;

Generated on Tue Dec 13 14:47:03 2005 for guliverkli by  doxygen 1.4.5