ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <movie.h>

Inheritance diagram for Grim::MoviePlayer:
Collaboration diagram for Grim::MoviePlayer:

List of all members.

Public Member Functions

 MoviePlayer ()
virtual ~MoviePlayer ()
virtual bool play (const Common::String &filename, bool looping, int x, int y, bool start=true, bool showSubtitles=false)
 Loads a file for playing, and starts playing it.
virtual void stop ()
virtual void pause (bool p)
virtual bool isPlaying ()
virtual bool isUpdateNeeded ()
virtual Graphics::SurfacegetDstSurface ()
virtual int getX ()
virtual int getY ()
virtual int getFrame ()
virtual void clearUpdateNeeded ()
virtual int32 getMovieTime ()
void saveState (SaveGame *state)
 Saves the state of the video to a savegame.
void restoreState (SaveGame *state)

Protected Member Functions

virtual bool prepareFrame ()
 Handles basic stuff per frame, like copying the latest frame to _externalBuffer, and updating the frame-counters.
virtual void handleFrame ()
 Frame-handling function.
virtual void postHandleFrame ()
 Frame-handling function.
virtual void init ()
 Initialization of buffers This function is called by the default-implementation of play, and is expected to get the necessary datastructures set up for playback, as well as initializing the callback.
virtual void deinit ()
 Closes any file/codec-handles, and resets the movie-state to a blank MoviePlayer.
virtual bool loadFile (const Common::String &filename)
 Loads a file for playback, any additional setup is not done here, but in the play-function.
virtual void save (SaveGame *state)
 Saves subclass related state of the video to a savegame The base implementation of this does nothing, but it can be overridden by subclasses.
virtual void restore (SaveGame *state)
 Restores subclass related state of the video to a savegame The base implementation of this does nothing, but it can be overridden by subclasses.

Static Protected Member Functions

static void timerCallback (void *ptr)

Protected Attributes

Common::String _fname
Common::Mutex _frameMutex
Video::VideoDecoder_videoDecoder
const Graphics::Surface_internalSurface
Graphics::Surface_externalSurface
int32 _frame
bool _updateNeeded
bool _showSubtitles
float _movieTime
int _channels
int _freq
bool _videoFinished
bool _videoPause
bool _videoLooping
bool _timerStarted
int _x
int _y

Detailed Description

Definition at line 35 of file movie.h.


Constructor & Destructor Documentation

Grim::MoviePlayer::MoviePlayer (  ) 

Definition at line 37 of file movie.cpp.

Grim::MoviePlayer::~MoviePlayer (  )  [virtual]

Definition at line 55 of file movie.cpp.


Member Function Documentation

virtual void Grim::MoviePlayer::clearUpdateNeeded (  )  [inline, virtual]

Definition at line 79 of file movie.h.

void Grim::MoviePlayer::deinit (  )  [protected, virtual]

Closes any file/codec-handles, and resets the movie-state to a blank MoviePlayer.

See also:
init

Reimplemented in Grim::NullPlayer.

Definition at line 138 of file movie.cpp.

Graphics::Surface * Grim::MoviePlayer::getDstSurface (  )  [virtual]

Definition at line 117 of file movie.cpp.

virtual int Grim::MoviePlayer::getFrame (  )  [inline, virtual]

Definition at line 78 of file movie.h.

virtual int32 Grim::MoviePlayer::getMovieTime (  )  [inline, virtual]

Definition at line 80 of file movie.h.

virtual int Grim::MoviePlayer::getX (  )  [inline, virtual]

Definition at line 76 of file movie.h.

virtual int Grim::MoviePlayer::getY (  )  [inline, virtual]

Definition at line 77 of file movie.h.

virtual void Grim::MoviePlayer::handleFrame (  )  [inline, protected, virtual]

Frame-handling function.

Perform any codec-specific per-frame operations before the decoder decodes the next frame.

See also:
prepareFrame
clearUpdateNeeded
isUpdateNeeded

Reimplemented in Grim::NullPlayer, and Grim::SmushPlayer.

Definition at line 110 of file movie.h.

void Grim::MoviePlayer::init (  )  [protected, virtual]

Initialization of buffers This function is called by the default-implementation of play, and is expected to get the necessary datastructures set up for playback, as well as initializing the callback.

See also:
deinit

Reimplemented in Grim::NullPlayer, and Grim::SmushPlayer.

Definition at line 126 of file movie.cpp.

virtual bool Grim::MoviePlayer::isPlaying (  )  [inline, virtual]

Definition at line 73 of file movie.h.

