ScummVM API documentation
player.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GROOVIE_VIDEO_PLAYER_H
23#define GROOVIE_VIDEO_PLAYER_H
24
25#include "common/system.h"
26#include "video/subtitles.h"
27
28namespace Audio {
29class QueuingAudioStream;
30}
31
32namespace Groovie {
33
34class GroovieEngine;
35
37public:
39 virtual ~VideoPlayer() {}
40
41 bool load(Common::SeekableReadStream *file, uint16 flags);
42 bool playFrame();
43 virtual void resetFlags() {}
44 virtual void setOrigin(int16 x, int16 y) {}
45 virtual void stopAudioStream() = 0;
46 void fastForward();
47 bool isFastForwarding();
48 virtual void drawString(Graphics::Surface *surface, const Common::String &text, int posx, int posy, uint32 color, bool blackBackground) {}
49 virtual void copyfgtobg(uint8 arg) {}
50 void setOverrideSpeed(bool isOverride);
51
52 void loadSubtitles(const char *fname) { _subtitles.loadSRTFile(fname); }
53 void unloadSubtitles();
54
55 virtual bool isFileHandled() { return false; }
56
57protected:
58 // To be implemented by subclasses
59 virtual uint16 loadInternal() = 0;
60 virtual bool playFrameInternal() = 0;
61
62 bool getOverrideSpeed() const { return _overrideSpeed; }
63
64 GroovieEngine *_vm;
65 OSystem *_syst;
67 uint16 _flags;
68 Audio::QueuingAudioStream *_audioStream;
69
70
71private:
72 // Synchronization stuff
73 bool _begunPlaying;
74 bool _overrideSpeed;
75 uint16 _fps;
76 float _millisBetweenFrames;
77 uint32 _lastFrameTime;
78 float _frameTimeDrift;
79 uint32 _startTime;
80
81 Video::Subtitles _subtitles;
82
83protected:
84 virtual void waitFrame();
85};
86
87} // End of Groovie namespace
88
89#endif // GROOVIE_VIDEO_PLAYER_H
Definition: audiostream.h:370
Definition: stream.h:745
Definition: str.h:59
Definition: groovie.h:116
Definition: player.h:36
Definition: system.h:166
Definition: subtitles.h:78
Definition: system.h:39
Definition: cursor.h:32
Definition: surface.h:67