OpenShot Library | libopenshot  0.4.0
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:
[legend]
Collaboration diagram for openshot::QtPlayer:
[legend]

Public Member Functions

void CloseAudioDevice ()
 Close audio device. More...
 
AudioDeviceList GetAudioDeviceNames ()
 Get Audio Devices from JUCE. More...
 
AudioDeviceInfo GetCurrentAudioDevice ()
 Get current audio device or last attempted. More...
 
double GetDefaultSampleRate ()
 Return the default audio sample rate (from the system) 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...
 
void SetTimelineSource (const std::string &json)
 Set the source JSON of an openshot::Timelime. 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 32 of file QtPlayer.h.

Constructor & Destructor Documentation

◆ QtPlayer() [1/2]

openshot::QtPlayer::QtPlayer ( )
explicit

Default constructor.

Definition at line 29 of file QtPlayer.cpp.

◆ QtPlayer() [2/2]

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

Definition at line 34 of file QtPlayer.cpp.

◆ ~QtPlayer()

openshot::QtPlayer::~QtPlayer ( )
virtual

Default destructor.

Definition at line 42 of file QtPlayer.cpp.

Member Function Documentation

◆ CloseAudioDevice()

void openshot::QtPlayer::CloseAudioDevice ( )

Close audio device.

Definition at line 50 of file QtPlayer.cpp.

◆ GetAudioDeviceNames()

AudioDeviceList openshot::QtPlayer::GetAudioDeviceNames ( )

Get Audio Devices from JUCE.

Get vector of audio device names & types.

Definition at line 75 of file QtPlayer.cpp.

◆ GetCurrentAudioDevice()

AudioDeviceInfo openshot::QtPlayer::GetCurrentAudioDevice ( )

Get current audio device or last attempted.

Definition at line 81 of file QtPlayer.cpp.

◆ GetDefaultSampleRate()

double openshot::QtPlayer::GetDefaultSampleRate ( )

Return the default audio sample rate (from the system)

Definition at line 66 of file QtPlayer.cpp.

◆ GetError()

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

Get Error (if any)

Definition at line 57 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 221 of file QtPlayer.cpp.

◆ Loading()

void openshot::QtPlayer::Loading ( )
virtual

Display a loading animation.

Implements openshot::PlayerBase.

Definition at line 144 of file QtPlayer.cpp.

◆ Mode()

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

Get the current mode.

Implements openshot::PlayerBase.

Definition at line 150 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Pause()

void openshot::QtPlayer::Pause ( )
virtual

Pause the video.

Implements openshot::PlayerBase.

Definition at line 155 of file QtPlayer.cpp.

Referenced by PlayerDemo::keyPressEvent().

◆ Play()

void openshot::QtPlayer::Play ( )
virtual

Play the video.

Implements openshot::PlayerBase.

Definition at line 131 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 161 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 210 of file QtPlayer.cpp.

Referenced by SetSource(), and SetTimelineSource().

◆ Reader() [2/2]

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

Set the current reader.

Implements openshot::PlayerBase.

Definition at line 200 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 166 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 215 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 99 of file QtPlayer.cpp.

◆ SetTimelineSource()

void openshot::QtPlayer::SetTimelineSource ( const std::string &  json)

Set the source JSON of an openshot::Timelime.

Definition at line 86 of file QtPlayer.cpp.

◆ Speed() [1/2]

float openshot::QtPlayer::Speed ( )
virtual

Get the Playback speed.

Implements openshot::PlayerBase.

Definition at line 226 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 231 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 181 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 241 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 246 of file QtPlayer.cpp.


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