ScummVM API documentation
fmovie.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_BAGLIB_FMOVIE_H
24 #define BAGEL_BAGLIB_FMOVIE_H
25 
26 #include "video/smk_decoder.h"
27 #include "bagel/boflib/gui/dialog.h"
28 #include "bagel/boflib/rect.h"
29 #include "bagel/boflib/error.h"
30 #include "bagel/boflib/gfx/palette.h"
31 
32 namespace Bagel {
33 
34 class CBagFMovie : public CBofDialog {
35 public:
36  enum MovieStatus { MOVIE_STOPPED, MOVIE_PAUSED, MOVIE_FORWARD, MOVIE_REVERSE };
37 
38 protected:
40 
41  bool _escCanStopFl;
42  bool _loopFl;
43  MovieStatus _movieStatus;
44 
45  CBofBitmap *_bmpBuf;
46  CBofBitmap *_filterBmp;
47  CBofPalette *_smackerPal;
48  char *_bufferStart;
49  int _bufferLength;
50  CBofRect _bounds;
51  bool _useNewPaletteFl;
52  bool _blackOutWindowFl;
53 
58  virtual ErrorCode initialize(CBofWindow *pParent);
59 
64  virtual bool openMovie(const char *sFilename);
65 
69  virtual void closeMovie();
70 
71  void onReSize(CBofSize *pSize) override {};
72 
73  virtual bool play();
74  virtual bool reverse();
75 
76  void onLButtonUp(uint32 flags, CBofPoint *point, void * = nullptr) override {
77  onButtonUp(flags, point);
78  }
79  virtual void onButtonUp(uint32 flags, CBofPoint *point) {};
80  void onPaint(CBofRect *pRect) override;
81  virtual void onMovieDone();
82  void onClose() override;
83  void onMainLoop() override;
84 
88  void onKeyHit(uint32 keyCode, uint32 repCount) override;
89 
90 public:
99  CBagFMovie(CBofWindow *parent = nullptr, const char *filename = nullptr,
100  CBofRect *bounds = nullptr, bool useNewPalette = true, bool blackOutWindow = false);
101 
105  ~CBagFMovie();
106 
111  virtual bool open(const char *filename = nullptr, CBofRect *bounds = nullptr);
112 
113  virtual bool play(bool loop, bool escCanStop = true);
114  virtual bool reverse(bool loop, bool escCanStop = true);
115  virtual bool pause();
116  virtual bool stop();
117 
118  virtual MovieStatus status() {
119  return _movieStatus;
120  }
121 
122  virtual bool seekToStart();
123  virtual bool seekToEnd();
124 
125  virtual uint32 getFrame();
126  virtual bool setFrame(uint32 frameNum);
127 
128  virtual bool centerRect();
129 };
130 
131 } // namespace Bagel
132 
133 #endif
Definition: window.h:50
Definition: fmovie.h:34
virtual bool open(const char *filename=nullptr, CBofRect *bounds=nullptr)
Definition: size.h:31
CBagFMovie(CBofWindow *parent=nullptr, const char *filename=nullptr, CBofRect *bounds=nullptr, bool useNewPalette=true, bool blackOutWindow=false)
Definition: bitmap.h:55
Definition: dialog.h:38
virtual ErrorCode initialize(CBofWindow *pParent)
Definition: rect.h:36
Definition: smk_decoder.h:76
virtual bool openMovie(const char *sFilename)
virtual void closeMovie()
Definition: bagel.h:31
Definition: point.h:34
Definition: palette.h:69
void onKeyHit(uint32 keyCode, uint32 repCount) override