ScummVM API documentation
video.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 TRECISION_VIDEO_H
23 #define TRECISION_VIDEO_H
24 
25 #include "common/stream.h"
26 #include "common/serializer.h"
27 #include "video/smk_decoder.h"
28 
29 #include "trecision/struct.h"
30 
31 namespace Trecision {
32 
33 class TrecisionEngine;
34 
36 public:
37  void muteTrack(uint track, bool mute);
38  void setMute(bool mute);
39  virtual bool forceSeekToFrame(uint frame) { return false; }
40  virtual bool endOfFrames() const { return false; }
41 };
42 
44 public:
45  bool loadStream(Common::SeekableReadStream *stream) override;
46  bool forceSeekToFrame(uint frame) override;
47  bool endOfFrames() const override;
48 };
49 
51 public:
52  bool loadStream(Common::SeekableReadStream *stream) override;
53  bool addAudioSideTrack(const Common::Path &path);
54  bool forceSeekToFrame(uint frame) override;
55  bool endOfFrames() const override;
56  const Common::Rect *getNextDirtyRect() override;
57 
58 private:
59  Common::Rect _lastDirtyRect;
60 
61  void readNextPacket() override;
62 
63  class AmigaVideoTrack : public VideoTrack {
64  public:
65  AmigaVideoTrack(Common::SeekableReadStream *stream);
66 
67  private:
68  byte _palette[3 * 256];
69  int _curFrame;
70  uint32 _frameCount;
71 
72  uint16 getWidth() const override;
73  uint16 getHeight() const override;
74  Graphics::PixelFormat getPixelFormat() const override;
75  int getCurFrame() const override { return _curFrame; }
76  uint32 getNextFrameStartTime() const override;
77  const Graphics::Surface *decodeNextFrame() override;
78  int getFrameCount() const override { return _frameCount; }
79  const byte *getPalette() const override { return _palette; }
80  bool hasDirtyPalette() const override { return true; }
81  };
82 
83  class AmigaAudioTrack : public AudioTrack {
84  public:
85  AmigaAudioTrack(Common::SeekableReadStream *stream);
86  private:
87  Audio::AudioStream *getAudioStream() const override { return _audioStream; }
88  Audio::AudioStream *_audioStream;
89  };
90 };
91 
92 } // End of namespace Trecision
93 #endif
virtual const Graphics::Surface * decodeNextFrame()
virtual bool loadStream(Common::SeekableReadStream *stream)
Definition: surface.h:67
Definition: pixelformat.h:138
int getCurFrame() const
const byte * getPalette()
Definition: video_decoder.h:711
Definition: video.h:35
Definition: rect.h:144
Definition: path.h:52
Definition: stream.h:745
Definition: smk_decoder.h:76
Graphics::PixelFormat getPixelFormat() const
Definition: actor.h:29
uint32 getFrameCount() const
Definition: audiostream.h:50
bool hasDirtyPalette() const
Definition: video_decoder.h:331
virtual uint16 getWidth() const
virtual uint16 getHeight() const
Definition: video.h:50
Definition: video_decoder.h:577