OpenShot Library | libopenshot 0.2.7
PlayerBase.cpp
Go to the documentation of this file.
1/**
2 * @file
3 * @brief Source file for PlayerBase class
4 * @author Jonathan Thomas <jonathan@openshot.org>
5 *
6 * @ref License
7 */
8
9/* LICENSE
10 *
11 * Copyright (c) 2008-2019 OpenShot Studios, LLC
12 * <http://www.openshotstudios.com/>. This file is part of
13 * OpenShot Library (libopenshot), an open-source project dedicated to
14 * delivering high quality video editing and animation solutions to the
15 * world. For more information visit <http://www.openshot.org/>.
16 *
17 * OpenShot Library (libopenshot) is free software: you can redistribute it
18 * and/or modify it under the terms of the GNU Lesser General Public License
19 * as published by the Free Software Foundation, either version 3 of the
20 * License, or (at your option) any later version.
21 *
22 * OpenShot Library (libopenshot) is distributed in the hope that it will be
23 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public License
28 * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31#include "PlayerBase.h"
32
33using namespace openshot;
34
35// Display a loading animation
36void PlayerBase::Loading() {
38}
39
40// Play the video
43}
44
45// Pause the video
48}
49
50// Get the Playback speed
52 return speed;
53}
54
55// Set the Playback speed multiplier (1.0 = normal speed, <1.0 = slower, >1.0 faster)
56void PlayerBase::Speed(float new_speed) {
57 speed = new_speed;
58}
59
60// Stop the video player and clear the cached frames
63}
64
65// Get the current reader, such as a FFmpegReader
67 return reader;
68}
69
70// Set the current reader, such as a FFmpegReader
72 reader = new_reader;
73}
74
75// Get the Volume
77 return volume;
78}
79
80// Set the Volume multiplier (1.0 = normal volume, <1.0 = quieter, >1.0 louder)
81void PlayerBase::Volume(float new_volume) {
82 volume = new_volume;
83}
Header file for PlayerBase class.
virtual void Stop()=0
Stop the video player and clear the cached frames.
Definition: PlayerBase.cpp:61
virtual float Speed()=0
Get the Playback speed.
Definition: PlayerBase.cpp:51
virtual void Play()=0
Play the video.
Definition: PlayerBase.cpp:41
PlaybackMode mode
Definition: PlayerBase.h:65
virtual float Volume()=0
Get the Volume.
Definition: PlayerBase.cpp:76
virtual void Pause()=0
Pause the video.
Definition: PlayerBase.cpp:46
openshot::ReaderBase * reader
Definition: PlayerBase.h:64
virtual openshot::ReaderBase * Reader()=0
Get the current reader, such as a FFmpegReader.
Definition: PlayerBase.cpp:66
This abstract class is the base class, used by all readers in libopenshot.
Definition: ReaderBase.h:98
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:47
@ PLAYBACK_LOADING
Loading the video (display a loading animation)
Definition: PlayerBase.h:48
@ PLAYBACK_PAUSED
Pause the video (holding the last displayed frame)
Definition: PlayerBase.h:47
@ PLAYBACK_STOPPED
Stop playing the video (clear cache, done with player)
Definition: PlayerBase.h:49
@ PLAYBACK_PLAY
Play the video normally.
Definition: PlayerBase.h:46