aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/avi_surface.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-09 11:32:15 -0400
committerPaul Gilbert2016-07-15 19:27:33 -0400
commitcc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7 (patch)
tree7a3a9a9fb8f0ce6fa15ab71a12c1144893c45811 /engines/titanic/support/avi_surface.h
parent341cf1866168a8e270ed08b38cd43aa83387ea5a (diff)
downloadscummvm-rg350-cc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7.tar.gz
scummvm-rg350-cc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7.tar.bz2
scummvm-rg350-cc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7.zip
TITANIC: Major implementation of OSMovie and AVISurface classes
Diffstat (limited to 'engines/titanic/support/avi_surface.h')
-rw-r--r--engines/titanic/support/avi_surface.h110
1 files changed, 99 insertions, 11 deletions
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 248f2c5ab3..48c8169e78 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -23,33 +23,121 @@
#ifndef TITANIC_AVI_SURFACE_H
#define TITANIC_AVI_SURFACE_H
-#include "video/video_decoder.h"
+#include "video/avi_decoder.h"
#include "titanic/core/resource_key.h"
#include "titanic/support/movie_range_info.h"
namespace Titanic {
class CSoundManager;
+class CVideoSurface;
+
+enum MovieFlag {
+ MOVIE_1 = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NO_OBJECT = 4,
+ MOVIE_REVERSE = 8, MOVIE_GAMESTATE = 0x10
+};
class AVISurface {
private:
+ Video::AVIDecoder *_decoder;
+ CVideoSurface *_videoSurface;
int _field4;
int _field8;
- int _fieldC;
- int _field10;
- int _frame;
+ int _currentPos;
+ int _priorFrame;
CMovieRangeInfoList _movieRangeInfo;
- int _field28;
- int _field2C;
- int _field30;
- int _field34;
- int _field38;
+ int _streamCount;
+ void *_frameInfo;
+private:
+ /**
+ * Render a frame to the video surface
+ */
+ bool renderFrame();
+protected:
+ /**
+ * Change the frame with ??? checking
+ */
+ virtual bool changeFrame(int frameNumber);
+
+ /**
+ * Seeks to a given frame number in the video
+ */
+ virtual void seekToFrame(uint frameNumber);
+public:
CSoundManager *_soundManager;
- // TODO: Lots more fields
+ bool _hasAudio;
+ bool _isPlaying;
+ double _frameRate;
public:
AVISurface(const CResourceKey &key);
+ ~AVISurface();
+
+ /**
+ * Start playing the loaded AVI video
+ */
+ virtual bool play(uint flags, CGameObject *obj);
+
+ /**
+ * Start playing the loaded AVI video
+ */
+ virtual bool play(int startFrame, int endFrame, uint flags, CGameObject *obj);
+
+ /**
+ * Start playing the loaded AVI video
+ */
+ virtual bool play(int startFrame, int endFrame, int initialFrame, uint flags, CGameObject *obj);
+
+ /**
+ * Stop the currently playing video
+ */
+ virtual void stop();
+
+ /**
+ * Handle any movie events relevent for the frame
+ */
+ virtual bool handleEvents(CMovieEventList &events);
+
+ /**
+ * Set the video surface the AVI Surface will render on
+ */
+ void setVideoSurface(CVideoSurface *surface);
+
+ /**
+ * Get the width of the video
+ */
+ uint getWidth() const;
+
+ /**
+ * Get the height of the video
+ */
+ uint getHeight() const;
+
+ /**
+ * Set the current frame
+ */
+ void setFrame(int frameNumber);
+
+ /**
+ * Gets the current frame
+ */
+ int getFrame() const;
+
+ /**
+ * Add a movie event
+ */
+ bool addEvent(int frameNumber, CGameObject *obj);
+
+ const void *getFrameInfo() const {
+ return _streamCount <= 1 ? nullptr : _frameInfo;
+ }
+
+ /**
+ * Get a reference to the movie range info list
+ */
+ const CMovieRangeInfoList *getMovieRangeInfo() const {
+ return &_movieRangeInfo;
+ }
-
};
} // End of namespace Titanic