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 
32 namespace Titanic {
33 
34 class CGameObject;
35 class CMovie;
36 class CSoundManager;
37 class CVideoSurface;
38 
39 class CMovieList : public List<CMovie> {
40 public:
41 };
42 
43 class CMovie : public ListItem {
44 protected:
48  void addToPlayingMovies();
49 public:
50  bool _handled;
51  bool _hasVideoFrame;
52 public:
53  static CMovieList *_playingMovies;
54  static CVideoSurface *_movieSurface;
55 
59  static void init();
60 
64  static void deinit();
65 public:
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 
147  virtual Graphics::ManagedSurface *duplicateTransparency() const = 0;
148 
152  void removeFromPlayingMovies();
153 
157  bool isActive() const;
158 
162  bool hasVideoFrame();
163 };
164 
165 class OSMovie : public CMovie {
166 private:
167  AVISurface _aviSurface;
168  CVideoSurface *_videoSurface;
169  int _field18;
170  int _field24;
171  int _field28;
172  int _field2C;
173 private:
177  void movieStarted();
178 public:
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 
260  Graphics::ManagedSurface *duplicateTransparency() const override;
261 };
262 
263 } // End of namespace Titanic
264 
265 #endif /* TITANIC_MOVIE_H */
Definition: managed_surface.h:51
Definition: resource_key.h:30
Definition: list.h:35
Definition: movie_range_info.h:76
Definition: game_object.h:79
Definition: movie.h:43
Definition: rect.h:35
Definition: sound_manager.h:42
Definition: list.h:71
Definition: arm.h:30
Definition: avi_surface.h:99
Definition: movie.h:39
Definition: video_surface.h:43
Definition: movie.h:165
Definition: movie_event.h:56