ScummVM API documentation
movie.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 TITANIC_MOVIE_H
23#define TITANIC_MOVIE_H
24
25#include "common/list.h"
26#include "video/video_decoder.h"
27#include "titanic/core/list.h"
28#include "titanic/core/resource_key.h"
29#include "titanic/support/avi_surface.h"
30#include "titanic/support/movie_range_info.h"
31
32namespace Titanic {
33
34class CGameObject;
35class CMovie;
36class CSoundManager;
37class CVideoSurface;
38
39class CMovieList : public List<CMovie> {
40public:
41};
42
43class CMovie : public ListItem {
44protected:
49public:
50 bool _handled;
51 bool _hasVideoFrame;
52public:
53 static CMovieList *_playingMovies;
54 static CVideoSurface *_movieSurface;
55
59 static void init();
60
64 static void deinit();
65public:
66 CMovie();
67 ~CMovie() override;
68
72 virtual void play(uint flags, CGameObject *obj) = 0;
73
77 virtual void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) = 0;
78
82 virtual void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) = 0;
83
89 virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0;
90
97 virtual void pause() = 0;
98
102 virtual void stop() = 0;
103
107 virtual void addEvent(int frameNumber, CGameObject *obj) = 0;
108
112 virtual void setFrame(uint frameNumber) = 0;
113
117 virtual bool handleEvents(CMovieEventList &events) = 0;
118
122 virtual const CMovieRangeInfoList *getMovieRangeInfo() const = 0;
123
127 virtual void setSoundManager(CSoundManager *soundManager) = 0;
128
132 virtual int getFrame() const = 0;
133
137 virtual void setFrameRate(double rate) = 0;
138
142 virtual void setPlaying(bool playingFlag) = 0;
143
148
153
157 bool isActive() const;
158
163};
164
165class OSMovie : public CMovie {
166private:
167 AVISurface _aviSurface;
168 CVideoSurface *_videoSurface;
169 int _field18;
170 int _field24;
171 int _field28;
172 int _field2C;
173private:
177 void movieStarted();
178public:
179 OSMovie(const CResourceKey &name, CVideoSurface *surface);
180 ~OSMovie() override;
181
185 void play(uint flags, CGameObject *obj) override;
186
190 void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) override;
191
195 void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) override;
196
202 bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) override;
203
210 void pause() override;
211
215 void stop() override;
216
220 void addEvent(int eventId, CGameObject *obj) override;
221
225 void setFrame(uint frameNumber) override;
226
230 bool handleEvents(CMovieEventList &events) override;
231
235 int getFrame() const override;
236
240 const CMovieRangeInfoList *getMovieRangeInfo() const override;
241
245 void setSoundManager(CSoundManager *soundManager) override;
246
250 void setFrameRate(double rate) override;
251
255 void setPlaying(bool playingFlag) override;
256
261};
262
263} // End of namespace Titanic
264
265#endif /* TITANIC_MOVIE_H */
Definition: managed_surface.h:51
Definition: avi_surface.h:99
Definition: game_object.h:79
Definition: movie_event.h:56
Definition: movie.h:43
void addToPlayingMovies()
bool hasVideoFrame()
virtual void setFrame(uint frameNumber)=0
virtual void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj)=0
virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame)=0
virtual Graphics::ManagedSurface * duplicateTransparency() const =0
virtual void setFrameRate(double rate)=0
virtual void pause()=0
virtual void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj)=0
virtual const CMovieRangeInfoList * getMovieRangeInfo() const =0
void removeFromPlayingMovies()
bool isActive() const
virtual void setSoundManager(CSoundManager *soundManager)=0
virtual int getFrame() const =0
static void deinit()
static void init()
virtual void addEvent(int frameNumber, CGameObject *obj)=0
virtual void setPlaying(bool playingFlag)=0
virtual void play(uint flags, CGameObject *obj)=0
virtual bool handleEvents(CMovieEventList &events)=0
virtual void stop()=0
Definition: movie.h:39
Definition: movie_range_info.h:76
Definition: resource_key.h:30
Definition: sound_manager.h:42
Definition: video_surface.h:43
Definition: list.h:71
Definition: list.h:35
Definition: movie.h:165
void play(uint flags, CGameObject *obj) override
Graphics::ManagedSurface * duplicateTransparency() const override
void pause() override
void setFrame(uint frameNumber) override
bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) override
bool handleEvents(CMovieEventList &events) override
void addEvent(int eventId, CGameObject *obj) override
void stop() override
const CMovieRangeInfoList * getMovieRangeInfo() const override
void setSoundManager(CSoundManager *soundManager) override
void setFrameRate(double rate) override
int getFrame() const override
void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) override
void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) override
void setPlaying(bool playingFlag) override
Definition: rect.h:35