diff options
author | Matthew Hoops | 2010-05-20 18:38:06 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-05-20 18:38:06 +0000 |
commit | 2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e (patch) | |
tree | 415ceedd9e1e46b743edc1155549252ef1773b61 /graphics/video/video_decoder.h | |
parent | f76f64774aa5c7d9669196c0258767d1e9f43cfb (diff) | |
download | scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.tar.gz scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.tar.bz2 scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.zip |
Add a pause level system to VideoDecoder (blatantly ripped off from Engine) and adapt Mohawk to it.
svn-id: r49120
Diffstat (limited to 'graphics/video/video_decoder.h')
-rw-r--r-- | graphics/video/video_decoder.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index 2ab8306d76..d96545d2c1 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -128,11 +128,6 @@ public: virtual bool hasDirtyPalette() const { return false; } /** - * Add the time the video has been paused to maintain sync - */ - virtual void addPauseTime(uint32 ms) { _startTime += ms; } - - /** * Returns if the video is finished or not */ virtual bool endOfVideo() const; @@ -147,14 +142,47 @@ public: */ virtual uint32 getTimeToNextFrame() const = 0; + /** + * Pause or resume the video. This should stop/resume any audio playback + * and other stuff. The initial pause time is kept so that any timing + * variables can be updated appropriately. + * + * This is a convenience tracker which automatically keeps track on how + * often the video has been paused, ensuring that after pausing an video + * e.g. twice, it has to be unpaused twice before actuallying resuming. + * + * @param pause true to pause the video, false to resume it + */ + void pauseVideo(bool pause); + + /** + * Return whether the video is currently paused or not. + */ + bool isPaused() const { return _pauseLevel != 0; } + protected: /** * Resets _curFrame and _startTime. Should be called from every close() function. */ void reset(); + /** + * Actual implementation of pause by subclasses. See pause() + * for details. + */ + virtual void pauseVideoIntern(bool pause) {} + + /** + * Add the time the video has been paused to maintain sync + */ + virtual void addPauseTime(uint32 ms) { _startTime += ms; } + int32 _curFrame; uint32 _startTime; + +private: + uint32 _pauseLevel; + uint32 _pauseStartTime; }; /** |