Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Burger::SoundManager::Buffer Class Reference

Audio data class. More...

Inheritance diagram for Burger::SoundManager::Buffer:
Inheritance graph
[legend]
Collaboration diagram for Burger::SoundManager::Buffer:
Collaboration graph
[legend]

Public Member Functions

const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
virtual ~Buffer ()
 Destructor.
 
uint_t Init (const void *pSoundFile, uintptr_t uLength)
 Attach sound data to buffer.
 
uint_t Init (const BufferDescription_t *pRawData)
 Attach sound data to buffer.
 
virtual void Shutdown (void)
 Release resources.
 
virtual uint_t Upload (SoundManager *pSoundManager)
 Upload audio data to hardware.
 
BufferDecoderGetBufferDescription (void)
 Returns the contained BufferDecoder_t state.
 
const BufferDecoderGetBufferDescription (void) const
 Returns the contained BufferDecoder_t state.
 
void SetSampleRate (uint_t uSampleRate)
 Sets the buffer's sample rate.
 
uint_t GetSampleRate (void) const
 Gets the buffer's sample rate.
 
void SetPan (uint_t uPan)
 Sets the buffer's stereo pan setting.
 
uint_t GetPan (void) const
 Gets the buffer's stereo pan setting.
 
void SetVolume (uint_t uVolume)
 Sets the buffer's default volume.
 
uint_t GetVolume (void) const
 Gets the buffer's default volume setting.
 
IDirectSoundBuffer8GetDirectSoundBuffer8 (void) const
 Gets the buffer's DirectSoundBuffer8.
 
uint_t IsUploaded (void) const
 
- Public Member Functions inherited from Burger::ReferenceCounter
const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 ReferenceCounter () noexcept
 Sets the reference count to zero.
 
virtual ~ReferenceCounter ()
 Destructor.
 
void AddRef (void) noexcept
 Increase the reference count by 1.
 
void Release (void) noexcept
 Decrease the reference count by 1.
 
- Public Member Functions inherited from Burger::Base
const charget_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Member Functions

static BufferNew (void)
 Create a new sound buffer.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 
- Static Public Attributes inherited from Burger::ReferenceCounter
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Protected Member Functions

 Buffer ()
 Constructor.
 

Protected Attributes

IDirectSoundBuffer8m_pDirectSoundBuffer8
 DirectSound8 buffer (Windows Only)
 
const voidm_pBufferData
 Buffer data.
 
uintptr_t m_uBufferSize
 Size of the buffer.
 
BufferDecoder m_Decoder
 Description of the sound data.
 
uint_t m_uPan
 Pan setting.
 
uint_t m_uVolume
 Volume for the buffer.
 

Private Member Functions

 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &)=delete
 
 Buffer (Buffer &&)=delete
 
Bufferoperator= (Buffer &&)=delete
 

Detailed Description

Audio data class.


Class containing audio data which may or may not be uploaded to audio hardware

See also
Voice or SoundManager

Constructor & Destructor Documentation

◆ Buffer() [1/3]

Burger::SoundManager::Buffer::Buffer ( const Buffer & )
privatedelete

◆ Buffer() [2/3]

Burger::SoundManager::Buffer::Buffer ( Buffer && )
privatedelete

◆ Buffer() [3/3]

Burger::SoundManager::Buffer::Buffer ( )
protected

Constructor.


Initialize the variables to defaults. Follow up with a call to Init(const void *,uintptr_t) or Init(const BufferDescription_t *).

See also
Shutdown()

◆ ~Buffer()

Burger::SoundManager::Buffer::~Buffer ( )
virtual

Destructor.


Releases all platform specific data and any buffers that were allocated by this class

See also
Shutdown()

Member Function Documentation

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::SoundManager::Buffer::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::Base.

Reimplemented in Burger::SoundBufferRez.

◆ GetBufferDescription() [1/2]

BufferDecoder_t * Burger::SoundManager::Buffer::GetBufferDescription ( void )
inline

Returns the contained BufferDecoder_t state.


Accessor for the BufferDecoder_t

Returns
Pointer to the contained BufferDecoder_t

◆ GetBufferDescription() [2/2]

const BufferDecoder_t * Burger::SoundManager::Buffer::GetBufferDescription ( void ) const
inline

Returns the contained BufferDecoder_t state.


Accessor for the BufferDecoder_t

Returns
Pointer to the contained BufferDecoder_t as const

◆ GetDirectSoundBuffer8()

IDirectSoundBuffer8 * Burger::SoundManager::Buffer::GetDirectSoundBuffer8 ( void ) const
inline

Gets the buffer's DirectSoundBuffer8.


If a buffer was allocated, returns the pointer to the attached DirectSoundBuffer8

Note
This is only available on Windows
Returns
The attached DirectSoundBuffer8

◆ GetPan()

uint_t Burger::SoundManager::Buffer::GetPan ( void ) const
inline

Gets the buffer's stereo pan setting.


Gets the default pan setting for the audio data.

Returns
The buffer's default pan setting
See also
SetPan(uint_t)

◆ GetSampleRate()

uint_t Burger::SoundManager::Buffer::GetSampleRate ( void ) const
inline

Gets the buffer's sample rate.


Gets the default sample rate for the audio data.

Returns
The buffer's default sample rate
See also
SetSampleRate(uint_t)

◆ GetVolume()

uint_t Burger::SoundManager::Buffer::GetVolume ( void ) const
inline

Gets the buffer's default volume setting.


Gets the default volume setting for the audio data.

Returns
The buffer's default volume setting
See also
SetVolume(uint_t)

◆ Init() [1/2]

uint_t BURGER_API Burger::SoundManager::Buffer::Init ( const BufferDescription_t * pRawData)

Attach sound data to buffer.


Pass a pointer to a structure that describes audio data in memory and set up this buffer to use this data.

Note
This function assumes the audio data is persistent

SampleRate, Pan and Volume are set to defaults in this function

Parameters
pRawDataPointer to the description of the audio data
Returns
Zero if no error, non-zero on error
See also
Init(const void *,uintptr_t)

◆ Init() [2/2]

uint_t BURGER_API Burger::SoundManager::Buffer::Init ( const void * pSoundFile,
uintptr_t uLength )

Attach sound data to buffer.


Pass a pointer to a sound file loaded into memory and this function will parse the file and determine how to play the file and sets up some defaults

SampleRate, Pan and Volume are set to defaults in this function

Note
This function assumes the audio data is persistent
Parameters
pSoundFilePointer to the sound file in memory
uLengthLength of the sound file in bytes
Returns
Zero if no error, non-zero on error
See also
Init(const BufferDescription_t *)

◆ IsUploaded()

uint_t Burger::SoundManager::Buffer::IsUploaded ( void ) const
inline

◆ New()

Burger::SoundManager::Buffer *BURGER_API Burger::SoundManager::Buffer::New ( void )
static

Create a new sound buffer.


◆ operator=() [1/2]

Buffer & Burger::SoundManager::Buffer::operator= ( Buffer && )
privatedelete

◆ operator=() [2/2]

Buffer & Burger::SoundManager::Buffer::operator= ( const Buffer & )
privatedelete

◆ SetPan()

void Burger::SoundManager::Buffer::SetPan ( uint_t uPan)
inline

Sets the buffer's stereo pan setting.


Sets the default pan setting for audio data playback.

Parameters
uPanNew default stereo pan setting
See also
GetPan(void) const

◆ SetSampleRate()

void Burger::SoundManager::Buffer::SetSampleRate ( uint_t uSampleRate)
inline

Sets the buffer's sample rate.


Sets the default sample rate to playback the audio data.

Parameters
uSampleRateNew sample rate
See also
GetSampleRate(void) const

◆ SetVolume()

void Burger::SoundManager::Buffer::SetVolume ( uint_t uVolume)
inline

Sets the buffer's default volume.


Sets the default volume setting for audio data playback.

Parameters
uVolumeNew default volume setting
See also
GetVolume(void) const

◆ Shutdown()

void Burger::SoundManager::Buffer::Shutdown ( void )
virtual

Release resources.


Releases all platform specific data and any ownership of audio data passed in.

See also
Init(const void *,uintptr_t) or Init(const void *,uintptr_t)

◆ Upload()

uint_t Burger::SoundManager::Buffer::Upload ( SoundManager * pSoundManager)
virtual

Upload audio data to hardware.


For some platforms, audio data must be uploaded to specific memory dedicated for audio playback. This function will determine if the memory has not been uploaded and if it hasn't, it will perform the upload.

Parameters
pSoundManagerPointer to the parent sound manager class
Returns
Zero if no error, non-zero on error

Reimplemented in Burger::SoundBufferRez.

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::SoundManager::Buffer::g_StaticRTTI
static

◆ m_Decoder

BufferDecoder Burger::SoundManager::Buffer::m_Decoder
protected

Description of the sound data.

◆ m_pBufferData

const void* Burger::SoundManager::Buffer::m_pBufferData
protected

Buffer data.

◆ m_pDirectSoundBuffer8

IDirectSoundBuffer8* Burger::SoundManager::Buffer::m_pDirectSoundBuffer8
protected

DirectSound8 buffer (Windows Only)

◆ m_uBufferSize

uintptr_t Burger::SoundManager::Buffer::m_uBufferSize
protected

Size of the buffer.

◆ m_uPan

uint_t Burger::SoundManager::Buffer::m_uPan
protected

Pan setting.

◆ m_uVolume

uint_t Burger::SoundManager::Buffer::m_uVolume
protected

Volume for the buffer.