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 enum DigitalVideoType {
34  kDVQuickTime,
35  kDVVideoForWindows,
36  kDVUnknown = -1,
37 };
38 
40 public:
41  DigitalVideoCastMember(Cast *cast, uint16 castId);
42  DigitalVideoCastMember(Cast *cast, uint16 castId, Common::SeekableReadStreamEndian &stream, uint16 version);
43  DigitalVideoCastMember(Cast *cast, uint16 castId, DigitalVideoCastMember &source);
45 
46  CastMember *duplicate(Cast *cast, uint16 castId) override { return (CastMember *)(new DigitalVideoCastMember(cast, castId, *this)); }
47 
48  bool isModified() override;
49  Graphics::MacWidget *createWidget(Common::Rect &bbox, Channel *channel, SpriteType spriteType) override;
50 
51  bool loadVideoFromCast();
52  bool loadVideo(Common::String path);
53  void setChannel(Channel *channel) { _channel = channel; }
54  void startVideo();
55  void stopVideo();
56  void rewindVideo();
57 
58  uint getMovieCurrentTime();
59  uint getDuration();
60  uint getMovieTotalTime();
61  void seekMovie(int stamp);
62  void setStopTime(int stamp);
63  void setMovieRate(double rate);
64  void setFrameRate(int rate);
65 
66  bool hasField(int field) override;
67  Datum getField(int field) override;
68  void setField(int field, const Datum &value) override;
69 
70  Common::String formatInfo() override;
71 
72  Common::Point getRegistrationOffset() override;
73  Common::Point getRegistrationOffset(int16 width, int16 height) override;
74 
75  uint32 getCastDataSize() override;
76  void writeCastData(Common::SeekableWriteStream *writeStream) override;
77 
78  Common::String _filename;
79 
80  uint32 _vflags;
81  bool _looping;
82  bool _pausedAtStart;
83  bool _enableVideo;
84  bool _enableSound;
85  bool _crop;
86  bool _center;
87  bool _preload;
88  bool _showControls;
89  bool _directToStage;
90  bool _avimovie, _qtmovie;
91  bool _dirty;
92  bool _emptyFile;
93  FrameRateType _frameRateType;
94  DigitalVideoType _videoType;
95 
96  byte _ditheringPalette[256*3];
97 
98  uint16 _frameRate;
99  bool _getFirstFrame;
100  int _duration;
101 
102  Video::VideoDecoder *_video;
103  Graphics::Surface *_lastFrame;
104 
105  Channel *_channel;
106 };
107 
108 } // End of namespace Director
109 
110 #endif
Definition: cast.h:87
Definition: str.h:59
Definition: surface.h:67
Definition: channel.h:40
Definition: rect.h:524
Definition: archive.h:36
Definition: digitalvideo.h:39
Definition: video_decoder.h:53
Definition: rect.h:144
Definition: macwidget.h:39
Definition: lingo.h:130
Definition: stream.h:351
Definition: stream.h:944
Definition: animation.h:37
Definition: castmember.h:48