OpenShot Library | libopenshot  0.3.3
PlayerBase.h
Go to the documentation of this file.
1 
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 {
27  {
32  };
33 
41  class PlayerBase
42  {
43  protected:
44  float speed;
45  float volume;
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
openshot::PlayerBase::Position
virtual int64_t Position()=0
Get the current frame number being played.
openshot::PLAYBACK_PLAY
@ PLAYBACK_PLAY
Play the video normally.
Definition: PlayerBase.h:28
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::PlayerBase::Volume
virtual float Volume()=0
Get the Volume.
Definition: PlayerBase.cpp:58
openshot::PlayerBase::Speed
virtual float Speed()=0
Get the Playback speed.
Definition: PlayerBase.cpp:33
openshot::PlayerBase::Mode
virtual PlaybackMode Mode()=0
Get the current mode.
openshot::PlayerBase::Reader
virtual openshot::ReaderBase * Reader()=0
Get the current reader, such as a FFmpegReader.
Definition: PlayerBase.cpp:48
openshot::PlayerBase::Seek
virtual void Seek(int64_t new_frame)=0
Seek to a specific frame in the player.
openshot::PLAYBACK_STOPPED
@ PLAYBACK_STOPPED
Stop playing the video (clear cache, done with player)
Definition: PlayerBase.h:31
openshot::PlayerBase::volume
float volume
Definition: PlayerBase.h:45
openshot::PlayerBase::Pause
virtual void Pause()=0
Pause the video.
Definition: PlayerBase.cpp:28
openshot::PlayerBase::Stop
virtual void Stop()=0
Stop the video player and clear the cached frames.
Definition: PlayerBase.cpp:43
openshot::PlaybackMode
PlaybackMode
This enumeration determines the mode of the video player (i.e. playing, paused, etc....
Definition: PlayerBase.h:26
openshot::PlayerBase::Play
virtual void Play()=0
Play the video.
Definition: PlayerBase.cpp:23
openshot::PlayerBase::speed
float speed
Definition: PlayerBase.h:44
ReaderBase.h
Header file for ReaderBase class.
openshot::PlayerBase::~PlayerBase
virtual ~PlayerBase()=default
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::PlayerBase
This is the base class of all Players in libopenshot.
Definition: PlayerBase.h:41
openshot::ReaderBase
This abstract class is the base class, used by all readers in libopenshot.
Definition: ReaderBase.h:75
openshot::PlayerBase::mode
PlaybackMode mode
Definition: PlayerBase.h:47
openshot::PlayerBase::Loading
virtual void Loading()=0
Display a loading animation.
Definition: PlayerBase.cpp:18
openshot::PlayerBase::reader
openshot::ReaderBase * reader
Definition: PlayerBase.h:46