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  bool getTrackEnabled(int track);
76  void setTrackEnabled(int track, bool value);
77 
78  bool hasField(int field) override;
79  Datum getField(int field) override;
80  void setField(int field, const Datum &value) override;
81 
82  Common::String formatInfo() override;
83 
84  Common::Rect getInitialRect() override;
85  Common::Point getRegistrationOffset() override;
86  Common::Point getRegistrationOffset(int16 width, int16 height) override;
87 
88  uint32 getCastDataSize() override;
89  void writeCastData(Common::SeekableWriteStream *writeStream) override;
90  bool canWriteCastData() override;
91 
92  Common::String _filename;
93 
94  uint32 _vflags;
95  bool _looping;
96  bool _pausedAtStart;
97  bool _enableVideo;
98  bool _enableSound;
99  bool _crop;
100  bool _center;
101  bool _preload;
102  int _scaleX, _scaleY; // D7+: playback size percentages [x, y]; [100, 100] = original size
103  bool _showControls;
104  bool _directToStage;
105  bool _avimovie, _qtmovie;
106  bool _dirty;
107  bool _emptyFile;
108  FrameRateType _frameRateType;
109  DigitalVideoType _videoType;
110 
111  byte _ditheringPalette[256*3];
112 
113  uint16 _frameRate;
114  bool _getFirstFrame;
115 
116  Video::VideoDecoder *_video;
117  Graphics::Surface *_lastFrame;
118 
119  Channel *_channel;
120 };
121 
122 } // End of namespace Director
123 
124 #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