ScummVM API documentation
secondarymovie.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 NANCY_ACTION_SECONDARYMOVIE_H
23 #define NANCY_ACTION_SECONDARYMOVIE_H
24 
25 #include "engines/nancy/action/actionrecord.h"
26 
27 namespace Video {
28 class VideoDecoder;
29 }
30 
31 namespace Nancy {
32 namespace Action {
33 
34 class InteractiveVideo;
35 
36 // Plays an AVF or Bink video. Optionally supports:
37 // - playing a sound;
38 // - reverse playback;
39 // - moving with the scene's background frame;
40 // - hiding of player cursor (and thus, disabling input);
41 // - setting event flags on a specific frame, as well as at the end of the video;
42 // - changing the scene after playback ends
43 // Mostly used for cinematics, with some occasional uses for background animations
45  friend class InteractiveVideo;
46 public:
47  static const byte kMovieSceneChange = 5;
48  static const byte kMovieNoSceneChange = 6;
49 
50  static const byte kPlayerCursorAllowed = 1;
51  static const byte kNoPlayerCursorAllowed = 2;
52 
53  static const byte kPlayMovieForward = 1;
54  static const byte kPlayMovieReverse = 2;
55 
56  struct FlagAtFrame {
57  int16 frameID;
58  FlagDescription flagDesc;
59  };
60 
62  virtual ~PlaySecondaryMovie();
63 
64  void init() override;
65  void onPause(bool pause) override;
66 
67  void readData(Common::SeekableReadStream &stream) override;
68  void execute() override;
69 
70  Common::Path _videoName;
71  Common::Path _paletteName;
72  Common::Path _bitmapOverlayName;
73 
74  uint16 _videoType = kVideoPlaytypeAVF;
75  uint16 _videoFormat = kLargeVideoFormat;
76  uint16 _videoSceneChange = kMovieNoSceneChange;
77  byte _playerCursorAllowed = kPlayerCursorAllowed;
78  byte _playDirection = kPlayMovieForward;
79  uint16 _firstFrame = 0;
80  uint16 _lastFrame = 0;
81  Common::Array<FlagAtFrame> _frameFlags;
82  MultiEventFlagDescription _triggerFlags;
83 
84  SoundDescription _sound;
85 
86  SceneChangeDescription _sceneChange;
88 
89  Video::VideoDecoder *_decoder = nullptr;
90 
91 protected:
92  Common::String getRecordTypeName() const override { return "PlaySecondaryMovie"; }
93  bool isViewportRelative() const override { return true; }
94 
95  Graphics::ManagedSurface _fullFrame;
96  int _curViewportFrame = -1;
97  bool _isFinished = false;
98 };
99 
100 } // End of namespace Action
101 } // End of namespace Nancy
102 
103 #endif // NANCY_ACTION_SECONDARYMOVIE_H
Definition: managed_surface.h:51
Definition: commontypes.h:199
Definition: str.h:59
Definition: commontypes.h:151
Definition: array.h:52
Definition: path.h:52
Definition: stream.h:745
Definition: secondarymovie.h:44
Definition: actionrecord.h:149
Definition: secondarymovie.h:56
Definition: video_decoder.h:52
Definition: interactivevideo.h:33
Definition: commontypes.h:254
Definition: avi_frames.h:36
Definition: commontypes.h:166
Definition: actionmanager.h:32