OpenShot Library | libopenshot  0.2.5
Public Member Functions | List of all members
openshot::QtPlayer Class Reference

This class is used to playback a video from a reader. More...

#include <QtPlayer.h>

Inheritance diagram for openshot::QtPlayer:
openshot::PlayerBase

Public Member Functions

void CloseAudioDevice ()
 Close audio device. More...
 
std::vector< openshot::AudioDeviceInfoGetAudioDeviceNames ()
 Get Audio Devices from JUCE. More...
 
std::string GetError ()
 Get Error (if any) More...
 
int64_t GetRendererQObject ()
 Get the Renderer pointer address (for Python to cast back into a QObject) More...
 
void Loading ()
 Display a loading animation. More...
 
openshot::PlaybackMode Mode ()
 Get the current mode. More...
 
void Pause ()
 Pause the video. More...
 
void Play ()
 Play the video. More...
 
int64_t Position ()
 Get the current frame number being played. More...
 
 QtPlayer ()
 Default constructor. More...
 
 QtPlayer (openshot::RendererBase *rb)
 
openshot::ReaderBaseReader ()
 Get the current reader, such as a FFmpegReader. More...
 
void Reader (openshot::ReaderBase *new_reader)
 Set the current reader. More...
 
void Seek (int64_t new_frame)
 Seek to a specific frame in the player. More...
 
void SetQWidget (int64_t qwidget_address)
 
void SetSource (const std::string &source)
 Set the source URL/path of this player (which will create an internal Reader) More...
 
float Speed ()
 Get the Playback speed. More...
 
void Speed (float new_speed)
 Set the Playback speed (1.0 = normal speed, <1.0 = slower, >1.0 faster) More...
 
void Stop ()
 Stop the video player and clear the cached frames. More...
 
float Volume ()
 Get the Volume. More...
 
void Volume (float new_volume)
 Set the Volume (1.0 = normal volume, <1.0 = quieter, >1.0 louder) More...
 
virtual ~QtPlayer ()
 Default destructor. More...
 
- Public Member Functions inherited from openshot::PlayerBase
virtual ~PlayerBase ()=default
 

Additional Inherited Members

- Protected Attributes inherited from openshot::PlayerBase
PlaybackMode mode
 
openshot::ReaderBasereader
 
float speed
 
float volume
 

Detailed Description

This class is used to playback a video from a reader.

Definition at line 47 of file QtPlayer.h.

Constructor & Destructor Documentation

◆ QtPlayer() [1/2]

openshot::QtPlayer::QtPlayer ( )
explicit

Default constructor.

Definition at line 42 of file QtPlayer.cpp.

◆ QtPlayer() [2/2]

openshot::QtPlayer::QtPlayer ( openshot::RendererBase rb)
explicit

Definition at line 47 of file QtPlayer.cpp.

◆ ~QtPlayer()

openshot::QtPlayer::~QtPlayer ( )
virtual

Default destructor.

Definition at line 55 of file QtPlayer.cpp.

Member Function Documentation

◆ CloseAudioDevice()

void openshot::QtPlayer::CloseAudioDevice ( )

Close audio device.

Definition at line 63 of file QtPlayer.cpp.

◆ GetAudioDeviceNames()

std::vector< openshot::AudioDeviceInfo > openshot::QtPlayer::GetAudioDeviceNames ( )

Get Audio Devices from JUCE.

Definition at line 80 of file QtPlayer.cpp.

◆ GetError()

std::string openshot::QtPlayer::GetError ( )

Get Error (if any)

Definition at line 70 of file QtPlayer.cpp.

◆ GetRendererQObject()

int64_t openshot::QtPlayer::GetRendererQObject ( )

Get the Renderer pointer address (for Python to cast back into a QObject)

Definition at line 197 of file QtPlayer.cpp.

◆ Loading()

void openshot::QtPlayer::Loading ( )
virtual

Display a loading animation.

Implements openshot::PlayerBase.

Definition at line 117 of file QtPlayer.cpp.

◆ Mode()

openshot::PlaybackMode openshot::QtPlayer::Mode ( )
virtual

Get the current mode.

Implements openshot::PlayerBase.

Definition at line 123 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Pause()

void openshot::QtPlayer::Pause ( )
virtual

Pause the video.

Implements openshot::PlayerBase.

Definition at line 128 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Play()

void openshot::QtPlayer::Play ( )
virtual

Play the video.

Implements openshot::PlayerBase.

Definition at line 104 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Position()

int64_t openshot::QtPlayer::Position ( )
virtual

Get the current frame number being played.

Implements openshot::PlayerBase.

Definition at line 134 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Reader() [1/2]

openshot::ReaderBase * openshot::QtPlayer::Reader ( )
virtual

Get the current reader, such as a FFmpegReader.

Implements openshot::PlayerBase.

Definition at line 186 of file QtPlayer.cpp.

Referenced by SetSource().

◆ Reader() [2/2]

void openshot::QtPlayer::Reader ( openshot::ReaderBase new_reader)
virtual

Set the current reader.

Implements openshot::PlayerBase.

Definition at line 176 of file QtPlayer.cpp.

◆ Seek()

void openshot::QtPlayer::Seek ( int64_t  new_frame)
virtual

Seek to a specific frame in the player.

Implements openshot::PlayerBase.

Definition at line 139 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ SetQWidget()

void openshot::QtPlayer::SetQWidget ( int64_t  qwidget_address)

Set the QWidget which will be used as the display (note: QLabel works well). This does not take a normal pointer, but rather a LONG pointer id (and it re-casts the QWidget pointer inside libopenshot). This is required due to SIP and SWIG incompatibility in the Python bindings.

Definition at line 191 of file QtPlayer.cpp.

◆ SetSource()

void openshot::QtPlayer::SetSource ( const std::string &  source)

Set the source URL/path of this player (which will create an internal Reader)

Definition at line 88 of file QtPlayer.cpp.

◆ Speed() [1/2]

float openshot::QtPlayer::Speed ( )
virtual

Get the Playback speed.

Implements openshot::PlayerBase.

Definition at line 202 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent(), Pause(), and Play().

◆ Speed() [2/2]

void openshot::QtPlayer::Speed ( float  new_speed)
virtual

Set the Playback speed (1.0 = normal speed, <1.0 = slower, >1.0 faster)

Implements openshot::PlayerBase.

Definition at line 207 of file QtPlayer.cpp.

◆ Stop()

void openshot::QtPlayer::Stop ( )
virtual

Stop the video player and clear the cached frames.

Implements openshot::PlayerBase.

Definition at line 157 of file QtPlayer.cpp.

Referenced by PlayerDemo::closeEvent(), PlayerDemo::keyPressEvent(), and ~QtPlayer().

◆ Volume() [1/2]

float openshot::QtPlayer::Volume ( )
virtual

Get the Volume.

Implements openshot::PlayerBase.

Definition at line 216 of file QtPlayer.cpp.

◆ Volume() [2/2]

void openshot::QtPlayer::Volume ( float  new_volume)
virtual

Set the Volume (1.0 = normal volume, <1.0 = quieter, >1.0 louder)

Implements openshot::PlayerBase.

Definition at line 221 of file QtPlayer.cpp.


The documentation for this class was generated from the following files: