![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
The main usable class for doing procedural audio. More...
#include <ProceduralSound.h>
Classes | |
struct | SoundProperties |
Public Member Functions | |
DLLEXPORT | ~ProceduralSoundData () |
DLLEXPORT int | ReadAudioData (void *output, int amount) |
DLLEXPORT bool | IsValid () const |
DLLEXPORT void | Detach () |
Permanently detaches this source from the callback. More... | |
REFERENCE_COUNTED_PTR_TYPE (ProceduralSoundData) | |
![]() | |
ReferenceCounted (const ReferenceCounted &other)=delete | |
ReferenceCounted & | operator= (const ReferenceCounted &other)=delete |
FORCE_INLINE void | AddRef () |
FORCE_INLINE void | Release () |
removes a reference and deletes the object if reference count reaches zero More... | |
int32_t | GetRefCount () const |
Returns the reference count. More... | |
![]() | |
DLLEXPORT | ThreadSafeGeneric () |
DLLEXPORT | ~ThreadSafeGeneric () |
FORCE_INLINE void | VerifyLock (RecursiveLock &guard) const |
FORCE_INLINE void | VerifyLock (Lock &lockit) const |
Public Attributes | |
const SoundProperties | Properties |
Properties for the ProceduralSoundStream to retrieve when needed. More... | |
Protected Member Functions | |
DLLEXPORT | ProceduralSoundData (std::function< int(void *, int)> datacallback, SoundProperties &&properties) |
![]() | |
DLLEXPORT | ReferenceCounted () |
virtual DLLEXPORT | ~ReferenceCounted () |
Protected Attributes | |
friend | ReferenceCounted |
std::atomic< bool > | Detached = false |
std::function< int(void *, int)> | DataCallback |
Called each time the underlying audio stream requests more data. More... | |
![]() | |
MutexType | ObjectsLock |
Additional Inherited Members | |
![]() | |
using | basepointer = boost::intrusive_ptr< ReferenceCounted > |
using | refcountedpointer = boost::intrusive_ptr< ReferenceCounted > |
![]() | |
template<class ActualType > | |
static boost::intrusive_ptr< ActualType > | WrapPtr (ActualType *ptr) |
Creates an intrusive_ptr from raw pointer. More... | |
template<class ActualType , class... Args> | |
static boost::intrusive_ptr< ActualType > | MakeShared (Args &&... args) |
Constructs a new instance and wraps it. More... | |
The main usable class for doing procedural audio.
This can be passed to SoundDevice to get a playing stream that plays this data
Definition at line 24 of file ProceduralSound.h.
|
protected |
Definition at line 6 of file ProceduralSound.cpp.
DLLEXPORT ProceduralSoundData::~ProceduralSoundData | ( | ) |
Definition at line 13 of file ProceduralSound.cpp.
DLLEXPORT void ProceduralSoundData::Detach | ( | ) |
Permanently detaches this source from the callback.
After this call finishes the callback won't be called again
Definition at line 15 of file ProceduralSound.cpp.
|
inline |
Definition at line 67 of file ProceduralSound.h.
|
inline |
Reads a section of data out of the audio stream by running the callback
output | Pointer to the buffer to put the decoded audio |
amount | Amount of data in bytes to ask the decoder to output. This is also the size of output |
Definition at line 60 of file ProceduralSound.h.
Leviathan::ProceduralSoundData::REFERENCE_COUNTED_PTR_TYPE | ( | ProceduralSoundData | ) |
|
protected |
Called each time the underlying audio stream requests more data.
Definition at line 89 of file ProceduralSound.h.
|
protected |
If set to true then this will no longer call the data callback. This can be used to safely let go of a procedural audio before destroying the whatever source that DataCallback uses
Definition at line 86 of file ProceduralSound.h.
const SoundProperties Leviathan::ProceduralSoundData::Properties |
Properties for the ProceduralSoundStream to retrieve when needed.
Definition at line 80 of file ProceduralSound.h.
|
protected |
Definition at line 46 of file ProceduralSound.h.