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/spacebar/boflib/gui/dialog.h"
28 #include "bagel/boflib/rect.h"
29 #include "bagel/boflib/error.h"
30 #include "bagel/boflib/palette.h"
31 
32 namespace Bagel {
33 namespace SpaceBar {
34 
35 class CBagFMovie : public CBofDialog {
36 public:
37  enum MovieStatus {
38  MOVIE_STOPPED, MOVIE_PAUSED, MOVIE_FORWARD, MOVIE_REVERSE
39  };
40 
41 protected:
43 
44  bool _escCanStopFl;
45  bool _loopFl;
46  MovieStatus _movieStatus;
47 
48  CBofBitmap *_bmpBuf;
49  CBofBitmap *_filterBmp;
50  CBofPalette *_smackerPal;
51  char *_bufferStart;
52  int _bufferLength;
53  CBofRect _bounds;
54  bool _useNewPaletteFl;
55  bool _blackOutWindowFl;
56 
61  virtual ErrorCode initialize(CBofWindow *pParent);
62 
67  virtual bool openMovie(const char *sFilename);
68 
72  virtual void closeMovie();
73 
74  void onReSize(CBofSize *pSize) override {
75  };
76 
77  virtual bool play();
78  virtual bool reverse();
79 
80  void onLButtonUp(uint32 flags, CBofPoint *point, void * = nullptr) override {
81  onButtonUp(flags, point);
82  }
83  virtual void onButtonUp(uint32 flags, CBofPoint *point) {
84  };
85  void onPaint(CBofRect *pRect) override;
86  virtual void onMovieDone();
87  void onClose() override;
88  void onMainLoop() override;
89 
93  void onKeyHit(uint32 keyCode, uint32 repCount) override;
94 
95 public:
104  CBagFMovie(CBofWindow *parent = nullptr, const char *filename = nullptr,
105  CBofRect *bounds = nullptr, bool useNewPalette = true, bool blackOutWindow = false);
106 
110  ~CBagFMovie();
111 
116  virtual bool open(const char *filename = nullptr, CBofRect *bounds = nullptr);
117 
118  virtual bool play(bool loop, bool escCanStop = true);
119  virtual bool reverse(bool loop, bool escCanStop = true);
120  virtual bool pause();
121  virtual bool stop();
122 
123  virtual MovieStatus status() {
124  return _movieStatus;
125  }
126 
127  virtual bool seekToStart();
128  virtual bool seekToEnd();
129 
130  virtual uint32 getFrame();
131  virtual bool setFrame(uint32 frameNum);
132 
133  virtual bool centerRect();
134 };
135 
136 } // namespace SpaceBar
137 } // namespace Bagel
138 
139 #endif
void onKeyHit(uint32 keyCode, uint32 repCount) override
Definition: size.h:32
Definition: window.h:53
virtual ErrorCode initialize(CBofWindow *pParent)
Definition: rect.h:35
Definition: smk_decoder.h:77
Definition: fmovie.h:35
CBagFMovie(CBofWindow *parent=nullptr, const char *filename=nullptr, CBofRect *bounds=nullptr, bool useNewPalette=true, bool blackOutWindow=false)
virtual bool openMovie(const char *sFilename)
Definition: palette.h:64
Definition: afxwin.h:27
Definition: point.h:32
virtual bool open(const char *filename=nullptr, CBofRect *bounds=nullptr)
Definition: dialog.h:39
Definition: bitmap.h:57