Small ReferenceCounted wrapper around an audio source.
More...
#include <AudioSource.h>
Small ReferenceCounted wrapper around an audio source.
Definition at line 16 of file AudioSource.h.
◆ AudioSource()
DLLEXPORT AudioSource::AudioSource |
( |
alure::Source |
sourcetowrap | ) |
|
|
protected |
◆ ~AudioSource()
Definition at line 10 of file AudioSource.cpp.
DLLEXPORT void Invoke(const std::function< void()> &function)
Runs function on the main thread before the next tick.
static DLLEXPORT Engine * Get()
◆ HasInternalSource()
DLLEXPORT bool Leviathan::AudioSource::HasInternalSource |
( |
| ) |
const |
|
inline |
Definition at line 32 of file AudioSource.h.
35 return Source.operator bool();
◆ IsPlaying()
DLLEXPORT bool Leviathan::AudioSource::IsPlaying |
( |
| ) |
const |
|
inline |
Also returns true if the source will start playing once a buffer is loaded.
Definition at line 59 of file AudioSource.h.
61 return Source.isPlayingOrPending();
◆ Pause()
DLLEXPORT void Leviathan::AudioSource::Pause |
( |
| ) |
|
|
inline |
◆ Play2D()
DLLEXPORT void AudioSource::Play2D |
( |
const Sound::AudioBuffer::pointer & |
buffer | ) |
|
Definition at line 28 of file AudioSource.cpp.
32 PlayedBuffer = buffer;
34 if(PlayedBuffer && PlayedBuffer->GetBuffer()) {
36 Source.set3DSpatialize(alure::Spatialize::Off);
37 Source.play(PlayedBuffer->GetBuffer());
static DLLEXPORT Engine * Get()
DLLEXPORT void AssertIfNotMainThread() const
Asserts if not called on the main thread.
◆ PlayWithDecoder()
Definition at line 44 of file AudioSource.cpp.
53 Source.play(data, chunksize, chunkstoqueue);
static DLLEXPORT Engine * Get()
DLLEXPORT void AssertIfNotMainThread() const
Asserts if not called on the main thread.
◆ REFERENCE_COUNTED_PTR_TYPE()
Leviathan::AudioSource::REFERENCE_COUNTED_PTR_TYPE |
( |
AudioSource |
| ) |
|
◆ Resume()
DLLEXPORT void Leviathan::AudioSource::Resume |
( |
| ) |
|
|
inline |
◆ SetGain()
DLLEXPORT void Leviathan::AudioSource::SetGain |
( |
float |
gain | ) |
|
|
inline |
◆ SetLooping()
DLLEXPORT void Leviathan::AudioSource::SetLooping |
( |
bool |
looping | ) |
|
|
inline |
Definition at line 75 of file AudioSource.h.
77 Source.setLooping(looping);
◆ SetVolume()
DLLEXPORT void Leviathan::AudioSource::SetVolume |
( |
float |
volume | ) |
|
|
inline |
- Parameters
-
volume | 0-1.f is normal range |
Definition at line 65 of file AudioSource.h.
67 Source.setGain(volume);
◆ Stop()
DLLEXPORT void Leviathan::AudioSource::Stop |
( |
| ) |
|
|
inline |
◆ ReferenceCounted
friend Leviathan::AudioSource::ReferenceCounted |
|
protected |
The documentation for this class was generated from the following files: