ScummVM API documentation
video_window.h
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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BURIED_VIDEO_WINDOW_H
23 #define BURIED_VIDEO_WINDOW_H
24 
25 #include "buried/window.h"
26 
27 namespace Graphics {
28 struct Surface;
29 }
30 
31 namespace Video {
32 class VideoDecoder;
33 }
34 
35 namespace Buried {
36 
37 class VideoWindow : public Window {
38 public:
39  VideoWindow(BuriedEngine *vm, Window *parent = 0);
40  ~VideoWindow();
41 
42  // ScummVM-specific interface
43  void updateVideo();
44  void pauseVideo();
45  void resumeVideo();
46 
47  // VFW interface
48  bool playVideo(); // MCIWndPlay
49  bool playToFrame(int frame); // MCIWndPlayTo
50  bool seekToFrame(int frame); // MCIWndSeek
51  void stopVideo(); // MCIWndStop
52  int getCurFrame(); // MCIWndGetPosition
53  int getFrameCount(); // MCIWndGetLength
54  void setSourceRect(const Common::Rect &srcRect); // MCIWndPutSource
55  void setDestRect(const Common::Rect &dstRect); // MCIWndPutDest
56  void setAudioTrack(int track); // MCIWndSendString + "setaudio stream to %d"
57 
58  bool openVideo(const Common::Path &fileName); // MCIWndOpen
59  void closeVideo(); // MCIWndClose
60 
61  enum Mode {
62  kModeClosed, // "Not ready" is stupid
63  kModeOpen,
64  kModePaused,
65  kModePlaying,
66  kModeSeeking,
67  kModeStopped
68  };
69 
70  Mode getMode() const { return _mode; } // MCIWndGetMode
71 
72  // Window interface
73  void onPaint();
74  void onKeyUp(const Common::KeyState &key, uint flags);
75 
76 private:
77  Video::VideoDecoder *_video;
78  const Graphics::Surface *_lastFrame;
79  Mode _mode;
80  Graphics::Surface *_ownedFrame;
81  bool _needsPalConversion;
82  Common::Rect _srcRect, _dstRect;
83 };
84 
85 } // End of namespace Buried
86 
87 #endif
Definition: window.h:37
Definition: surface.h:67
Definition: rect.h:144
Definition: path.h:52
Definition: buried.h:67
Definition: agent_evaluation.h:31
Definition: video_window.h:37
Definition: video_decoder.h:53
Definition: formatinfo.h:28
Definition: keyboard.h:294
Definition: avi_frames.h:36