00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00089 STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
00090
00091
00092 STDMETHODIMP Run();
00093 STDMETHODIMP Pause();
00094 STDMETHODIMP Stop();
00095 STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs);
00096
00097
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
00105 STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height);
00106
00107
00108 STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height);
00109 STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
00110
00111
00112 STDMETHODIMP put_Volume(long lVolume);
00113 STDMETHODIMP get_Volume(long* plVolume);
00114
00115
00116 STDMETHODIMP Step(DWORD dwFrames, IUnknown* pStepObject);
00117 STDMETHODIMP CanStep(long bMultiple, IUnknown* pStepObject);
00118 STDMETHODIMP CancelStep();
00119
00120
00121 STDMETHODIMP_(engine_t) GetEngine();
00122 };
00123
00124 }
00125 using namespace DSObjects;