| 11 | cycrow | 1 | // Movies.h: interface for the CMovies class.
 | 
        
           |  |  | 2 | //
 | 
        
           |  |  | 3 | //////////////////////////////////////////////////////////////////////
 | 
        
           |  |  | 4 |   | 
        
           |  |  | 5 | #if !defined(AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_)
 | 
        
           |  |  | 6 | #define AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_
 | 
        
           |  |  | 7 |   | 
        
           |  |  | 8 | #if _MSC_VER > 1000
 | 
        
           |  |  | 9 | #pragma once
 | 
        
           |  |  | 10 | #endif // _MSC_VER > 1000
 | 
        
           |  |  | 11 |   | 
        
           |  |  | 12 | #include <d3d9.h>
 | 
        
           |  |  | 13 | #include <d3dx9.h>
 | 
        
           |  |  | 14 | #include <streams.h>
 | 
        
           |  |  | 15 |   | 
        
           |  |  | 16 | #ifndef DEGTORAD
 | 
        
           |  |  | 17 | 	#define DEGTORAD(degree) ((D3DX_PI / 180.0f) * (degree)) // converts from degrees to radians
 | 
        
           |  |  | 18 | 	#define RADTODEG(radian) ((180.0f / D3DX_PI) * (radian)) // converts from radians to degrees
 | 
        
           |  |  | 19 | #endif //DEGTORAD
 | 
        
           |  |  | 20 |   | 
        
           |  |  | 21 | class CMovies  
 | 
        
           |  |  | 22 | {
 | 
        
           |  |  | 23 | public:
 | 
        
           |  |  | 24 | 	CMovies();
 | 
        
           |  |  | 25 | 	virtual ~CMovies();
 | 
        
           |  |  | 26 | 	bool Initialise( LPDIRECT3DDEVICE9 device, const char *szVideoFilename, LPDIRECT3DTEXTURE9 texture);
 | 
        
           |  |  | 27 | 	void Render( float x, float y );
 | 
        
           |  |  | 28 | 	void Clean();
 | 
        
           |  |  | 29 | 	bool Play();
 | 
        
           |  |  | 30 | 	bool Stop();
 | 
        
           |  |  | 31 | 	bool Pause();
 | 
        
           |  |  | 32 | 	bool JumpTo( double PositionInSeconds );
 | 
        
           |  |  | 33 | 	bool Resume();
 | 
        
           |  |  | 34 | 	long MovieLength();
 | 
        
           |  |  | 35 | 	void SetRotation( float degrees ) { m_fRotation = degrees; };
 | 
        
           |  |  | 36 | 	bool IsMoviePlaying() { return m_bPlaying; };
 | 
        
           |  |  | 37 | 	bool IsMoviePaused() { return m_bPaused; };
 | 
        
           |  |  | 38 | 	bool HasMovieEnded();
 | 
        
           |  |  | 39 |   | 
        
           |  |  | 40 | 	int GetVideoWidth () { return m_iVideoWidth;  }
 | 
        
           |  |  | 41 | 	int GetVideoHeight() { return m_iVideoHeight; }
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 | 	LPDIRECT3DTEXTURE9 GetTexture ();
 | 
        
           |  |  | 44 |   | 
        
           |  |  | 45 | private:
 | 
        
           |  |  | 46 | 	int m_iVideoWidth;
 | 
        
           |  |  | 47 | 	int m_iVideoHeight;
 | 
        
           |  |  | 48 | 	float m_fRotation;
 | 
        
           |  |  | 49 | 	char *m_cVideoFilename;
 | 
        
           |  |  | 50 | 	bool m_bPlaying;
 | 
        
           |  |  | 51 | 	bool m_bPaused;
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 | //	LPDIRECT3DTEXTURE9 m_pTexture;
 | 
        
           |  |  | 54 | };
 | 
        
           |  |  | 55 |   | 
        
           |  |  | 56 |   | 
        
           |  |  | 57 | struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;
 | 
        
           |  |  | 58 |   | 
        
           |  |  | 59 | class CTextureRenderer : public CBaseVideoRenderer
 | 
        
           |  |  | 60 | {
 | 
        
           |  |  | 61 | public:
 | 
        
           |  |  | 62 |     CTextureRenderer(LPUNKNOWN pUnk,HRESULT *phr);
 | 
        
           |  |  | 63 |     ~CTextureRenderer();
 | 
        
           |  |  | 64 |   | 
        
           |  |  | 65 | public:
 | 
        
           |  |  | 66 |     HRESULT CheckMediaType(const CMediaType *pmt );		// Format acceptable?
 | 
        
           |  |  | 67 |     HRESULT SetMediaType(const CMediaType *pmt );		// Video format notification
 | 
        
           |  |  | 68 |     HRESULT DoRenderSample(IMediaSample *pMediaSample);	// New video sample
 | 
        
           |  |  | 69 |   | 
        
           |  |  | 70 |     BOOL m_bUseDynamicTextures;
 | 
        
           |  |  | 71 |     LONG m_lVidWidth;	// Video width
 | 
        
           |  |  | 72 |     LONG m_lVidHeight;	// Video Height
 | 
        
           |  |  | 73 |     LONG m_lVidPitch;	// Video Pitch
 | 
        
           |  |  | 74 | };
 | 
        
           |  |  | 75 |   | 
        
           |  |  | 76 |   | 
        
           |  |  | 77 | #endif // !defined(AFX_MOVIES_H__5E5F59A5_C8A2_462D_8539_7251C1FDC457__INCLUDED_)
 |