![]() |
DDNet documentation
|
#include <sounds.h>
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 (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< CSoundLoading > | m_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 CGameClient * | GameClient () const |
| class IClient * | Client () const |
| class IKernel * | Kernel () const |
| class IEngine * | Engine () const |
| class IGraphics * | Graphics () const |
| class ITextRender * | TextRender () const |
| class IInput * | Input () const |
| class IStorage * | Storage () const |
| class CUi * | Ui () const |
| class ISound * | Sound () const |
| class CRenderTools * | RenderTools () const |
| class CRenderMap * | RenderMap () const |
| class IConfigManager * | ConfigManager () const |
| class CConfig * | Config () const |
| class IConsole * | Console () const |
| class IDemoPlayer * | DemoPlayer () const |
| class IDemoRecorder * | DemoRecorder (int Recorder) const |
| class IFavorites * | Favorites () const |
| class IServerBrowser * | ServerBrowser () const |
| class CLayers * | Layers () const |
| class CCollision * | Collision () const |
| int64_t | time () const |
| float | LocalTime () const |
| class IHttp * | Http () const |
| void CSounds::ClearQueue | ( | ) |
| void CSounds::Enqueue | ( | int | Channel, |
| int | SetId ) |
|
private |
| bool CSounds::IsPlaying | ( | int | SetId | ) |
|
overridevirtual |
Called to let the components run initialization code.
Reimplemented from CComponent.
|
overridevirtual |
Called when the component should get rendered.
The render order depends on the component insertion order.
Reimplemented from CComponent.
|
overridevirtual |
Called to reset the component. This method is usually called on your component constructor to avoid code duplication.
Reimplemented from CComponent.
|
overridevirtual |
This method is called when the client changes state, e.g from offline to online.
Reimplemented from CComponent.
| void CSounds::Play | ( | int | Channel, |
| int | SetId, | ||
| float | Volume ) |
| void CSounds::PlayAndRecord | ( | int | Channel, |
| int | SetId, | ||
| float | Volume, | ||
| vec2 | Position ) |
| void CSounds::PlayAt | ( | int | Channel, |
| int | SetId, | ||
| float | Volume, | ||
| vec2 | Position ) |
| ISound::CVoiceHandle CSounds::PlaySample | ( | int | Channel, |
| int | SampleId, | ||
| int | Flags, | ||
| float | Volume ) |
| ISound::CVoiceHandle CSounds::PlaySampleAt | ( | int | Channel, |
| int | SampleId, | ||
| int | Flags, | ||
| float | Volume, | ||
| vec2 | Position ) |
|
inlineoverridevirtual |
Gets the size of the non-abstract component.
Implements CComponent.
| void CSounds::Stop | ( | int | SetId | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |