Polyphase Game Engine
Loading...
Searching...
No Matches
SoundWave Class Reference

#include <SoundWave.h>

Inheritance diagram for SoundWave:
Asset Object

Public Member Functions

 DECLARE_ASSET (SoundWave, Asset)
 
 SoundWave ()
 
 ~SoundWave ()
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual bool Import (const std::string &path, ImportOptions *options) override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
virtual const char * GetTypeImportExt () override
 
void SetPcmData (uint8_t *data, uint32_t size, uint32_t numSamples, uint32_t bitsPerSample, uint32_t numChannels, uint32_t sampleRate)
 
void SetVolumeMultiplier (float volume)
 
float GetVolumeMultiplier () const
 
void SetPitchMultiplier (float pitch)
 
float GetPitchMultiplier () const
 
void SetAudioClass (int8_t audioClass)
 
int8_t GetAudioClass () const
 
uint8_t * GetWaveData () const
 
uint32_t GetWaveDataSize () const
 
uint32_t GetNumChannels () const
 
uint32_t GetBitsPerSample () const
 
uint32_t GetSampleRate () const
 
uint32_t GetNumSamples () const
 
uint32_t GetBlockAlign () const
 
uint32_t GetByteRate () const
 
float GetDuration () const
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual bool ShouldSnapshotForPie () const
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Static Public Member Functions

static bool LoadFromMemory (const uint8_t *data, size_t size, const char *formatHint, SoundWave &out)
 
- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Static Protected Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 

Protected Attributes

uint8_t * mWaveData = nullptr
 
uint32_t mWaveDataSize = 0
 
uint8_t * mCompressedData = nullptr
 
uint32_t mCompressedSize = 0
 
float mVolumeMultiplier = 1.0f
 
float mPitchMultiplier = 1.0f
 
int8_t mAudioClass = 0
 
bool mCompress = false
 
bool mCompressInternal = false
 
uint32_t mNumChannels = 1
 
uint32_t mBitsPerSample = 8
 
uint32_t mSampleRate = 22050
 
uint32_t mNumSamples = 0
 
uint32_t mBlockAlign = 0
 
uint32_t mByteRate = 0
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Constructor & Destructor Documentation

◆ SoundWave()

SoundWave::SoundWave ( )

◆ ~SoundWave()

SoundWave::~SoundWave ( )

Member Function Documentation

◆ Create()

void SoundWave::Create ( )
overridevirtual

Reimplemented from Asset.

◆ DECLARE_ASSET()

SoundWave::DECLARE_ASSET ( SoundWave  ,
Asset   
)

◆ Destroy()

void SoundWave::Destroy ( )
overridevirtual

Reimplemented from Asset.

◆ GatherProperties()

void SoundWave::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Asset.

◆ GetAudioClass()

int8_t SoundWave::GetAudioClass ( ) const

◆ GetBitsPerSample()

uint32_t SoundWave::GetBitsPerSample ( ) const

◆ GetBlockAlign()

uint32_t SoundWave::GetBlockAlign ( ) const

◆ GetByteRate()

uint32_t SoundWave::GetByteRate ( ) const

◆ GetDuration()

float SoundWave::GetDuration ( ) const

◆ GetNumChannels()

uint32_t SoundWave::GetNumChannels ( ) const

◆ GetNumSamples()

uint32_t SoundWave::GetNumSamples ( ) const

◆ GetPitchMultiplier()

float SoundWave::GetPitchMultiplier ( ) const

◆ GetSampleRate()

uint32_t SoundWave::GetSampleRate ( ) const

◆ GetTypeColor()

glm::vec4 SoundWave::GetTypeColor ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeImportExt()

const char * SoundWave::GetTypeImportExt ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeName()

const char * SoundWave::GetTypeName ( )
overridevirtual

Reimplemented from Asset.

◆ GetVolumeMultiplier()

float SoundWave::GetVolumeMultiplier ( ) const

◆ GetWaveData()

uint8_t * SoundWave::GetWaveData ( ) const

◆ GetWaveDataSize()

uint32_t SoundWave::GetWaveDataSize ( ) const

◆ HandlePropChange()

bool SoundWave::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
staticprotected

◆ Import()

bool SoundWave::Import ( const std::string &  path,
ImportOptions options 
)
overridevirtual

Reimplemented from Asset.

◆ LoadFromMemory()

bool SoundWave::LoadFromMemory ( const uint8_t *  data,
size_t  size,
const char *  formatHint,
SoundWave out 
)
static

◆ LoadStream()

void SoundWave::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ SaveStream()

void SoundWave::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ SetAudioClass()

void SoundWave::SetAudioClass ( int8_t  audioClass)

◆ SetPcmData()

void SoundWave::SetPcmData ( uint8_t *  data,
uint32_t  size,
uint32_t  numSamples,
uint32_t  bitsPerSample,
uint32_t  numChannels,
uint32_t  sampleRate 
)

◆ SetPitchMultiplier()

void SoundWave::SetPitchMultiplier ( float  pitch)

◆ SetVolumeMultiplier()

void SoundWave::SetVolumeMultiplier ( float  volume)

Member Data Documentation

◆ mAudioClass

int8_t SoundWave::mAudioClass = 0
protected

◆ mBitsPerSample

uint32_t SoundWave::mBitsPerSample = 8
protected

◆ mBlockAlign

uint32_t SoundWave::mBlockAlign = 0
protected

◆ mByteRate

uint32_t SoundWave::mByteRate = 0
protected

◆ mCompress

bool SoundWave::mCompress = false
protected

◆ mCompressedData

uint8_t* SoundWave::mCompressedData = nullptr
protected

◆ mCompressedSize

uint32_t SoundWave::mCompressedSize = 0
protected

◆ mCompressInternal

bool SoundWave::mCompressInternal = false
protected

◆ mNumChannels

uint32_t SoundWave::mNumChannels = 1
protected

◆ mNumSamples

uint32_t SoundWave::mNumSamples = 0
protected

◆ mPitchMultiplier

float SoundWave::mPitchMultiplier = 1.0f
protected

◆ mSampleRate

uint32_t SoundWave::mSampleRate = 22050
protected

◆ mVolumeMultiplier

float SoundWave::mVolumeMultiplier = 1.0f
protected

◆ mWaveData

uint8_t* SoundWave::mWaveData = nullptr
protected

◆ mWaveDataSize

uint32_t SoundWave::mWaveDataSize = 0
protected

The documentation for this class was generated from the following files: