28#ifndef GOB_VIDEOPLAYER_H
29#define GOB_VIDEOPLAYER_H
31#include "common/array.h"
32#include "common/list.h"
33#include "common/rect.h"
34#include "common/str.h"
36#include "graphics/surface.h"
109 bool reuseSlotWitSameFilename;
122 bool closeVideo(
int slot = 0);
124 void closeLiveVideos();
127 bool reopenVideo(
int slot = 0);
130 void pauseVideo(
int slot,
bool pause);
131 void pauseAll(
bool pause);
133 void finishVideoSound(
int slot);
134 void waitSoundEnd(
int slot);
137 void waitEndFrame(
int slot,
bool onlySound =
false);
138 int32 getExpectedFrameFromCurrentTime(
int slot);
140 bool isPlayingLive()
const;
141 bool isSoundPlaying()
const;
143 void updateVideos(
bool force =
false,
int exceptSlot = -1);
144 void liveVideosLoop();
146 bool slotIsOpen(
int slot = 0)
const;
150 uint32 getFrameCount (
int slot = 0)
const;
151 uint32 getCurrentFrame (
int slot = 0)
const;
152 uint16 getWidth (
int slot = 0)
const;
153 uint16 getHeight (
int slot = 0)
const;
154 uint16 getDefaultX (
int slot = 0)
const;
155 uint16 getDefaultY (
int slot = 0)
const;
156 uint32 getFlags (
int slot = 0)
const;
157 uint16 getSoundFlags (
int slot = 0)
const;
158 uint32 getVideoBufferSize(
int slot = 0)
const;
159 bool hasVideo (
int slot = 0)
const;
162 bool getFrameCoords(
int slot, int16 frame, int16 &x, int16 &y, int16 &width, int16 &height)
const;
166 bool hasEmbeddedFile(
const Common::String &fileName,
int slot = 0)
const;
169 int32 getSubtitleIndex(
int slot = 0)
const;
171 void writeVideoInfo(
const Common::String &file, uint16 varX, uint16 varY,
172 uint16 varFrames, uint16 varWidth, uint16 varHeight);
174 bool copyFrame(
int slot,
Surface &dest,
175 uint16 left, uint16 top, uint16 width, uint16 height, uint16 x, uint16 y,
176 int32 transp = -1,
bool yAxisReflexion =
false)
const;
180 ::Video::CoktelDecoder *decoder;
185 int16 doubleVideoDestX;
186 int16 doubleVideoDestY;
188 uint32 *highColorMap;
198 bool isEmpty()
const;
204 static const int kVideoSlotCount = 32;
205 static const int kPrimaryVideoSlot = 0;
206 static const int kLiveVideoSlotCount = 6;
207 static const int kVideoSlotWithCurFrameVarCount = 4;
209 static const char *
const _extensions[];
214 Video _videoSlots[kVideoSlotCount];
218 bool _noCursorSwitch;
219 bool _woodruffCohCottWorkaround;
220 uint32 _lastLiveVideosLoopCall;
223 const Video *getVideoBySlot(
int slot)
const;
224 Video *getVideoBySlot(
int slot);
226 int getNextFreeSlot();
230 ::Video::CoktelDecoder *openVideo(
const Common::String &file, Properties &properties);
232 bool reopenVideo(
Video &video);
234 bool lastFrameReached(
Video &video, Properties &properties);
235 bool playFrame(
int slot, Properties &properties);
237 void checkAbort(
Video &video, Properties &properties);
238 void evalBgShading(
Video &video);
240 void copyPalette(
const Video &video, int16 palStart, int16 palEnd);
242 void updateVideo(
int slot,
bool force =
false);
Definition: surface.h:106
Definition: videoplayer.h:50
Flags
Definition: videoplayer.h:52
@ kFlagUseBackSurfaceContentOrDoubleVideo
Use the back surface as a video "base".
Definition: videoplayer.h:54
@ kFlagNoVideo
Only sound.
Definition: videoplayer.h:57
@ kFlagFrontSurface
Draw directly into the front surface.
Definition: videoplayer.h:56
@ kFlagScreenSurface
Draw into a newly created sprite of screen dimensions.
Definition: videoplayer.h:59
@ kFlagOtherSurface
Draw into a specific sprite.
Definition: videoplayer.h:58
Type
Definition: videoplayer.h:63
@ kVideoTypePreIMD
Early IMD format found in Fascination.
Definition: videoplayer.h:66
@ kVideoTypeTry
Try any format.
Definition: videoplayer.h:64
@ kVideoTypeRMD
VMD containing "reversed" video.
Definition: videoplayer.h:68
Definition: videoplayer.h:71
uint16 palCmd
Palette command.
Definition: videoplayer.h:93
int16 palStart
Palette entry to start with.
Definition: videoplayer.h:94
bool forceSeek
Force the seeking to the start frame.
Definition: videoplayer.h:89
int16 palEnd
Palette entry to end at.
Definition: videoplayer.h:95
bool hasSound
Does the video have sound?
Definition: videoplayer.h:105
bool fade
Fade in?
Definition: videoplayer.h:101
int32 width
Width of the video.
Definition: videoplayer.h:78
int32 x
X coordinate of the video.
Definition: videoplayer.h:76
int32 palFrame
Frame to apply the palette command at.
Definition: videoplayer.h:96
int slot
Explicit slot index (-1 = auto).
Definition: videoplayer.h:108
bool canceled
Was the video canceled?
Definition: videoplayer.h:106
int16 breakKey
Keycode of the break/abort key.
Definition: videoplayer.h:91
bool noBlock
Non-blocking "live" video?
Definition: videoplayer.h:98
Type type
Type of the video to open.
Definition: videoplayer.h:72
int32 startFrame
Frame to start playback from.
Definition: videoplayer.h:85
int sprite
The sprite onto which to draw the video.
Definition: videoplayer.h:74
bool waitEndFrame
Wait for the frame's time to run out?
Definition: videoplayer.h:103
int32 y
Y coordinate of the video.
Definition: videoplayer.h:77
int32 endFrame
Last frame of this playback cycle.
Definition: videoplayer.h:87
uint32 flags
Video flags.
Definition: videoplayer.h:81
bool loop
Loop the video?
Definition: videoplayer.h:100
int32 height
Height of the video.
Definition: videoplayer.h:79
bool switchColorMode
Switch between paletted / true color modes?
Definition: videoplayer.h:83
int32 lastFrame
Frame to stop playback at.
Definition: videoplayer.h:86