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