ScummVM API documentation
Sword25::MoviePlayer Class Reference
Inheritance diagram for Sword25::MoviePlayer:
Sword25::Service

Public Member Functions

 MoviePlayer (Kernel *pKernel)
 
bool loadMovie (const Common::String &filename, uint z)
 
bool unloadMovie ()
 
bool play ()
 
bool pause ()
 
void update ()
 
bool isMovieLoaded ()
 
bool isPaused ()
 
float getScaleFactor ()
 
void setScaleFactor (float scaleFactor)
 
double getTime ()
 

Additional Inherited Members

- Protected Member Functions inherited from Sword25::Service
 Service (Kernel *pKernel)
 
KernelGetKernel () const
 

Member Function Documentation

◆ loadMovie()

bool Sword25::MoviePlayer::loadMovie ( const Common::String filename,
uint  z 
)

Loads a movie file

This method loads a movie file and prepares it for playback. There can be oly one movie file loaded at a time. If you already have loaded a movie file, it will be unloaded and, if necessary, stopped playing.

Parameters
FilenameThe filename of the movie file to be loaded
ZZ indicates the position of the film on the main graphics layer
Returns
Returns false if an error occurred while loading, otherwise true.

◆ unloadMovie()

bool Sword25::MoviePlayer::unloadMovie ( )

Unloads the currently loaded movie file.

Returns
Returns false if an error occurred while unloading, otherwise true.
Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ play()

bool Sword25::MoviePlayer::play ( )

Plays the loaded movie.

The film will be keeping the aspect ratio of the screen. If the film was previously paused with Pause(), then the film will resume playing.

Returns
Returns false if an error occurred while starting, otherwise true.
Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ pause()

bool Sword25::MoviePlayer::pause ( )

Pauses movie playback.

A paused movie can later be resumed by calling the Play() method again.

Returns
Returns false if an error occurred while pausing, otherwise true.
Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ update()

void Sword25::MoviePlayer::update ( )

This function must be called once per frame.

◆ isMovieLoaded()

bool Sword25::MoviePlayer::isMovieLoaded ( )

Returns whether a film is loaded for playback.

◆ isPaused()

bool Sword25::MoviePlayer::isPaused ( )

Returns whether the movie playback is paused.

Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ getScaleFactor()

float Sword25::MoviePlayer::getScaleFactor ( )

Returns the scaling factor for the loaded film.

When a movie is loaded, the scaling factor is automatically selected so that the film takes the maximum screen space, without the film being distorted.

Returns
Returns the scaling factor of the film.
Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ setScaleFactor()

void Sword25::MoviePlayer::setScaleFactor ( float  scaleFactor)

Sets the factor by which the loaded film is to be scaled.

Parameters
ScaleFactorThe desired scale factor.
Remarks
This method can only be called when IsMovieLoaded() returns true.

◆ getTime()

double Sword25::MoviePlayer::getTime ( )

Returns the current playing position in seconds.

Remarks
This method can only be called when IsMovieLoaded() returns true.

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