2017-01-21 17:27:46 +01:00
|
|
|
// movie.h
|
|
|
|
//
|
|
|
|
|
2017-01-21 23:44:30 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-02-05 17:28:47 +01:00
|
|
|
struct Kit_Source;
|
|
|
|
struct Kit_Player;
|
|
|
|
struct Kit_PlayerInfo;
|
|
|
|
struct SDL_Texture;
|
|
|
|
|
|
|
|
#define AUDIOBUFFER_SIZE (32768)
|
|
|
|
|
2017-01-21 17:27:46 +01:00
|
|
|
class CMovie
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMovie();
|
|
|
|
~CMovie();
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
bool Create();
|
|
|
|
bool GetEnable();
|
|
|
|
bool IsExist(char *pFilename);
|
2017-02-05 09:15:08 +01:00
|
|
|
bool Play(RECT rect, char *pFilename);
|
|
|
|
void Stop();
|
2017-02-05 18:21:32 +01:00
|
|
|
void Pause ();
|
|
|
|
void Resume ();
|
2017-02-05 17:28:47 +01:00
|
|
|
bool Render ();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
protected:
|
2017-02-05 18:25:39 +01:00
|
|
|
void playMovie();
|
2017-02-05 09:15:08 +01:00
|
|
|
bool fileOpenMovie(RECT rect, char *pFilename);
|
|
|
|
void fileCloseMovie();
|
2017-01-21 17:27:46 +01:00
|
|
|
void termAVI();
|
2017-01-22 00:10:12 +01:00
|
|
|
bool initAVI();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
protected:
|
2017-02-05 17:28:47 +01:00
|
|
|
Kit_PlayerInfo *pinfo;
|
|
|
|
Kit_Source *m_movie;
|
|
|
|
Kit_Player *m_player;
|
|
|
|
SDL_Texture *m_videoTex;
|
|
|
|
int m_ret;
|
|
|
|
SDL_AudioDeviceID m_audioDev;
|
|
|
|
|
2017-02-05 17:45:21 +01:00
|
|
|
char m_audiobuf[AUDIOBUFFER_SIZE];
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bEnable;
|
|
|
|
bool m_fPlaying; // Play flag: true == playing, false == paused
|
|
|
|
bool m_fMovieOpen; // Open flag: true == movie open, false = none
|
2017-01-21 17:27:46 +01:00
|
|
|
};
|
|
|
|
|