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

#include <SoundManager.h>

+ Collaboration diagram for RoR::SoundManager:

Public Member Functions

 SoundManager ()
 
 ~SoundManager ()
 
SoundPtr createSound (Ogre::String filename, Ogre::String resource_group_name="")
 
void setCamera (Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity)
 
void pauseAllSounds ()
 
void resumeAllSounds ()
 
void setMasterVolume (float v)
 
bool isDisabled ()
 
int getNumHardwareSources ()
 

Static Public Attributes

static const float MAX_DISTANCE = 500.0f
 
static const float ROLLOFF_FACTOR = 1.0f
 
static const float REFERENCE_DISTANCE = 7.5f
 
static const unsigned int MAX_HARDWARE_SOURCES = 32
 
static const unsigned int MAX_AUDIO_BUFFERS = 8192
 

Private Member Functions

void recomputeAllSources ()
 
void recomputeSource (int source_index, int reason, float vfl, Ogre::Vector3 *vvec)
 
ALuint getHardwareSource (int hardware_index)
 
void assign (int source_index, int hardware_index)
 
void retire (int source_index)
 
bool loadWAVFile (Ogre::String filename, ALuint buffer, Ogre::String resource_group_name="")
 

Private Attributes

int hardware_sources_num = 0
 
int hardware_sources_in_use_count = 0
 
int hardware_sources_map [MAX_HARDWARE_SOURCES]
 
ALuint hardware_sources [MAX_HARDWARE_SOURCES]
 
SoundPtr audio_sources [MAX_AUDIO_BUFFERS]
 
std::pair< int, float > audio_sources_most_audible [MAX_AUDIO_BUFFERS]
 
int audio_buffers_in_use_count = 0
 
ALuint audio_buffers [MAX_AUDIO_BUFFERS]
 
Ogre::String audio_buffer_file_name [MAX_AUDIO_BUFFERS]
 
Ogre::Vector3 camera_position = Ogre::Vector3::ZERO
 
ALCdevice * audio_device = nullptr
 
ALCcontext * sound_context = nullptr
 

Friends

class Sound
 

Detailed Description

Definition at line 44 of file SoundManager.h.

Constructor & Destructor Documentation

◆ SoundManager()

SoundManager::SoundManager ( )

Definition at line 55 of file SoundManager.cpp.

+ Here is the call graph for this function:

◆ ~SoundManager()

SoundManager::~SoundManager ( )

Definition at line 120 of file SoundManager.cpp.

Member Function Documentation

◆ assign()

void SoundManager::assign ( int  source_index,
int  hardware_index 
)
private

Definition at line 291 of file SoundManager.cpp.

+ Here is the call graph for this function:

◆ createSound()

SoundPtr SoundManager::createSound ( Ogre::String  filename,
Ogre::String  resource_group_name = "" 
)
Parameters
filenameWAV file.
resource_group_nameLeave empty to auto-search all groups (classic behavior).

Definition at line 354 of file SoundManager.cpp.

+ Here is the caller graph for this function:

◆ getHardwareSource()

ALuint RoR::SoundManager::getHardwareSource ( int  hardware_index)
inlineprivate

Definition at line 76 of file SoundManager.h.

+ Here is the caller graph for this function:

◆ getNumHardwareSources()

int RoR::SoundManager::getNumHardwareSources ( )
inline

Definition at line 65 of file SoundManager.h.

+ Here is the caller graph for this function:

◆ isDisabled()

bool RoR::SoundManager::isDisabled ( )
inline

Definition at line 63 of file SoundManager.h.

+ Here is the caller graph for this function:

◆ loadWAVFile()

bool SoundManager::loadWAVFile ( Ogre::String  filename,
ALuint  buffer,
Ogre::String  resource_group_name = "" 
)
private

Definition at line 397 of file SoundManager.cpp.

+ Here is the call graph for this function:

◆ pauseAllSounds()

void SoundManager::pauseAllSounds ( )

Definition at line 329 of file SoundManager.cpp.

+ Here is the caller graph for this function:

◆ recomputeAllSources()

void SoundManager::recomputeAllSources ( )
private

