Loading...
Searching...
No Matches
openshot::QtPlayer Class Reference

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

`#include <QtPlayer.h>`

Inheritance diagram for openshot::QtPlayer:

## Public Member Functions

void | CloseAudioDevice ()
| Close audio device.
AudioDeviceList | GetAudioDeviceNames ()
| Get Audio Devices from JUCE.
AudioDeviceInfo | GetCurrentAudioDevice ()
| Get current audio device or last attempted.
double | GetDefaultSampleRate ()
| Return the default audio sample rate (from the system).
std::string | GetError ()
| Get Error (if any).
int64_t | GetRendererQObject ()
| Get the Renderer pointer address (for Python to cast back into a QObject).
void | Loading ()
| Display a loading animation.
openshot::PlaybackMode | Mode ()
| Get the current mode.
void | Pause ()
| Pause the video.
void | Play ()
| Play the video.
int64_t | Position ()
| Get the current frame number being played.
| QtPlayer ()
| Default constructor.
| QtPlayer (openshot::RendererBase *rb)
openshot::ReaderBase * | Reader ()
| Get the current reader, such as a FFmpegReader.
void | Reader (openshot::ReaderBase *new_reader)
| Set the current reader.
void | Seek (int64_t new_frame)
| Seek to a specific frame in the player.
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).
void | SetTimelineSource (const std::string &json)
| Set the source JSON of an openshot::Timelime.
float | Speed ()
| Get the Playback speed.
void | Speed (float new_speed)
| Set the Playback speed (1.0 = normal speed, <1.0 = slower, >1.0 faster).
void | Stop ()
| Stop the video player and clear the cached frames.
float | Volume ()
| Get the Volume.
void | Volume (float new_volume)
| Set the Volume (1.0 = normal volume, <1.0 = quieter, >1.0 louder).
virtual | ~QtPlayer ()
| Default destructor.
Public Member Functions inherited from openshot::PlayerBase
virtual | ~PlayerBase ()=default

## Additional Inherited Members

Protected Attributes inherited from openshot::PlayerBase
PlaybackMode | mode
openshot::ReaderBase * | reader
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.

Referenced by QtPlayer().

## 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.

## Pause()

void openshot::QtPlayer::Pause | ( |  | ) |

virtual

Pause the video.

Implements openshot::PlayerBase.

Definition at line 155 of file QtPlayer.cpp.

## Play()

void openshot::QtPlayer::Play | ( |  | ) |

virtual

Play the video.

Implements openshot::PlayerBase.

Definition at line 131 of file QtPlayer.cpp.

## 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.

## 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.

## 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 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 ~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:

- QtPlayer.h
- QtPlayer.cpp