xoreos  0.0.5
fader.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef VIDEO_FADER_H
26 #define VIDEO_FADER_H
27 
28 #include "src/common/rational.h"
29 
30 #include "src/video/decoder.h"
31 
32 namespace Video {
33 
35 class Fader : public VideoDecoder {
36 public:
37  Fader(uint32 width, uint32 height, int n);
38 
39 protected:
40  void decodeNextTrackFrame(VideoTrack &track);
41 
42 private:
44  public:
45  FaderVideoTrack(uint32 width, uint32 height, int n);
46 
47  uint32 getWidth() const { return _width; }
48  uint32 getHeight() const { return _height; }
49  int getCurFrame() const { return _curFrame; }
50  int getFrameCount() const { return _n * 128; }
51 
52  void drawFrame(Graphics::Surface &surface);
53 
54  protected:
55  Common::Rational getFrameRate() const { return 50; }
56 
57  private:
60  int _curFrame;
62  int _n;
63  };
64 };
65 
66 } // End of namespace Video
67 
68 #endif // VIDEO_FADER_H
A simple rational class that holds fractions.
Definition: rational.h:56
uint32 getHeight() const
Get the height of this track.
Definition: fader.h:48
uint32 getWidth() const
Get the width of this track.
Definition: fader.h:47
A generic interface for video decoders.
Definition: decoder.h:55
A VideoTrack that is played at a constant rate.
Definition: decoder.h:277
int getCurFrame() const
Get the current frame of this track.
Definition: fader.h:49
Fader(uint32 width, uint32 height, int n)
Definition: fader.cpp:35
Common::Rational getFrameRate() const
Get the rate at which this track is played.
Definition: fader.h:55
An abstract representation of a video track.
Definition: decoder.h:226
A quick test fader "video".
Definition: fader.h:35
int getFrameCount() const
Get the frame count of this track.
Definition: fader.h:50
void decodeNextTrackFrame(VideoTrack &track)
Decode enough data for the next frame.
Definition: fader.cpp:40
uint32_t uint32
Definition: types.h:204
Rational number implementation.
void drawFrame(Graphics::Surface &surface)
Definition: fader.cpp:49
uint8 byte
Definition: types.h:209
Generic video decoder interface.
FaderVideoTrack(uint32 width, uint32 height, int n)
Definition: fader.cpp:46