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