ScummVM API documentation
movie.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_BOFLIB_GUI_MOVIE_H
24 #define BAGEL_BOFLIB_GUI_MOVIE_H
25 
26 #include "graphics/managed_surface.h"
27 #include "video/smk_decoder.h"
28 #include "bagel/boflib/error.h"
29 #include "bagel/spacebar/boflib/gui/dialog.h"
30 #include "bagel/boflib/rect.h"
31 
32 namespace Bagel {
33 namespace SpaceBar {
34 
35 class CBofMovie : public CBofDialog {
36 public:
37  enum MVSTATUS {
38  STOPPED, PAUSED, FORWARD, REVERSE
39  };
40 protected:
42  Video::SmackerDecoder *_pSmk;
43  bool _bEscCanStop;
44  bool _bLoop;
45  bool _bStretch;
46  bool _bUseNewPalette;
47  bool _bBlackOutWindow;
48  MVSTATUS _eMovStatus;
49  Common::Rect _srcRect, _dstRect;
50 
51  virtual ErrorCode initialize(CBofWindow *pParent);
52 
53  virtual bool openMovie(const char *sFilename);
54  virtual void closeMovie();
55 
56  virtual void onReSize(CBofSize *pSize);
57 
58  virtual bool play();
59  virtual bool reverse();
60 
61  virtual void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr) {
62  onButtonUp(nFlags, pPoint);
63  }
64  virtual void onRButtonUp(uint32 nFlags, CBofPoint *pPoint) {
65  onButtonUp(nFlags, pPoint);
66  }
67  virtual void onButtonUp(uint32 nFlags, CBofPoint *pPoint);
68  virtual void onPaint(CBofRect *pRect);
69  virtual void onMovieDone();
70  virtual void onClose();
71  virtual void onMainLoop();
72  virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
73 
74 public:
75 
76  CBofMovie(CBofWindow *pParent = nullptr, const char *pszFilename = nullptr, CBofRect *pBounds = nullptr, bool bStretch = false, bool bUseNewPalette = true, bool bBlackOutWindow = false);
77  ~CBofMovie();
78 
79  virtual bool open(const char *sFilename = nullptr, CBofRect *pBounds = nullptr);
80 
81  virtual bool play(bool bLoop, bool bEscCanStop = true);
82  virtual bool reverse(bool bLoop, bool bEscCanStop = true);
83  virtual bool pause();
84  virtual bool stop();
85 
86  virtual MVSTATUS status() {
87  return _eMovStatus;
88  }
89 
90  virtual bool seekToStart();
91  virtual bool seekToEnd();
92 
93  virtual uint32 getFrame();
94  virtual bool setFrame(uint32 dwFrameNum);
95 
96  virtual bool centerRect();
97 
98  Graphics::ManagedSurface *getSmackBuffer() {
99  return _pSbuf;
100  }
101  Video::SmackerDecoder *getSmackMovie() {
102  return _pSmk;
103  }
104 };
105 
106 ErrorCode bofPlayMovie(CBofWindow *pParent, const char *pszMovieFile, CBofRect *pRect = nullptr);
107 
108 } // namespace SpaceBar
109 } // namespace Bagel
110 
111 #endif
Definition: managed_surface.h:51
Definition: size.h:32
Definition: rect.h:524
Definition: window.h:53
Definition: rect.h:35
Definition: smk_decoder.h:77
Definition: movie.h:35
Definition: afxwin.h:27
Definition: point.h:32
Definition: dialog.h:39