1 /* GemRB - Infinity Engine Emulator
2  * Copyright (C) 2003 The GemRB Project
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  *
19  */
20 
21 #ifndef MVEPLAY_H
22 #define MVEPLAY_H
23 
24 #include "MoviePlayer.h"
25 
26 #include "mve_player.h"
27 
28 #include "globals.h"
29 
30 namespace GemRB {
31 
32 class Video;
33 
34 class MVEPlay : public MoviePlayer {
35 	friend class MVEPlayer;
36 	MVEPlayer decoder;
37 	VideoBuffer* vidBuf;
38 	PaletteHolder g_palette;
39 
40 private:
41 	Video *video;
42 	bool validVideo;
43 	int doPlay();
44 	unsigned int fileRead(void* buf, unsigned int count);
45 	void showFrame(const unsigned char* buf, unsigned int bufw, unsigned int bufh);
46 	void setPalette(unsigned char* p, unsigned start, unsigned count);
47 	int pollEvents();
48 	int setAudioStream();
49 	void freeAudioStream(int stream);
50 	void queueBuffer(int stream, unsigned short bits,
51 				int channels, short* memory,
52 				int size, int samplerate);
53 
54 protected:
55 	bool DecodeFrame(VideoBuffer&) override;
56 
57 public:
58 	MVEPlay(void);
59 	~MVEPlay(void) override;
60 	bool Open(DataStream* stream) override;
61 };
62 
63 }
64 
65 #endif
66