Interface for a video player. More...
#include <ivideo_player.h>
Public Member Functions | |
virtual | ~IVideoPlayer ()=default |
Destructor. | |
virtual bool | setup (SDL_Renderer *renderer, const std::string &path, int width, int height)=0 |
Sets up the video player. | |
virtual void | play ()=0 |
Starts video playback. | |
virtual void | stop ()=0 |
Stops the video playback. | |
virtual void | update ()=0 |
Updates the video state. | |
virtual SDL_Texture * | getTexture () const =0 |
Retrieves the current video texture. | |
virtual bool | isPlaying () const =0 |
Checks if the video is currently playing. | |
virtual void | setVolume (float volume)=0 |
Sets the volume for the video's audio track. | |
virtual void | setMute (bool mute)=0 |
Sets the mute state for the video's audio track. | |
Interface for a video player.
This abstract class defines the necessary methods for any video player implementation. It ensures that any concrete class provides functionality to load, play, stop, update, and retrieve video textures along with the playing state. It also includes methods for audio control.
|
virtualdefault |
Destructor.
Virtual destructor to ensure derived class destructors are called correctly.
|
pure virtual |
Retrieves the current video texture.
Returns the SDL_Texture representing the current frame of the video.
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Checks if the video is currently playing.
Evaluates whether the video player is actively playing the video.
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Starts video playback.
Initiates the video playback. The video player should begin rendering as soon as play is called.
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Sets the mute state for the video's audio track.
mute | True to mute the audio, false to unmute. |
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Sets up the video player.
Configures the video player with the given renderer, video file path, and display dimensions.
renderer | Pointer to an SDL_Renderer used for rendering. |
path | File path of the video to be played. |
width | Desired width of the video. |
height | Desired height of the video. |
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Sets the volume for the video's audio track.
volume | The desired volume, typically a float between 0.0 (silent) and 1.0 (full volume). |
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Stops the video playback.
Halts any video activity and can reset player states if necessary.
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.
|
pure virtual |
Updates the video state.
Handles the periodic updates for the video player, such as frame progression. Should be called in the game/render loop.
Implemented in DummyVideoPlayer, FFmpegPlayer, and VlcVideoPlayer.