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
00024 class CPlayerWindow : public CWnd
00025 {
00026 public:
00027 CPlayerWindow() {}
00028
00029 protected:
00030 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00031 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00032 DECLARE_MESSAGE_MAP()
00033 };
00034
00035 typedef enum {DirectShow = 0, RealMedia, QuickTime, ShockWave} engine_t;
00036
00037 [uuid("B110CDE5-6331-4118-8AAF-A870D6F7E2E4")]
00038 interface IGraphEngine : public IUnknown
00039 {
00040 STDMETHOD_(engine_t, GetEngine) () = 0;
00041 };
00042
00043 namespace DSObjects
00044 {
00045
00046 enum
00047 {
00048 EC_BG_AUDIO_CHANGED = EC_USER+1,
00049 EC_BG_ERROR
00050 };
00051
00052 class CBaseGraph
00053 : public CUnknown
00054 , public IGraphBuilder
00055 , public IMediaControl
00056 , public IMediaEventEx
00057 , public IMediaSeeking
00058 , public IVideoWindow
00059 , public IBasicVideo
00060 , public IBasicAudio
00061 , public IAMOpenProgress
00062 , public IGraphEngine
00063 {
00064 OAHWND m_hNotifyWnd;
00065 long m_lNotifyMsg;
00066 LONG_PTR m_lNotifyInstData;
00067
00068 typedef struct {long m_lEventCode; LONG_PTR m_lParam1, m_lParam2;} GMSG;
00069 CList<GMSG> m_msgqueue;
00070
00071 protected:
00072 void ClearMessageQueue();
00073
00074 public:
00075 CBaseGraph();
00076 virtual ~CBaseGraph();
00077
00078 DECLARE_IUNKNOWN;
00079 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00080
00081 void NotifyEvent(long lEventCode, LONG_PTR lParam1 = 0, LONG_PTR lParam2 = 0);
00082
00083 protected:
00084
00085 STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
00086 STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo);
00087 STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId);
00088 STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr);
00089
00090
00091 STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName);
00092 STDMETHODIMP RemoveFilter(IBaseFilter* pFilter);
00093 STDMETHODIMP EnumFilters(IEnumFilters** ppEnum);
00094 STDMETHODIMP FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter);
00095 STDMETHODIMP ConnectDirect(IPin* ppinOut, IPin* ppinIn, const AM_MEDIA_TYPE* pmt);
00096 STDMETHODIMP Reconnect(IPin* ppin);
00097 STDMETHODIMP Disconnect(IPin* ppin);
00098 STDMETHODIMP SetDefaultSyncSource();
00099
00100
00101 STDMETHODIMP Connect(IPin* ppinOut, IPin* ppinIn);
00102 STDMETHODIMP Render(IPin* ppinOut);
00103 STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
00104 STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter);
00105 STDMETHODIMP SetLogFile(DWORD_PTR hFile);
00106 STDMETHODIMP Abort();
00107 STDMETHODIMP ShouldOperationContinue();
00108
00109
00110 STDMETHODIMP Run();
00111 STDMETHODIMP Pause();
00112 STDMETHODIMP Stop();
00113 STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs);
00114 STDMETHODIMP RenderFile(BSTR strFilename);
00115 STDMETHODIMP AddSourceFilter(BSTR strFilename, IDispatch** ppUnk);
00116 STDMETHODIMP get_FilterCollection(IDispatch** ppUnk);
00117 STDMETHODIMP get_RegFilterCollection(IDispatch** ppUnk);
00118 STDMETHODIMP StopWhenReady();
00119
00120
00121 STDMETHODIMP GetEventHandle(OAEVENT* hEvent);
00122 STDMETHODIMP GetEvent(long* lEventCode, LONG_PTR* lParam1, LONG_PTR* lParam2, long msTimeout);
00123 STDMETHODIMP WaitForCompletion(long msTimeout, long* pEvCode);
00124 STDMETHODIMP CancelDefaultHandling(long lEvCode);
00125 STDMETHODIMP RestoreDefaultHandling(long lEvCode);
00126 STDMETHODIMP FreeEventParams(long lEvCode, LONG_PTR lParam1, LONG_PTR lParam2);
00127
00128
00129 STDMETHODIMP SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData);
00130 STDMETHODIMP SetNotifyFlags(long lNoNotifyFlags);
00131 STDMETHODIMP GetNotifyFlags(long* lplNoNotifyFlags);
00132
00133
00134 STDMETHODIMP GetCapabilities(DWORD* pCapabilities);
00135 STDMETHODIMP CheckCapabilities(DWORD* pCapabilities);
00136 STDMETHODIMP IsFormatSupported(const GUID* pFormat);
00137 STDMETHODIMP QueryPreferredFormat(GUID* pFormat);
00138 STDMETHODIMP GetTimeFormat(GUID* pFormat);
00139 STDMETHODIMP IsUsingTimeFormat(const GUID* pFormat);
00140 STDMETHODIMP SetTimeFormat(const GUID* pFormat);
00141 STDMETHODIMP GetDuration(LONGLONG* pDuration);
00142 STDMETHODIMP GetStopPosition(LONGLONG* pStop);
00143 STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent);
00144 STDMETHODIMP ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat);
00145 STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);
00146 STDMETHODIMP GetPositions(LONGLONG* pCurrent, LONGLONG* pStop);
00147 STDMETHODIMP GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest);
00148 STDMETHODIMP SetRate(double dRate);
00149 STDMETHODIMP GetRate(double* pdRate);
00150 STDMETHODIMP GetPreroll(LONGLONG* pllPreroll);
00151
00152
00153 STDMETHODIMP put_Caption(BSTR strCaption);
00154 STDMETHODIMP get_Caption(BSTR* strCaption);
00155 STDMETHODIMP put_WindowStyle(long WindowStyle);
00156 STDMETHODIMP get_WindowStyle(long* WindowStyle);
00157 STDMETHODIMP put_WindowStyleEx(long WindowStyleEx);
00158 STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx);
00159 STDMETHODIMP put_AutoShow(long AutoShow);
00160 STDMETHODIMP get_AutoShow(long* AutoShow);
00161 STDMETHODIMP put_WindowState(long WindowState);
00162 STDMETHODIMP get_WindowState(long* WindowState);
00163 STDMETHODIMP put_BackgroundPalette(long BackgroundPalette);
00164 STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette);
00165 STDMETHODIMP put_Visible(long Visible);
00166 STDMETHODIMP get_Visible(long* pVisible);
00167 STDMETHODIMP put_Left(long Left);
00168 STDMETHODIMP get_Left(long* pLeft);
00169 STDMETHODIMP put_Width(long Width);
00170 STDMETHODIMP get_Width(long* pWidth);
00171 STDMETHODIMP put_Top(long Top);
00172 STDMETHODIMP get_Top(long* pTop);
00173 STDMETHODIMP put_Height(long Height);
00174 STDMETHODIMP get_Height(long* pHeight);
00175 STDMETHODIMP put_Owner(OAHWND Owner);
00176 STDMETHODIMP get_Owner(OAHWND* Owner);
00177 STDMETHODIMP put_MessageDrain(OAHWND Drain);
00178 STDMETHODIMP get_MessageDrain(OAHWND* Drain);
00179 STDMETHODIMP get_BorderColor(long* Color);
00180 STDMETHODIMP put_BorderColor(long Color);
00181 STDMETHODIMP get_FullScreenMode(long* FullScreenMode);
00182 STDMETHODIMP put_FullScreenMode(long FullScreenMode);
00183 STDMETHODIMP SetWindowForeground(long Focus);
00184 STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam);
00185 STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height);
00186 STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
00187 STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight);
00188 STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight);
00189 STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
00190 STDMETHODIMP HideCursor(long HideCursor);
00191 STDMETHODIMP IsCursorHidden(long* CursorHidden);
00192
00193
00194 STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame);
00195 STDMETHODIMP get_BitRate(long* pBitRate);
00196 STDMETHODIMP get_BitErrorRate(long* pBitErrorRate);
00197 STDMETHODIMP get_VideoWidth(long* pVideoWidth);
00198 STDMETHODIMP get_VideoHeight(long* pVideoHeight);
00199 STDMETHODIMP put_SourceLeft(long SourceLeft);
00200 STDMETHODIMP get_SourceLeft(long* pSourceLeft);
00201 STDMETHODIMP put_SourceWidth(long SourceWidth);
00202 STDMETHODIMP get_SourceWidth(long* pSourceWidth);
00203 STDMETHODIMP put_SourceTop(long SourceTop);
00204 STDMETHODIMP get_SourceTop(long* pSourceTop);
00205 STDMETHODIMP put_SourceHeight(long SourceHeight);
00206 STDMETHODIMP get_SourceHeight(long* pSourceHeight);
00207 STDMETHODIMP put_DestinationLeft(long DestinationLeft);
00208 STDMETHODIMP get_DestinationLeft(long* pDestinationLeft);
00209 STDMETHODIMP put_DestinationWidth(long DestinationWidth);
00210 STDMETHODIMP get_DestinationWidth(long* pDestinationWidth);
00211 STDMETHODIMP put_DestinationTop(long DestinationTop);
00212 STDMETHODIMP get_DestinationTop(long* pDestinationTop);
00213 STDMETHODIMP put_DestinationHeight(long DestinationHeight);
00214 STDMETHODIMP get_DestinationHeight(long* pDestinationHeight);
00215 STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height);
00216 STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
00217 STDMETHODIMP SetDefaultSourcePosition();
00218 STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height);
00219 STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
00220 STDMETHODIMP SetDefaultDestinationPosition();
00221 STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
00222 STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette);
00223 STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage);
00224 STDMETHODIMP IsUsingDefaultSource();
00225 STDMETHODIMP IsUsingDefaultDestination();
00226
00227
00228 STDMETHODIMP put_Volume(long lVolume);
00229 STDMETHODIMP get_Volume(long* plVolume);
00230 STDMETHODIMP put_Balance(long lBalance);
00231 STDMETHODIMP get_Balance(long* plBalance);
00232
00233
00234 STDMETHODIMP QueryProgress(LONGLONG* pllTotal, LONGLONG* pllCurrent);
00235 STDMETHODIMP AbortOperation();
00236
00237
00238 STDMETHODIMP_(engine_t) GetEngine();
00239 };
00240
00241 }
00242 using namespace DSObjects;