DDraceNetwork Docs
CSounds Class Reference

#include <sounds.h>

Inheritance diagram for CSounds:
[legend]
Collaboration diagram for CSounds:
[legend]

Classes

struct  QueueEntry
 

Public Types

enum  {
  CHN_GUI = 0 , CHN_MUSIC , CHN_WORLD , CHN_GLOBAL ,
  CHN_MAPSOUND
}
 

Public Member Functions

virtual int Sizeof () const override
 
virtual void OnInit () override
 
virtual void OnReset () override
 
virtual void OnStateChange (int NewState, int OldState) override
 
virtual void OnRender () override
 
void ClearQueue ()
 
void Enqueue (int Channel, int SetId)
 
void Play (int Channel, int SetId, float Volume)
 
void PlayAt (int Channel, int SetId, float Volume, vec2 Position)
 
void PlayAndRecord (int Channel, int SetId, float Volume, vec2 Position)
 
void Stop (int SetId)
 
bool IsPlaying (int SetId)
 
ISound::CVoiceHandle PlaySample (int Channel, int SampleId, int Flags, float Volume)
 
ISound::CVoiceHandle PlaySampleAt (int Channel, int SampleId, int Flags, float Volume, vec2 Position)
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Private Types

enum  { QUEUE_SIZE = 32 }
 

Private Member Functions

void UpdateChannels ()
 
int GetSampleId (int SetId)
 

Private Attributes

struct CSounds::QueueEntry m_aQueue [QUEUE_SIZE]
 
int m_QueuePos
 
int64_t m_QueueWaitTime
 
std::shared_ptr< CSoundLoadingm_pSoundJob
 
bool m_WaitForSoundJob
 
float m_GuiSoundVolume = -1.0f
 
float m_GameSoundVolume = -1.0f
 
float m_MapSoundVolume = -1.0f
 
float m_BackgroundMusicVolume = -1.0f
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
QUEUE_SIZE 

◆ anonymous enum

anonymous enum
Enumerator
CHN_GUI 
CHN_MUSIC 
CHN_WORLD 
CHN_GLOBAL 
CHN_MAPSOUND 

Member Function Documentation

◆ ClearQueue()

void CSounds::ClearQueue ( )

◆ Enqueue()

void CSounds::Enqueue ( int  Channel,
int  SetId 
)

◆ GetSampleId()

int CSounds::GetSampleId ( int  SetId)
private

◆ IsPlaying()

bool CSounds::IsPlaying ( int  SetId)

◆ OnInit()

void CSounds::OnInit ( )
overridevirtual

Called to let the components run initialization code.

Reimplemented from CComponent.

◆ OnRender()

void CSounds::OnRender ( )
overridevirtual

Called when the component should get rendered.

The render order depends on the component insertion order.

Reimplemented from CComponent.

◆ OnReset()

void CSounds::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ OnStateChange()

void CSounds::OnStateChange ( int  NewState,
int  OldState 
)
overridevirtual

This method is called when the client changes state, e.g from offline to online.

See also
IClient::STATE_CONNECTING
IClient::STATE_LOADING
IClient::STATE_ONLINE

Reimplemented from CComponent.

◆ Play()

void CSounds::Play ( int  Channel,
int  SetId,
float  Volume 
)

◆ PlayAndRecord()

void CSounds::PlayAndRecord ( int  Channel,
int  SetId,
float  Volume,
vec2  Position 
)

◆ PlayAt()

void CSounds::PlayAt ( int  Channel,
int  SetId,
float  Volume,
vec2  Position 
)

◆ PlaySample()

ISound::CVoiceHandle CSounds::PlaySample ( int  Channel,
int  SampleId,
int  Flags,
float  Volume 
)

◆ PlaySampleAt()

ISound::CVoiceHandle CSounds::PlaySampleAt ( int  Channel,
int  SampleId,
int  Flags,
float  Volume,
vec2  Position 
)

◆ Sizeof()

virtual int CSounds::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ Stop()

void CSounds::Stop ( int  SetId)

◆ UpdateChannels()

void CSounds::UpdateChannels ( )
private

Member Data Documentation

◆ m_aQueue

struct CSounds::QueueEntry CSounds::m_aQueue[QUEUE_SIZE]
private

◆ m_BackgroundMusicVolume

float CSounds::m_BackgroundMusicVolume = -1.0f
private

◆ m_GameSoundVolume

float CSounds::m_GameSoundVolume = -1.0f
private

◆ m_GuiSoundVolume

float CSounds::m_GuiSoundVolume = -1.0f
private

◆ m_MapSoundVolume

float CSounds::m_MapSoundVolume = -1.0f
private

◆ m_pSoundJob

std::shared_ptr<CSoundLoading> CSounds::m_pSoundJob
private

◆ m_QueuePos

int CSounds::m_QueuePos
private

◆ m_QueueWaitTime

int64_t CSounds::m_QueueWaitTime
private

◆ m_WaitForSoundJob

bool CSounds::m_WaitForSoundJob
private

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