virtual bool Grim::MoviePlayer::isUpdateNeeded (  )  [inline, virtual]

Definition at line 74 of file movie.h.

bool Grim::MoviePlayer::loadFile ( const Common::String filename  )  [protected, virtual]

Loads a file for playback, any additional setup is not done here, but in the play-function.

This function is supposed to handle any specifics w.r.t. files vs containers (i.e. load from LAB vs load from file).

See also:
play
Parameters:
filename The filename to be handled.

Reimplemented in Grim::NullPlayer, Grim::QuickTimePlayer, and Grim::SmushPlayer.

Definition at line 180 of file movie.cpp.

void Grim::MoviePlayer::pause ( bool  p  )  [virtual]

Reimplemented in Grim::NullPlayer.

Definition at line 66 of file movie.cpp.

bool Grim::MoviePlayer::play ( const Common::String filename,
bool  looping,
int  x,
int  y,
bool  start = true,
bool  showSubtitles = false 
) [virtual]

Loads a file for playing, and starts playing it.

the default implementation calls init()/deinit() to handle any necessary setup.

Parameters:
filename the file to open
looping true if we want the video to loop, false otherwise
x the x-coordinate for the draw-position
y the y-coordinate for the draw-position
See also:
init
stop

Reimplemented in Grim::NullPlayer.

Definition at line 153 of file movie.cpp.

virtual void Grim::MoviePlayer::postHandleFrame (  )  [inline, protected, virtual]

Frame-handling function.

Perform any codec-specific per-frame operations after prepareFrame has been run, this function is called whenever prepareFrame returns true.

See also:
prepareFrame
clearUpdateNeeded
isUpdateNeeded

Reimplemented in Grim::SmushPlayer.

Definition at line 122 of file movie.h.

bool Grim::MoviePlayer::prepareFrame (  )  [protected, virtual]

Handles basic stuff per frame, like copying the latest frame to _externalBuffer, and updating the frame-counters.

Returns:
false if a frame wasnt drawn to _externalBuffer, true otherwise.
See also:
handleFrame

Reimplemented in Grim::NullPlayer.

Definition at line 85 of file movie.cpp.

virtual void Grim::MoviePlayer::restore ( SaveGame state  )  [inline, protected, virtual]

Restores subclass related state of the video to a savegame The base implementation of this does nothing, but it can be overridden by subclasses.

Parameters:
state The state to restore from

Reimplemented in Grim::SmushPlayer.

Definition at line 168 of file movie.h.

void Grim::MoviePlayer::restoreState ( SaveGame state  ) 

Reimplemented in Grim::NullPlayer.

Definition at line 203 of file movie.cpp.

virtual void Grim::MoviePlayer::save ( SaveGame state  )  [inline, protected, virtual]

Saves subclass related state of the video to a savegame The base implementation of this does nothing, but it can be overridden by subclasses.

Parameters:
state The state to save to

Definition at line 159 of file movie.h.

void Grim::MoviePlayer::saveState ( SaveGame state  ) 

Saves the state of the video to a savegame.

Parameters:
state The state to save to

Reimplemented in Grim::NullPlayer.

Definition at line 184 of file movie.cpp.

void Grim::MoviePlayer::stop (  )  [virtual]

Reimplemented in Grim::NullPlayer.

Definition at line 72 of file movie.cpp.

void Grim::MoviePlayer::timerCallback ( void *  ptr  )  [static, protected]

Reimplemented in Grim::NullPlayer.

Definition at line 78 of file movie.cpp.


Member Data Documentation

Definition at line 46 of file movie.h.

Definition at line 41 of file movie.h.

Definition at line 37 of file movie.h.

Definition at line 42 of file movie.h.

Definition at line 38 of file movie.h.

int Grim::MoviePlayer::_freq [protected]

Definition at line 47 of file movie.h.

Definition at line 40 of file movie.h.

float Grim::MoviePlayer::_movieTime [protected]

Definition at line 45 of file movie.h.

Definition at line 44 of file movie.h.

Definition at line 51 of file movie.h.

Definition at line 43 of file movie.h.

Definition at line 39 of file movie.h.

Definition at line 48 of file movie.h.

Definition at line 50 of file movie.h.

Definition at line 49 of file movie.h.

int Grim::MoviePlayer::_x [protected]

Definition at line 52 of file movie.h.

int Grim::MoviePlayer::_y [protected]

Definition at line 52 of file movie.h.


The documentation for this class was generated from the following files:


Generated on Sat Jul 13 2019 05:04:12 for ResidualVM by doxygen 1.7.1
curved edge   curved edge