OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
PlayerBase.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2019 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_PLAYER_BASE_H
14
#define OPENSHOT_PLAYER_BASE_H
15
16
#include <iostream>
17
#include "
ReaderBase.h
"
18
19
namespace
openshot
20
{
26
enum
PlaybackMode
27
{
28
PLAYBACK_PLAY
,
29
PLAYBACK_PAUSED
,
30
PLAYBACK_LOADING
,
31
PLAYBACK_STOPPED
,
32
};
33
41
class
PlayerBase
42
{
43
protected
:
44
float
speed
;
45
float
volume
;
46
openshot::ReaderBase
*
reader
;
47
PlaybackMode
mode
;
48
49
public
:
50
52
virtual
void
Loading
() = 0;
53
55
virtual
PlaybackMode
Mode
() = 0;
56
58
virtual
void
Play
() = 0;
59
61
virtual
void
Pause
() = 0;
62
64
virtual
int64_t
Position
() = 0;
65
67
virtual
void
Seek
(int64_t new_frame) = 0;
68
70
virtual
float
Speed
() = 0;
71
73
virtual
void
Speed
(
float
new_speed) = 0;
74
76
virtual
void
Stop
() = 0;
77
79
virtual
openshot::ReaderBase
*
Reader
() = 0;
80
82
virtual
void
Reader
(
openshot::ReaderBase
*new_reader) = 0;
83
85
virtual
float
Volume
() = 0;
86
88
virtual
void
Volume
(
float
new_volume) = 0;
89
90
virtual
~PlayerBase
() =
default
;
91
};
92
93
}
94
95
#endif
ReaderBase.h
Header file for ReaderBase class.
openshot::PlayerBase
This is the base class of all Players in libopenshot.
Definition
PlayerBase.h:42
openshot::PlayerBase::Stop
virtual void Stop()=0
Stop the video player and clear the cached frames.
Definition
PlayerBase.cpp:43
openshot::PlayerBase::Speed
virtual float Speed()=0
Get the Playback speed.
Definition
PlayerBase.cpp:33
openshot::PlayerBase::volume
float volume
Definition
PlayerBase.h:45
openshot::PlayerBase::Play
virtual void Play()=0
Play the video.
Definition
PlayerBase.cpp:23
openshot::PlayerBase::mode
PlaybackMode mode
Definition
PlayerBase.h:47
openshot::PlayerBase::Volume
virtual float Volume()=0
Get the Volume.
Definition
PlayerBase.cpp:58
openshot::PlayerBase::Pause
virtual void Pause()=0
Pause the video.
Definition
PlayerBase.cpp:28
openshot::PlayerBase::~PlayerBase
virtual ~PlayerBase()=default
openshot::PlayerBase::reader
openshot::ReaderBase * reader
Definition
PlayerBase.h:46
openshot::PlayerBase::Position
virtual int64_t Position()=0
Get the current frame number being played.
openshot::PlayerBase::speed
float speed
Definition
PlayerBase.h:44
openshot::PlayerBase::Seek
virtual void Seek(int64_t new_frame)=0
Seek to a specific frame in the player.
openshot::PlayerBase::Mode
virtual PlaybackMode Mode()=0
Get the current mode.
openshot::PlayerBase::Loading
virtual void Loading()=0
Display a loading animation.
Definition
PlayerBase.cpp:18
openshot::PlayerBase::Reader
virtual openshot::ReaderBase * Reader()=0
Get the current reader, such as a FFmpegReader.
Definition
PlayerBase.cpp:48
openshot::ReaderBase
This abstract class is the base class, used by all readers in libopenshot.
Definition
ReaderBase.h:76
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
openshot::PlaybackMode
PlaybackMode
This enumeration determines the mode of the video player (i.e. playing, paused, etc....
Definition
PlayerBase.h:27
openshot::PLAYBACK_LOADING
@ PLAYBACK_LOADING
Loading the video (display a loading animation).
Definition
PlayerBase.h:30
openshot::PLAYBACK_PAUSED
@ PLAYBACK_PAUSED
Pause the video (holding the last displayed frame).
Definition
PlayerBase.h:29
openshot::PLAYBACK_STOPPED
@ PLAYBACK_STOPPED
Stop playing the video (clear cache, done with player).
Definition
PlayerBase.h:31
openshot::PLAYBACK_PLAY
@ PLAYBACK_PLAY
Play the video normally.
Definition
PlayerBase.h:28
PlayerBase.h
Generated by
1.17.0