ScummVM API documentation
digitalvideo.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 DIRECTOR_CASTMEMBER_DIGITALVIDEO_H
23 #define DIRECTOR_CASTMEMBER_DIGITALVIDEO_H
24 
25 #include "director/castmember/castmember.h"
26 
27 namespace Video {
28 class VideoDecoder;
29 }
30 
31 namespace Director {
32 
33 class XtraCastMember;
34 
35 enum DigitalVideoType {
36  kDVQuickTime,
37  kDVVideoForWindows,
38  kDVUnknown = -1,
39 };
40 
42 public:
43  DigitalVideoCastMember(Cast *cast, uint16 castId);
44  DigitalVideoCastMember(Cast *cast, uint16 castId, Common::SeekableReadStreamEndian &stream, uint16 version);
45  DigitalVideoCastMember(Cast *cast, uint16 castId, DigitalVideoCastMember &source);
47 
48  CastMember *duplicate(Cast *cast, uint16 castId) override { return (CastMember *)(new DigitalVideoCastMember(cast, castId, *this)); }
49 
50  static CastMember *createFromXtra(Cast *cast, uint16 castId, XtraCastMember *xtra);
51 
52  bool isModified() override;
53  Graphics::MacWidget *createWidget(Common::Rect &bbox, Channel *channel, SpriteType spriteType) override;
54 
55  bool loadVideoFromCast();
56  bool loadVideo(Common::String path);
57  void setChannel(Channel *channel) { _channel = channel; }
58  void startVideo();
59  void stopVideo();
60  void rewindVideo();
61  bool endOfVideo();
62 
63  uint getTimeScale();
64  uint getMovieCurrentTime();
65  uint getMovieCurrentTimeMillis();
66  uint getDuration();
67  uint getMovieTotalTime();
68  uint getMovieTotalTimeMillis();
69  void seekMovie(int stamp);
70  void setStartTime(int stamp);
71  void setStopTime(int stamp);
72  void setMovieTime(int units);
73  void setMovieRate(double rate);
74  void setFrameRate(int rate);
75 
76  bool hasField(int field) override;
77  Datum getField(int field) override;
78  void setField(int field, const Datum &value) override;
79 
80  Common::String formatInfo() override;
81 
82  Common::Rect getInitialRect() override;
83  Common::Point getRegistrationOffset() override;
84  Common::Point getRegistrationOffset(int16 width, int16 height) override;
85 
86  uint32 getCastDataSize() override;
87  void writeCastData(Common::SeekableWriteStream *writeStream) override;
88  bool canWriteCastData() override;
89 
90  Common::String _filename;
91 
92  uint32 _vflags;
93  bool _looping;
94  bool _pausedAtStart;
95  bool _enableVideo;
96  bool _enableSound;
97  bool _crop;
98  bool _center;
99  bool _preload;
100  int _scaleX, _scaleY; // D7+: playback size percentages [x, y]; [100, 100] = original size
101  bool _showControls;
102  bool _directToStage;
103  bool _avimovie, _qtmovie;
104  bool _dirty;
105  bool _emptyFile;
106  FrameRateType _frameRateType;
107  DigitalVideoType _videoType;
108 
109  byte _ditheringPalette[256*3];
110 
111  uint16 _frameRate;
112  bool _getFirstFrame;
113 
114  Video::VideoDecoder *_video;
115  Graphics::Surface *_lastFrame;
116 
117  Channel *_channel;
118 };
119 
120 } // End of namespace Director
121 
122 #endif
Definition: cast.h:88
Definition: str.h:59
Definition: surface.h:67
Definition: channel.h:40
Definition: rect.h:536
Definition: archive.h:36
Definition: digitalvideo.h:41
Definition: video_decoder.h:53
Definition: xtra.h:29
Definition: rect.h:144
Definition: macwidget.h:39
Definition: lingo.h:131
Definition: stream.h:351
Definition: stream.h:944
Definition: animation.h:37
Definition: castmember.h:48