DDraceNetwork Documentation
Loading...
Searching...
No Matches
CSounds Class Reference

#include <sounds.h>

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

Classes

class  CQueueEntry

Public Types

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

Public Member Functions

int Sizeof () const override
void OnInit () override
void OnReset () override
void OnStateChange (int NewState, int OldState) override
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 void OnConsoleInit ()
virtual void OnShutdown ()
virtual void OnWindowResize ()
virtual void OnUpdate ()
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)
virtual bool OnTouchState (const std::vector< IInput::CTouchFingerState > &vTouchFingerStates)
Public Member Functions inherited from CComponentInterfaces
virtual void OnInterfacesInit (CGameClient *pClient)
virtual ~CComponentInterfaces ()=default

Private Types

enum  { QUEUE_SIZE = 32 }

Private Member Functions

void UpdateChannels ()
int GetSampleId (int SetId)

Private Attributes

CQueueEntry 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 CComponentInterfaces
class CGameClientGameClient () const
class IClientClient () const
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 CRenderMapRenderMap () 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

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()

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

CQueueEntry 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: