ScummVM API documentation
Grim::MoviePlayer Class Reference
Inheritance diagram for Grim::MoviePlayer:
Grim::QuickTimePlayer Grim::SmushPlayer

Public Member Functions

virtual bool play (const Common::String &filename, bool looping, int x, int y, bool start=true, bool showSubtitles=false)
 
virtual void stop ()
 
virtual void pause (bool p)
 
virtual bool isPlaying ()
 
virtual bool isUpdateNeeded ()
 
virtual Graphics::SurfacegetDstSurface ()
 
virtual const byte * getDstPalette ()
 
virtual int getX ()
 
virtual int getY ()
 
virtual int getFrame ()
 
virtual void clearUpdateNeeded ()
 
virtual int32 getMovieTime ()
 
void drawMovieSubtitle ()
 
void saveState (SaveGame *state)
 
void restoreState (SaveGame *state)
 

Protected Member Functions

virtual bool prepareFrame ()
 
virtual void handleFrame ()
 
virtual void postHandleFrame ()
 
virtual void init ()
 
virtual void deinit ()
 
virtual bool loadFile (const Common::String &filename)
 
virtual void save (SaveGame *state)
 
virtual void restore (SaveGame *state)
 

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
 
const byte * _internalPalette
 
byte * _externalPalette
 
int32 _frame
 
bool _updateNeeded
 
bool _showSubtitles
 
float _movieTime
 
int _channels
 
int _freq
 
bool _videoFinished
 
bool _videoPause
 
bool _videoLooping
 
bool _timerStarted
 
int _x
 
int _y
 

Member Function Documentation

◆ play()

virtual 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
filenamethe file to open
loopingtrue if we want the video to loop, false otherwise
xthe x-coordinate for the draw-position
ythe y-coordinate for the draw-position
See also
init
stop

◆ saveState()

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

Saves the state of the video to a savegame

Parameters
stateThe state to save to

◆ prepareFrame()

virtual bool Grim::MoviePlayer::prepareFrame ( )
protectedvirtual

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

Returns
false if a frame wasn't drawn to _externalBuffer, true otherwise.
See also
handleFrame

◆ handleFrame()

virtual void Grim::MoviePlayer::handleFrame ( )
inlineprotectedvirtual

Frame-handling function.

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

See also
prepareFrame
clearUpdateNeeded
isUpdateNeeded

◆ postHandleFrame()

virtual void Grim::MoviePlayer::postHandleFrame ( )
inlineprotectedvirtual

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

◆ init()

virtual void Grim::MoviePlayer::init ( )
protectedvirtual

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

◆ deinit()

virtual void Grim::MoviePlayer::deinit ( )
protectedvirtual

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

See also
init

◆ loadFile()

virtual bool Grim::MoviePlayer::loadFile ( const Common::String filename)
protectedvirtual

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
filenameThe filename to be handled.

◆ save()

virtual void Grim::MoviePlayer::save ( SaveGame state)
inlineprotectedvirtual

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
stateThe state to save to

◆ restore()

virtual void Grim::MoviePlayer::restore ( SaveGame state)
inlineprotectedvirtual

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
stateThe state to restore from

Reimplemented in Grim::SmushPlayer.


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