 |
Gorgon Game Engine
|
Go to the documentation of this file.
5 #include "../Containers/Wave.h"
6 #include "../Containers/Collection.h"
8 #include "../Geometry/Point3D.h"
11 namespace Gorgon {
namespace Audio {
128 bool playing =
false;
129 bool looping =
false;
155 location = {target, 0};
168 extern Containers::Collection<Controller>
Controllers;
void ReleaseData()
Releases the data being played by this controller.
Definition: Controllers.cpp:19
virtual ControllerType Type() const override
Returns the type of the controller.
Definition: Controllers.h:162
BasicController & Seek(float target)
Changes the point of playback to the given time in seconds.
Definition: Controllers.cpp:68
float GetDuration() const
Returns the duration of the audio buffer in seconds. This function will return 0 if data is not set.
Definition: Controllers.cpp:95
bool IsLooping() const
Whether the audio is being looped.
Definition: Controllers.cpp:117
BasicController & Pause()
Pauses the playback.
Definition: Controllers.cpp:56
This is the base class for all controllers.
Definition: Controllers.h:24
friend void AudioLoop()
Definition: Audio.cpp:76
Geometry::Point3D GetLocation() const
Definition: Controllers.h:158
virtual ControllerType Type() const =0
Returns the type of the controller.
BasicController & SeekTo(float target)
Changes the point of playback to the given time in fraction: 1 would be the end of buffer.
Definition: Controllers.cpp:74
BasicController & SetVolume(float volume)
Changes the volume of the playback.
Definition: Controllers.cpp:85
std::mutex ControllerMtx
Definition: Controllers.cpp:127
BasicController(const Containers::Wave &wavedata)
Filling constructor.
Definition: Controllers.h:49
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Containers::Collection< Controller > Controllers
Definition: Controllers.cpp:126
bool HasData() const
Returns whether this controller has data.
Definition: Controllers.h:54
std::vector< float > volume
Definition: Audio.cpp:35
Collection is a container for reference typed objects.
Definition: Collection.h:21
void SetData(const Containers::Wave &wavedata)
Sets the data to be played by this controller.
Definition: Controllers.cpp:26
float GetCurrentTime() const
Returns the current playback time in seconds.
Definition: Controllers.cpp:102
float GetVolume() const
Returns the current volume of the playback.
Definition: Controllers.cpp:91
ControllerType
Identifies controller types.
Definition: Controllers.h:16
float GetCurrentFraction() const
Returns the fraction of the audio that is played.
Definition: Controllers.cpp:106
BasicController & Loop()
Plays this sound.
Definition: Controllers.cpp:49
Controller()
Default constructor.
Definition: Controllers.cpp:5
const Containers::Wave * wavedata
Contains the data for this controller.
Definition: Controllers.h:119
This class represents a 2D point.
Definition: Point.h:32
BasicController & Play()
Plays this sound.
Definition: Controllers.cpp:33
friend void AudioLoop()
Definition: Audio.cpp:76
void Move(const Geometry::Pointf &target)
Definition: Controllers.h:154
bool IsPlaying() const
Whether the audio is being played right now.
Definition: Controllers.cpp:121
virtual void datachanged()
Override this function to detect changes in the wave data.
Definition: Controllers.h:123
void Move(const Geometry::Point3D &target)
Definition: Controllers.h:150
Basic controller, allows non-positional playback of data buffer.
Definition: Controllers.h:41
friend void AudioLoop()
Definition: Audio.cpp:76
BasicController()=default
Default constructor.
PositionalController()=default
Default constructor.
float GetLength() const
Returns the length of the wave data in seconds.
Definition: Wave.h:415
This class is a container for wave data.
Definition: Wave.h:17
Positional controller allows sounds to be played at a specific location.
Definition: Controllers.h:140
BasicController & Reset()
Resets the playback to the beginning of the buffer. This function will not stop the playback.
Definition: Controllers.cpp:62
bool IsFinished() const
Whether the audio is finished playing.
Definition: Controllers.cpp:113
PositionalController(const Containers::Wave &wavedata)
Filling constructor.
Definition: Controllers.h:148
virtual ControllerType Type() const override
Returns the type of the controller.
Definition: Controllers.h:115
virtual ~Controller()
Definition: Controllers.cpp:11