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