diff options
Diffstat (limited to 'engines/mohawk/video.h')
-rw-r--r-- | engines/mohawk/video.h | 71 |
1 files changed, 8 insertions, 63 deletions
diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index 4298298b75..d8b3addc81 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -234,71 +234,16 @@ private: typedef Common::SharedPtr<VideoEntry> VideoEntryPtr; -/** - * A handle for manipulating a video - */ -class VideoHandle { - // The private members should be able to be manipulated by VideoManager - friend class VideoManager; - -public: - /** - * Default constructor - */ - VideoHandle() {} - - /** - * Copy constructor - */ - VideoHandle(const VideoHandle &handle); - - /** - * Is this handle pointing to a valid video entry? - */ - bool isValid() const { return _ptr && _ptr->isOpen(); } - - /** - * Convenience implicit cast to bool - */ - operator bool() const { return isValid(); } - - /** - * Simple equality operator - */ - bool operator==(const VideoHandle &other) const { return _ptr.get() == other._ptr.get(); } - - /** - * Simple inequality operator - */ - bool operator!=(const VideoHandle &other) const { return !(*this == other); } - - /** - * Convenience operator-> override to give direct access to the VideoEntry - */ - VideoEntryPtr operator->() const { return _ptr; } - -private: - /** - * Constructor for internal VideoManager use - */ - explicit VideoHandle(VideoEntryPtr ptr); - - /** - * The video entry this is associated with - */ - VideoEntryPtr _ptr; -}; - class VideoManager { public: VideoManager(MohawkEngine *vm); - ~VideoManager(); + virtual ~VideoManager(); // Generic movie functions void playMovieBlocking(const Common::String &filename, uint16 x = 0, uint16 y = 0, bool clearScreen = false); void playMovieBlockingCentered(const Common::String &filename, bool clearScreen = true); - VideoHandle playMovie(const Common::String &filename); - VideoHandle playMovie(uint16 id); + VideoEntryPtr playMovie(const Common::String &filename); + VideoEntryPtr playMovie(uint16 id); bool updateMovies(); void pauseVideos(); void resumeVideos(); @@ -306,12 +251,12 @@ public: bool isVideoPlaying(); // Handle functions - VideoHandle findVideoHandle(uint16 id); - VideoHandle findVideoHandle(const Common::String &fileName); - void waitUntilMovieEnds(VideoHandle handle); - void drawVideoFrame(VideoHandle handle, const Audio::Timestamp &time); + VideoEntryPtr findVideo(uint16 id); + VideoEntryPtr findVideo(const Common::String &fileName); + void waitUntilMovieEnds(const VideoEntryPtr &video); + void drawVideoFrame(const VideoEntryPtr &video, const Audio::Timestamp &time); -private: +protected: MohawkEngine *_vm; // Keep tabs on any videos playing |