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