Blame | Last modification | View Log | RSS feed
// Movies.h: interface for the CMovies class.////////////////////////////////////////////////////////////////////////#if !defined(AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_)#define AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000#include <d3d9.h>#include <d3dx9.h>#include <streams.h>#ifndef DEGTORAD#define DEGTORAD(degree) ((D3DX_PI / 180.0f) * (degree)) // converts from degrees to radians#define RADTODEG(radian) ((180.0f / D3DX_PI) * (radian)) // converts from radians to degrees#endif //DEGTORADclass CMovies{public:CMovies();virtual ~CMovies();bool Initialise( LPDIRECT3DDEVICE9 device, const char *szVideoFilename, LPDIRECT3DTEXTURE9 texture);void Render( float x, float y );void Clean();bool Play();bool Stop();bool Pause();bool JumpTo( double PositionInSeconds );bool Resume();long MovieLength();void SetRotation( float degrees ) { m_fRotation = degrees; };bool IsMoviePlaying() { return m_bPlaying; };bool IsMoviePaused() { return m_bPaused; };bool HasMovieEnded();int GetVideoWidth () { return m_iVideoWidth; }int GetVideoHeight() { return m_iVideoHeight; }LPDIRECT3DTEXTURE9 GetTexture ();private:int m_iVideoWidth;int m_iVideoHeight;float m_fRotation;char *m_cVideoFilename;bool m_bPlaying;bool m_bPaused;// LPDIRECT3DTEXTURE9 m_pTexture;};struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;class CTextureRenderer : public CBaseVideoRenderer{public:CTextureRenderer(LPUNKNOWN pUnk,HRESULT *phr);~CTextureRenderer();public:HRESULT CheckMediaType(const CMediaType *pmt ); // Format acceptable?HRESULT SetMediaType(const CMediaType *pmt ); // Video format notificationHRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sampleBOOL m_bUseDynamicTextures;LONG m_lVidWidth; // Video widthLONG m_lVidHeight; // Video HeightLONG m_lVidPitch; // Video Pitch};#endif // !defined(AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_)