Loading...
Searching...
No Matches
PlayerBase.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_PLAYER_BASE_H
#define OPENSHOT_PLAYER_BASE_H
#include <iostream>
#include "ReaderBase.h"
namespace openshot
{
enum PlaybackMode
{
PLAYBACK_PLAY,
PLAYBACK_PAUSED,
PLAYBACK_LOADING,
PLAYBACK_STOPPED,
};
class PlayerBase
{
protected:
float speed;
float volume;
openshot::ReaderBase *reader;
PlaybackMode mode;
public:
virtual void Loading() = 0;
virtual PlaybackMode Mode() = 0;
virtual void Play() = 0;
virtual void Pause() = 0;
virtual int64_t Position() = 0;
virtual void Seek(int64_t new_frame) = 0;
virtual float Speed() = 0;
virtual void Speed(float new_speed) = 0;
virtual void Stop() = 0;
virtual openshot::ReaderBase* Reader() = 0;
virtual void Reader(openshot::ReaderBase *new_reader) = 0;
virtual float Volume() = 0;
virtual void Volume(float new_volume) = 0;
virtual ~PlayerBase() = default;
};
}
#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 Compressor.h:29
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