RigsofRods
Soft-body Physics Simulation
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
RoR::Sound Class Reference

#include <Sound.h>

+ Inheritance diagram for RoR::Sound:
+ Collaboration diagram for RoR::Sound:

Public Types

enum  RecomputeSource {
  REASON_PLAY, REASON_STOP, REASON_GAIN, REASON_LOOP,
  REASON_PTCH, REASON_POSN, REASON_VLCT
}
 

Public Member Functions

 Sound (ALuint buffer, SoundManager *soundManager, int sourceIndex)
 
virtual ~Sound () override
 
void setPitch (float pitch)
 
void setGain (float gain)
 
void setPosition (Ogre::Vector3 pos)
 
void setVelocity (Ogre::Vector3 vel)
 
void setLoop (bool loop)
 
void setEnabled (bool e)
 
void play ()
 
void stop ()
 
bool getEnabled ()
 
bool isPlaying ()
 
float getAudibility ()
 
float getGain ()
 
float getPitch ()
 
bool getLoop ()
 
int getCurrentHardwareIndex ()
 
ALuint getBuffer ()
 
Ogre::Vector3 getPosition ()
 
Ogre::Vector3 getVelocity ()
 
int getSourceIndex ()
 
- Public Member Functions inherited from RefCountingObject< Sound >
 RefCountingObject ()
 
virtual ~RefCountingObject ()
 
void AddRef ()
 
void Release ()
 

Private Member Functions

void computeAudibility (Ogre::Vector3 pos)
 

Private Attributes

float audibility
 
float gain
 
float pitch
 
bool loop
 
bool enabled
 
bool should_play
 
int hardware_index
 
ALuint buffer
 
Ogre::Vector3 position
 
Ogre::Vector3 velocity
 
SoundManagersound_manager
 
int source_index
 

Friends

class SoundManager
 

Additional Inherited Members

- Static Public Member Functions inherited from RefCountingObject< Sound >
static void RegisterRefCountingObject (AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name)
 
- Data Fields inherited from RefCountingObject< Sound >
int m_refcount
 
std::mutex m_refcount_mtx
 

Detailed Description

Definition at line 39 of file Sound.h.

Member Enumeration Documentation

◆ RecomputeSource

Enumerator
REASON_PLAY 
REASON_STOP 
REASON_GAIN 
REASON_LOOP 
REASON_PTCH 
REASON_POSN 
REASON_VLCT 

Definition at line 68 of file Sound.h.

Constructor & Destructor Documentation

◆ Sound()

Sound::Sound ( ALuint  buffer,
SoundManager soundManager,
int  sourceIndex 
)

Definition at line 29 of file Sound.cpp.

◆ ~Sound()

virtual RoR::Sound::~Sound ( )
inlineoverridevirtual

Definition at line 45 of file Sound.h.

Member Function Documentation

◆ computeAudibility()

void Sound::computeAudibility ( Ogre::Vector3  pos)
private

Definition at line 45 of file Sound.cpp.

+ Here is the call graph for this function:

◆ getAudibility()

float RoR::Sound::getAudibility ( )
inline

Definition at line 58 of file Sound.h.

◆ getBuffer()

ALuint RoR::Sound::getBuffer ( )
inline

Definition at line 63 of file Sound.h.

◆ getCurrentHardwareIndex()

int RoR::Sound::getCurrentHardwareIndex ( )
inline

Definition at line 62 of file Sound.h.

◆ getEnabled()

bool Sound::getEnabled ( )

Definition at line 108 of file Sound.cpp.

◆ getGain()

float RoR::Sound::getGain ( )
inline

Definition at line 59 of file Sound.h.

◆ getLoop()

bool RoR::Sound::getLoop ( )
inline

Definition at line 61 of file Sound.h.

◆ getPitch()

float RoR::Sound::getPitch ( )
inline

Definition at line 60 of file Sound.h.

◆ getPosition()

Ogre::Vector3 RoR::Sound::getPosition ( )
inline

Definition at line 64 of file Sound.h.

◆ getSourceIndex()

int RoR::Sound::getSourceIndex ( )
inline

Definition at line 66 of file Sound.h.

◆ getVelocity()

Ogre::Vector3 RoR::Sound::getVelocity ( )
inline

Definition at line 65 of file Sound.h.

◆ isPlaying()

bool Sound::isPlaying ( )

Definition at line 88 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ play()

void Sound::play ( )

Definition at line 113 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEnabled()

void Sound::setEnabled ( bool  e)

Definition at line 99 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGain()

void Sound::setGain ( float  gain)

Definition at line 125 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLoop()

void Sound::setLoop ( bool  loop)

Definition at line 134 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPitch()

void Sound::setPitch ( float  pitch)

Definition at line 143 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosition()

void Sound::setPosition ( Ogre::Vector3  pos)

Definition at line 152 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setVelocity()

void Sound::setVelocity ( Ogre::Vector3  vel)

Definition at line 161 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void Sound::stop ( )

Definition at line 119 of file Sound.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ SoundManager

friend class SoundManager
friend

Definition at line 41 of file Sound.h.

Field Documentation

◆ audibility

float RoR::Sound::audibility
private

Definition at line 82 of file Sound.h.

◆ buffer

ALuint RoR::Sound::buffer
private

Definition at line 91 of file Sound.h.

◆ enabled

bool RoR::Sound::enabled
private

Definition at line 86 of file Sound.h.

◆ gain

float RoR::Sound::gain
private

Definition at line 83 of file Sound.h.

◆ hardware_index

int RoR::Sound::hardware_index
private

Definition at line 90 of file Sound.h.

◆ loop

bool RoR::Sound::loop
private

Definition at line 85 of file Sound.h.

◆ pitch

float RoR::Sound::pitch
private

Definition at line 84 of file Sound.h.

◆ position

Ogre::Vector3 RoR::Sound::position
private

Definition at line 93 of file Sound.h.

◆ should_play

bool RoR::Sound::should_play
private

Definition at line 87 of file Sound.h.

◆ sound_manager

SoundManager* RoR::Sound::sound_manager
private

Definition at line 96 of file Sound.h.

◆ source_index

int RoR::Sound::source_index
private

Definition at line 98 of file Sound.h.

◆ velocity

Ogre::Vector3 RoR::Sound::velocity
private

Definition at line 94 of file Sound.h.


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