Convenience class for sound files in resources. More...
Public Member Functions | |
const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept override |
Get the description to the class. | |
uint_t | Upload (SoundManager *pSoundManager) override |
Load resource and upload. | |
void | Set (RezFile *pRezFile, uint_t uRezNum) |
Set the resource to track. | |
Public Member Functions inherited from Burger::SoundManager::Buffer | |
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. | |
BufferDecoder * | GetBufferDescription (void) |
Returns the contained BufferDecoder_t state. | |
const BufferDecoder * | GetBufferDescription (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. | |
IDirectSoundBuffer8 * | GetDirectSoundBuffer8 (void) const |
Gets the buffer's DirectSoundBuffer8. | |
uint_t | IsUploaded (void) const |
Public Member Functions inherited from Burger::ReferenceCounter | |
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 char * | get_class_name (void) const noexcept |
Get the name of the class. | |
virtual | ~Base () noexcept=default |
Destructor. | |
Static Public Member Functions | |
static SoundBufferRez * | New (void) |
Create a new sound buffer. | |
static SoundBufferRez * | New (RezFile *pRezFile, uint_t uRezNum) |
Create a new sound buffer. | |
Static Public Member Functions inherited from Burger::SoundManager::Buffer | |
static Buffer * | New (void) |
Create a new sound buffer. | |
Static Public Attributes | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Static Public Attributes inherited from Burger::SoundManager::Buffer | |
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 | |
SoundBufferRez (void) | |
Default constructor. | |
SoundBufferRez (RezFile *pRezFile, uint_t uRezNum) | |
Default constructor. | |
Protected Member Functions inherited from Burger::SoundManager::Buffer | |
Buffer () | |
Constructor. | |
Protected Attributes | |
RezFile * | m_pRezFile |
Pointer to the resource class that the resource is attached to. | |
uint_t | m_uRezNum |
Resource number of the sound file. | |
Protected Attributes inherited from Burger::SoundManager::Buffer | |
IDirectSoundBuffer8 * | m_pDirectSoundBuffer8 |
DirectSound8 buffer (Windows Only) | |
const void * | m_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 | |
SoundBufferRez (const SoundBufferRez &)=delete | |
SoundBufferRez & | operator= (const SoundBufferRez &)=delete |
SoundBufferRez (SoundBufferRez &&)=delete | |
SoundBufferRez & | operator= (SoundBufferRez &&)=delete |
Convenience class for sound files in resources.
When this class is created, only it's variables are initialized but data isn't actually loaded, to upload the sound to the audio hardware, call SoundManager::Play() or call Upload() directly.
This is a reference counted class, as such it can only be created with a call to New() and disposed of by a call to Release(). Delete() will likely asset with a "refcount is not zero" error.
|
privatedelete |
|
privatedelete |
|
protected |
Default constructor.
This creates an incomplete class, follow up with a call to Set(RezFile *,uint_t) to have the class access a valid sound file
|
protected |
Default constructor.
Sets up the RezFile and resource number of the sound file this buffer derives the audio data from.
pRezFile | Pointer to a RezFile to load data from |
uRezNum | Resource number of the sound file |
|
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.
Reimplemented from Burger::SoundManager::Buffer.
|
static |
Create a new sound buffer.
pRezFile | Pointer to a RezFile to load data from |
uRezNum | Resource number of the sound file |
|
static |
Create a new sound buffer.
|
privatedelete |
|
privatedelete |
Set the resource to track.
Set the resource number to upload into the sound buffer.
It will purge the previous buffer.
pRezFile | Pointer to a RezFile to load data from |
uRezNum | Resource number of the sound file |
|
overridevirtual |
Load resource and upload.
If the sound hardware already has the data uploaded, this function will do nothing. Otherwise, it will call the RezFile class to load in the sound data and it will be passed to the audio hardware. After the upload is complete, the RezFile data chunk is marked "released" so it can be purged.
pSoundManager | A pointer to the parent SoundManager that manages the audio hardware |
Reimplemented from Burger::SoundManager::Buffer.
|
static |
The global description of the class.
This record contains the name of this class and a reference to the parent
|
protected |
Pointer to the resource class that the resource is attached to.
|
protected |
Resource number of the sound file.