ScummVM API documentation
WinVideo.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 QDENGINE_QDCORE_UTIL_WINVIDEO_H
23 #define QDENGINE_QDCORE_UTIL_WINVIDEO_H
24 
25 //#define __WINVIDEO_LOG__
26 
27 namespace Video {
28 class MPEGPSDecoder;
29 }
30 
31 namespace Graphics {
32 class ManagedSurface;
33 }
34 
35 namespace Common {
36 class File;
37 }
38 
39 namespace QDEngine {
40 
41 class winVideo {
42 public:
43  enum PlaybackStatus {
44  VID_RUNNING,
45  VID_STOPPED,
46  VID_PAUSED
47  };
48 
49  winVideo();
50  ~winVideo();
51 
52  static bool init(); // initialize DirectShow Lib
53  static bool done(); // uninitialize DirectShow Lib
54 
55  bool open_file(const Common::Path fname);
56  void close_file();
57 
58  bool play();
59  bool stop();
60  bool quant();
61  bool is_playback_finished();
62 
63  void set_window(int x = 0, int y = 0, int xsize = 0, int ysize = 0);
64  bool get_movie_size(int &sx, int &sy);
65  bool set_window_size(int sx, int sy);
66 
67 private:
68  // Coordinates of the top left corner of the video
69  int _x;
70  int _y;
71 
72  int _vidWidth;
73  int _vidHeight;
74 
75  Graphics::ManagedSurface *_tempSurf = nullptr;
76 
77  // Video decoder
78  Video::MPEGPSDecoder *_decoder;
79  Common::File *_videostream;
80 
81  static bool _is_initialized;
82 };
83 
84 } // namespace QDEngine
85 
86 #endif // QDENGINE_QDCORE_UTIL_WINVIDEO_H
Definition: managed_surface.h:51
Definition: path.h:52
Definition: file.h:47
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: avi_frames.h:36
Definition: mpegps_decoder.h:55
Definition: WinVideo.h:41