SuperTuxKart
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
SFXBase Class Referenceabstract

The base class for sound effects. More...

#include <sfx_base.hpp>

Inheritance diagram for SFXBase:
Inheritance graph
[legend]

Public Types

enum  SFXStatus : int {
  SFX_UNKNOWN = -1 , SFX_STOPPED = 0 , SFX_PAUSED = 1 , SFX_PLAYING = 2 ,
  SFX_NOT_INITIALISED = 3
}
 Status of a sound effect.
 

Public Member Functions

virtual bool init ()=0
 Late creation, if SFX was initially disabled.
 
virtual bool isLooped ()=0
 
virtual void updatePlayingSFX (float dt)=0
 
virtual void setPosition (const Vec3 &p)=0
 
virtual void reallySetPosition (const Vec3 &p)=0
 
virtual void setSpeedPosition (float factor, const Vec3 &p)=0
 
virtual void reallySetSpeedPosition (float f, const Vec3 &p)=0
 
virtual void setLoop (bool status)=0
 
virtual void reallySetLoop (bool status)=0
 
virtual void play ()=0
 
virtual void reallyPlayNow (SFXBuffer *buffer=NULL)=0
 
virtual void play (const Vec3 &xyz, SFXBuffer *buffer=NULL)=0
 
virtual void reallyPlayNow (const Vec3 &xyz, SFXBuffer *buffer=NULL)=0
 
virtual void stop ()=0
 
virtual void reallyStopNow ()=0
 
virtual void pause ()=0
 
virtual void reallyPauseNow ()=0
 
virtual void resume ()=0
 
virtual void reallyResumeNow ()=0
 
virtual void deleteSFX ()=0
 
virtual void setSpeed (float factor)=0
 
virtual void reallySetSpeed (float factor)=0
 
virtual void setVolume (float gain)=0
 
virtual void reallySetVolume (float gain)=0
 
virtual void setMasterVolume (float gain)=0
 
virtual void reallySetMasterVolumeNow (float gain)=0
 
virtual void onSoundEnabledBack ()=0
 
virtual void setRolloff (float rolloff)=0
 
virtual SFXBuffergetBuffer () const =0
 
virtual SFXStatus getStatus ()=0
 

Detailed Description

The base class for sound effects.

It gets a sound buffer from the sound manager, which is shared between all instances. To create a new sound effect object, use sfx_manager->getSFX(...); do not create an instance with new, since SFXManager makes sure to stop/restart all SFX (esp. looping sfx like engine sounds) when necessary.

Member Function Documentation

◆ init()

virtual bool SFXBase::init ( )
pure virtual

Late creation, if SFX was initially disabled.

Implemented in DummySFX.


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