coastline
0.0.4
Loading...
Searching...
No Matches
src
sdl
videoplayer.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
filesystem
>
4
#include <
memory
>
5
#include <
optional
>
6
7
namespace
coastline
{
8
9
class
SceneRenderer
;
10
class
RenderTexture
;
11
13
class
VideoPlayer
{
14
public
:
21
static
std::unique_ptr<VideoPlayer>
Open
(
SceneRenderer
&renderer,
22
const
std::filesystem::path
&path);
24
~VideoPlayer
();
26
VideoPlayer
(
const
VideoPlayer
&) =
delete
;
28
VideoPlayer
&
operator=
(
const
VideoPlayer
&) =
delete
;
35
bool
Update
(
double
seconds,
float
volume);
42
std::optional<double>
Seek
(
double
seconds);
47
void
SetPaused
(
bool
paused);
49
double
Duration
()
const
;
51
const
RenderTexture
*
Texture
()
const
;
52
53
private
:
54
struct
State;
55
explicit
VideoPlayer
(
std::unique_ptr<State>
state);
56
std::unique_ptr<State>
m_state;
57
};
58
59
}
// namespace coastline
coastline::RenderTexture
A texture of the renderer for flat pictures and text.
Definition
scenerenderer.h:333
coastline::SceneRenderer
The renderer of a frame.
Definition
scenerenderer.h:467
coastline::VideoPlayer::~VideoPlayer
~VideoPlayer()
Release decoder, texture, and audio resources.
coastline::VideoPlayer::Texture
const RenderTexture * Texture() const
coastline::VideoPlayer::Duration
double Duration() const
coastline::VideoPlayer::Open
static std::unique_ptr< VideoPlayer > Open(SceneRenderer &renderer, const std::filesystem::path &path)
Open a local movie without starting its clock.
coastline::VideoPlayer::Seek
std::optional< double > Seek(double seconds)
Seek to a movie position and discard buffered video and audio.
coastline::VideoPlayer::Update
bool Update(double seconds, float volume)
Decode through elapsed movie time and update audio gain.
coastline::VideoPlayer::SetPaused
void SetPaused(bool paused)
Pause or resume audio and change the current frame to dim greyscale while paused.
coastline::VideoPlayer::operator=
VideoPlayer & operator=(const VideoPlayer &)=delete
Prevent assigning decoder resources.
coastline::VideoPlayer::VideoPlayer
VideoPlayer(const VideoPlayer &)=delete
Prevent copying decoder resources.
filesystem
memory
coastline
Definition
assetimport.h:11
optional
std::filesystem::path
std::unique_ptr
Generated by
1.15.0