Files
itgmania212121/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h
T

88 lines
2.1 KiB
C++
Raw Normal View History

2003-02-20 03:34:30 +00:00
#ifndef RAGEMOVIETEXTURE_H
#define RAGEMOVIETEXTURE_H
/*
-----------------------------------------------------------------------------
Class: RageMovieTexture
Desc: Based on the DShowTextures example in the DX8 SDK.
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
Chris Danford
Glenn Maynard
-----------------------------------------------------------------------------
*/
#include "MovieTexture.h"
/* Don't know why we need this for the headers ... */
typedef char TCHAR, *PTCHAR;
/* Prevent these from using Dbg stuff, which we don't link in. */
#ifdef DEBUG
#undef DEBUG
#undef _DEBUG
#define GIVE_BACK_DEBUG
#endif
#include <atlbase.h>
#ifdef GIVE_BACK_DEBUG
#undef GIVE_BACK_DEBUG
#define _DEBUG
#define DEBUG
#endif
#include "baseclasses/streams.h"
#include "RageDisplay.h"
#include "RageTexture.h"
#include "RageThreads.h"
2003-08-05 00:39:52 +00:00
#include "SDL_mutex.h"
2003-02-20 03:34:30 +00:00
//-----------------------------------------------------------------------------
// RageMovieTexture Class Declarations
//-----------------------------------------------------------------------------
class MovieTexture_DShow : public RageMovieTexture
{
public:
MovieTexture_DShow( RageTextureID ID );
virtual ~MovieTexture_DShow();
/* only called by RageTextureManager::InvalidateTextures */
2003-05-22 05:28:37 +00:00
void Invalidate() { m_uTexHandle = 0; }
2003-02-20 03:34:30 +00:00
void Update(float fDeltaTime);
virtual void Reload();
virtual void Play();
virtual void Pause();
virtual void Stop();
virtual void SetPosition( float fSeconds );
virtual void SetPlaybackRate( float fRate );
2003-02-20 03:34:30 +00:00
virtual bool IsPlaying() const;
void SetLooping(bool looping=true) { m_bLoop = looping; }
2003-03-11 18:40:42 +00:00
void NewData(const char *buffer);
2003-02-20 03:34:30 +00:00
private:
const char *buffer;
SDL_sem *buffer_lock, *buffer_finished;
2003-02-20 03:34:30 +00:00
void Create();
2003-03-23 23:06:49 +00:00
void CreateTexture();
2003-02-20 03:34:30 +00:00
bool PlayMovie();
void SkipUpdates();
void StopSkippingUpdates();
void CheckFrame();
2003-07-15 03:34:54 +00:00
CString GetActiveFilterList();
2003-02-20 03:34:30 +00:00
2003-06-22 01:49:12 +00:00
unsigned GetTexHandle() const { return m_uTexHandle; }
2003-05-22 05:28:37 +00:00
unsigned m_uTexHandle;
2003-02-20 03:34:30 +00:00
CComPtr<IGraphBuilder> m_pGB; // GraphBuilder
bool m_bLoop;
bool m_bPlaying;
};
#endif