ScummVM API documentation
mmovie.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 DIRECTOR_LINGO_XLIBS_MMOVIE_H
23 #define DIRECTOR_LINGO_XLIBS_MMOVIE_H
24 
25 #include "common/hash-str.h"
26 #include "video/qt_decoder.h"
27 namespace Director {
28 
29 // taken from shared:1124:mHandleError
30 enum MMovieError {
31  MMOVIE_NONE = 0,
32  MMOVIE_NO_STAGE = -1,
33  MMOVIE_TOO_MANY_OPEN_FILES = -2,
34  MMOVIE_MOVIE_ALREADY_OPEN = -3,
35  MMOVIE_INVALID_MOVIE_INDEX = -4,
36  MMOVIE_INVALID_OFFSETS_FILE = -5,
37  MMOVIE_INVALID_SEGMENT_OFFSET = -6,
38  MMOVIE_NO_MOVIES_OPEN = -7,
39  MMOVIE_INVALID_SEGMENT_NAME = -8,
40  MMOVIE_INDEX_OUT_OF_RANGE = -9,
41  MMOVIE_CONTINUE_WITHOUT_PLAYING = -10,
42  MMOVIE_ABORT_DOUBLE_CLICK = -11,
43  MMOVIE_PLAYBACK_FINISHED = -12,
44 };
45 
46 struct MMovieSegment {
47  Common::String _name;
48  uint32 _start = 0;
49  uint32 _length = 0;
50  MMovieSegment() {}
51  MMovieSegment(Common::String name, uint32 start, uint32 length) : _name(name), _start(start), _length(length) {}
52 };
53 
54 struct MMovieFile {
55  int _lastIndex = 0;
56  Common::Path _path;
59  Video::QuickTimeDecoder *_video = nullptr;
60  MMovieFile() {}
61  MMovieFile(Common::Path path) : _path(path) {}
62 };
63 
64 class MMovieXObject : public Object<MMovieXObject> {
65 public:
66  MMovieXObject(ObjectType objType);
67  ~MMovieXObject();
68 
69  int _rate = 100;
70  Common::Rect _bounds;
71  int _lastIndex = 1;
72  int _currentMovieIndex = 0;
73  int _currentSegmentIndex = 0;
74  bool _looping = false;
75  bool _restore = false;
76  bool _shiftAbort = false;
77  bool _abortOnClick = false;
78  bool _purge = false;
79  bool _async = false;
80  int _lastTicks = -1;
81 
84 
85  Graphics::Surface _lastFrame;
86 
87  int playSegment(int movieIndex, int segIndex, bool looping, bool restore, bool shiftAbort, bool abortOnClick, bool purge, bool async);
88  bool stopSegment();
89  int updateScreenBlocking();
90  int updateScreen();
91  int getTicks();
92 };
93 
94 namespace MMovieXObj {
95 
96 extern const char *xlibName;
97 extern const XlibFileDesc fileNames[];
98 
99 void open(ObjectType type, const Common::Path &path);
100 void close(ObjectType type);
101 
102 void m_Movie(int nargs);
103 void m_new(int nargs);
104 void m_dispose(int nargs);
105 void m_openMMovie(int nargs);
106 void m_closeMMovie(int nargs);
107 void m_playSegment(int nargs);
108 void m_playSegLoop(int nargs);
109 void m_idleSegment(int nargs);
110 void m_stopSegment(int nargs);
111 void m_seekSegment(int nargs);
112 void m_setSegmentTime(int nargs);
113 void m_setDisplayBounds(int nargs);
114 void m_getMovieNormalWidth(int nargs);
115 void m_getMovieNormalHeight(int nargs);
116 void m_getSegCount(int nargs);
117 void m_getSegName(int nargs);
118 void m_getMovieRate(int nargs);
119 void m_setMovieRate(int nargs);
120 void m_flushEvents(int nargs);
121 void m_invalidateRect(int nargs);
122 void m_readFile(int nargs);
123 void m_writeFile(int nargs);
124 void m_copyFile(int nargs);
125 void m_copyFileCont(int nargs);
126 void m_freeSpace(int nargs);
127 void m_deleteFile(int nargs);
128 void m_volList(int nargs);
129 
130 } // End of namespace MMovieXObj
131 
132 } // End of namespace Director
133 
134 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: array.h:52
Definition: qt_decoder.h:60
Definition: rect.h:144
Definition: path.h:52
Definition: lingo-object.h:37
Definition: archive.h:35
Definition: lingo-object.h:71
Definition: mmovie.h:64
Definition: mmovie.h:46
Definition: mmovie.h:54