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
27namespace Graphics {
28struct Surface;
29}
30
31namespace Video {
32class VideoDecoder;
33}
34
35namespace Buried {
36
37class VideoWindow : public Window {
38public:
39 VideoWindow(BuriedEngine *vm, Window *parent = 0);
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 onActionEnd(const Common::CustomEventType &action, uint flags);
75
76private:
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: buried.h:96
Definition: video_window.h:37
Definition: window.h:38
Definition: path.h:52
Definition: video_decoder.h:53
uint32 CustomEventType
Definition: events.h:212
Definition: formatinfo.h:28
Definition: rect.h:536
Definition: surface.h:67