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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  *
24  */
25 
26 #ifndef PEGASUS_MOVIE_H
27 #define PEGASUS_MOVIE_H
28 
29 #include "common/str.h"
30 
31 #include "pegasus/elements.h"
32 #include "pegasus/surface.h"
33 
34 namespace Video {
35 class VideoDecoder;
36 }
37 
38 namespace Pegasus {
39 
40 class Movie : public Animation, public PixelImage {
41 public:
42 	Movie(const DisplayElementID);
43 	virtual ~Movie();
44 
45 	virtual void initFromMovieFile(const Common::String &fileName, bool transparent = false);
46 
isMovieValid()47 	bool isMovieValid() { return _video != 0; }
48 
49 	virtual void releaseMovie();
50 
51 	virtual void draw(const Common::Rect &);
52 	virtual void redrawMovieWorld();
53 
54 	virtual void setTime(const TimeValue, const TimeScale = 0);
55 
56 	virtual void setRate(const Common::Rational);
57 
58 	virtual void start();
59 	virtual void stop();
60 	virtual void resume();
61 	virtual void pause();
62 
63 	virtual void moveMovieBoxTo(const CoordType, const CoordType);
64 
65 	virtual void setStop(const TimeValue, const TimeScale = 0);
66 
67 	virtual TimeValue getDuration(const TimeScale = 0) const;
68 
69 	// *** HACK ALERT
getMovie()70 	Video::VideoDecoder *getMovie() { return _video; }
71 	void setVolume(uint16);
72 
73 protected:
74 	void updateTime();
75 
76 	Video::VideoDecoder *_video;
77 	Common::Rect _movieBox;
78 };
79 
80 class GlowingMovie : public Movie {
81 public:
82 	GlowingMovie(DisplayElementID);
~GlowingMovie()83 	virtual ~GlowingMovie() {}
84 
85 	virtual void draw(const Common::Rect &);
86 
87 	void setBounds(const Common::Rect &);
88 
setGlowing(const bool glowing)89 	void setGlowing(const bool glowing) { _glowing = glowing; }
90 
91 protected:
92 	bool _glowing;
93 };
94 
95 class ScalingMovie : public GlowingMovie {
96 public:
97 	ScalingMovie(DisplayElementID);
~ScalingMovie()98 	virtual ~ScalingMovie() {}
99 
100 	virtual void draw(const Common::Rect &);
101 };
102 
103 } // End of namespace Pegasus
104 
105 #endif
106