A Fast Bresenham Type Algorithm For Drawing Ellipses by John Kennedy
[xy_vsfilter.git] / src / apps / mplayerc / QuicktimeGraph.h
blob222169c12737a348e85e846b3af524b72a40512e
1 /*
2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
22 #pragma once
23 #include "BaseGraph.h"
24 #include "DX7AllocatorPresenter.h"
25 #include "DX9AllocatorPresenter.h"
27 namespace DSObjects
30 class CQuicktimeGraph;
32 class CQuicktimeWindow : public CPlayerWindow
34 CDC m_dc;
35 CBitmap m_bm;
36 QT::GWorldPtr m_offscreenGWorld;
38 CQuicktimeGraph* m_pGraph;
39 FILTER_STATE m_fs;
40 UINT m_idEndPoller;
42 static QT::OSErr MyMovieDrawingCompleteProc(QT::Movie theMovie, long refCon);
44 void ProcessMovieEvent(unsigned int message, unsigned int wParam, long lParam);
46 protected:
47 virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
49 public:
50 CQuicktimeWindow(CQuicktimeGraph* pGraph);
52 bool OpenMovie(CString fn);
53 void CloseMovie();
55 void Run(), Pause(), Stop();
56 FILTER_STATE GetState();
58 QT::Movie theMovie;
59 QT::MovieController theMC;
60 CSize m_size;
62 public:
63 DECLARE_MESSAGE_MAP()
64 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
65 afx_msg void OnDestroy();
66 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
67 afx_msg void OnTimer(UINT nIDEvent);
70 class CQuicktimeGraph : public CBaseGraph, public IVideoFrameStep
72 protected:
73 bool m_fQtInitialized;
75 CPlayerWindow m_wndWindowFrame;
76 CQuicktimeWindow m_wndDestFrame;
78 CComPtr<ISubPicAllocatorPresenter> m_pQTAP;
80 public:
81 CQuicktimeGraph(HWND hParent, HRESULT& hr);
82 virtual ~CQuicktimeGraph();
84 DECLARE_IUNKNOWN;
85 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
87 protected:
88 // IGraphBuilder
89 STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
91 // IMediaControl
92 STDMETHODIMP Run();
93 STDMETHODIMP Pause();
94 STDMETHODIMP Stop();
95 STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs);
97 // IMediaSeeking
98 STDMETHODIMP GetDuration(LONGLONG* pDuration);
99 STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent);
100 STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);
101 STDMETHODIMP SetRate(double dRate);
102 STDMETHODIMP GetRate(double* pdRate);
104 // IVideoWindow
105 STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height);
107 // IBasicVideo
108 STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height);
109 STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
111 // IBasicAudio
112 STDMETHODIMP put_Volume(long lVolume);
113 STDMETHODIMP get_Volume(long* plVolume);
115 // IVideoFrameStep
116 STDMETHODIMP Step(DWORD dwFrames, IUnknown* pStepObject);
117 STDMETHODIMP CanStep(long bMultiple, IUnknown* pStepObject);
118 STDMETHODIMP CancelStep();
120 // IGraphEngine
121 STDMETHODIMP_(engine_t) GetEngine();
125 using namespace DSObjects;