Definition at line 166 of file SoundManager.cpp.

+ Here is the call graph for this function:

◆ recomputeSource()

void SoundManager::recomputeSource ( int  source_index,
int  reason,
float  vfl,
Ogre::Vector3 *  vvec 
)
private

Definition at line 208 of file SoundManager.cpp.

+ Here is the caller graph for this function:

◆ resumeAllSounds()

void SoundManager::resumeAllSounds ( )

Definition at line 337 of file SoundManager.cpp.

+ Here is the caller graph for this function:

◆ retire()

void SoundManager::retire ( int  source_index)
private

Definition at line 317 of file SoundManager.cpp.

◆ setCamera()

void SoundManager::setCamera ( Ogre::Vector3  position,
Ogre::Vector3  direction,
Ogre::Vector3  up,
Ogre::Vector3  velocity 
)

Definition at line 138 of file SoundManager.cpp.

+ Here is the caller graph for this function:

◆ setMasterVolume()

void SoundManager::setMasterVolume ( float  v)

Definition at line 345 of file SoundManager.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ Sound

friend class Sound
friend

Definition at line 46 of file SoundManager.h.

Field Documentation

◆ audio_buffer_file_name

Ogre::String RoR::SoundManager::audio_buffer_file_name[MAX_AUDIO_BUFFERS]
private

Definition at line 97 of file SoundManager.h.

◆ audio_buffers

ALuint RoR::SoundManager::audio_buffers[MAX_AUDIO_BUFFERS]
private

Definition at line 96 of file SoundManager.h.

◆ audio_buffers_in_use_count

int RoR::SoundManager::audio_buffers_in_use_count = 0
private

Definition at line 95 of file SoundManager.h.

◆ audio_device

ALCdevice* RoR::SoundManager::audio_device = nullptr
private

Definition at line 100 of file SoundManager.h.

◆ audio_sources

SoundPtr RoR::SoundManager::audio_sources[MAX_AUDIO_BUFFERS]
private

Definition at line 90 of file SoundManager.h.

◆ audio_sources_most_audible

std::pair<int, float> RoR::SoundManager::audio_sources_most_audible[MAX_AUDIO_BUFFERS]
private

Definition at line 92 of file SoundManager.h.

◆ camera_position

Ogre::Vector3 RoR::SoundManager::camera_position = Ogre::Vector3::ZERO
private

Definition at line 99 of file SoundManager.h.

◆ hardware_sources

ALuint RoR::SoundManager::hardware_sources[MAX_HARDWARE_SOURCES]
private

Definition at line 87 of file SoundManager.h.

◆ hardware_sources_in_use_count

int RoR::SoundManager::hardware_sources_in_use_count = 0
private

Definition at line 85 of file SoundManager.h.

◆ hardware_sources_map

int RoR::SoundManager::hardware_sources_map[MAX_HARDWARE_SOURCES]
private

Definition at line 86 of file SoundManager.h.

◆ hardware_sources_num

int RoR::SoundManager::hardware_sources_num = 0
private

Definition at line 84 of file SoundManager.h.

◆ MAX_AUDIO_BUFFERS

const unsigned int RoR::SoundManager::MAX_AUDIO_BUFFERS = 8192
static

Definition at line 71 of file SoundManager.h.

◆ MAX_DISTANCE

const float SoundManager::MAX_DISTANCE = 500.0f
static

Definition at line 67 of file SoundManager.h.

◆ MAX_HARDWARE_SOURCES

const unsigned int RoR::SoundManager::MAX_HARDWARE_SOURCES = 32
static

Definition at line 70 of file SoundManager.h.

◆ REFERENCE_DISTANCE

const float SoundManager::REFERENCE_DISTANCE = 7.5f
static

Definition at line 69 of file SoundManager.h.

◆ ROLLOFF_FACTOR

const float SoundManager::ROLLOFF_FACTOR = 1.0f
static

Definition at line 68 of file SoundManager.h.

◆ sound_context

ALCcontext* RoR::SoundManager::sound_context = nullptr
private

Definition at line 101 of file SoundManager.h.


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