Rise
The Vieneo Province
Sound Class Reference

#include <Sound.h>

Collaboration diagram for Sound:
[legend]

Public Member Functions

 Sound (GameClass *gameptr)
 
void EnumDevices ()
 
void Init ()
 
void InitDevice (SoundConfig *deviceConfig)
 
void Close ()
 
void PlayAudioData (unsigned char *data, size_t length)
 
void GlobalAttenuate (float prmGaTimeToFadeOut, float prmGaTimeToHold, float prmGaTimeToFadeIn, int soundEnum, float prmExTimeToFadeIn, float prmExTimeToHold, float prmExTimeToFadeOut, float volumeAdj=1.0f)
 
void ChangeVolume (SoundConfig *config, float modVolume)
 
void ChangeVolume (int soundEnum, float modVolume)
 
float Play (int soundEnum)
 
void Reset ()
 
void PlayEx (int soundEnum, bool loop, float volume=1.0f, float frequencyMod=1.0f, float pan=0.0f, bool restart=true)
 
void Stop (int soundEnum)
 
void AddLoopingVehicleSound (int soundEnum, unsigned char array)
 
void RemoveLoopingVehicleSound (int soundEnum, unsigned char array)
 
void LegacySoundRequestUniverse (SServerPacket datapacket)
 
void AddDelayedSound (int soundEnum, float delay, float volume=1.0f)
 
void ChangeCockpit (bool force)
 
void FrameMoveAAC ()
 
void PrecipWindSoundBarrier (D3DXVECTOR3 relativewind, float elapsedTime)
 
void LoadSounds (short instage)
 
void ChangeVolume ()
 
float GetLength (int soundEnum)
 
void LoadCockpitSound (int soundEnum, const char *path, bool force, SoundConfig *device=nullptr)
 
void FrameMove (float elapsedTime)
 
float GetAttenuation (bool applyDensity) const
 

Static Public Member Functions

static void CALLBACK AdvanceStage (HSYNC handle, DWORD channel, DWORD data, void *user)
 
static void CALLBACK MetaData (HSYNC handle, DWORD channel, DWORD data, void *user)
 

Public Attributes

HSTREAM g_pSoundIntro = NULL
 
HSYNC hsync = NULL
 
bool loopintro = true
 
GameState musicstage = GameState::STATUS_SPLASH
 
float musicleft = 0.0f
 
float musicdone = 0.0f
 
short station = 0
 
std::vector< std::string > deviceNames
 
std::vector< GUID > deviceGuids
 

Private Member Functions

void LoadSound (int soundEnum, SoundConfig *device=nullptr)
 
void Trace (const char *msg, Logger::Level severity=Logger::Level::Info) const
 
void FrameMoveDelayedEffects (float elapsedTime)
 
void FrameMoveDopplerEffects (float elapsedTime)
 

Private Attributes

GameClassgame = nullptr
 
const float minrate = 100
 
const float maxrate = 100000
 
HSTREAM radio = NULL
 
HSTREAM comms = NULL
 
HSAMPLE sound_sample [SOUND_ENUMERATION]
 
HCHANNEL sound_channel [SOUND_ENUMERATION]
 
float sound_length [SOUND_ENUMERATION]
 
float sound_rate [SOUND_ENUMERATION] {}
 
char sound_device [SOUND_ENUMERATION]
 
SoundConfigsound_config [SOUND_ENUMERATION]
 
float sound_volume [SOUND_ENUMERATION]
 
char currentSoundDevice = -2
 
char currentRadioDevice = -2
 
bool g_bRadioPlaying = false
 
short oldstation = -1
 
char oldtitle [99] = { 0 }
 
char metadata [999] = { 0 }
 
char stationIdentification = rand() % 3
 
int excludeFromGlobalAttenuate = -1
 
float globalAttenuate = 1.0f
 
float gaTimer = 0.0f
 
float gaTimeToFadeOut = 0.0f
 
float gaTimeToHold = 0.0f
 
float gaTimeToFadeIn = 0.0f
 
float gaVolumeAdj = 0.0f
 
float exTimeToFadeIn = 0.0f
 
float exTimeToHold = 0.0f
 
float exTimeToFadeOut = 0.0f
 
float oldvolume = 0.0f
 
float oldFrequencyMod = 1.0f
 
float oldPan = 0.0f
 
float oldvolume2 = 0.0f
 
float oldFrequencyMod2 = 1.0f
 
float oldPan2 = 0.0f
 
float headpan = 0.0f
 
std::vector< Sdelayedeffectsdelayedeffects
 
std::vector< Sloopingeffectsloopingeffects
 
bool issuedWarning = false
 

Static Private Attributes

static char * sound_path [SOUND_ENUMERATION]
 

Detailed Description

Definition at line 276 of file Sound.h.

Constructor & Destructor Documentation

◆ Sound()

Sound::Sound ( GameClass gameptr)

Definition at line 204 of file Sound.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AddDelayedSound()

void Sound::AddDelayedSound ( int  soundEnum,
float  delay,
float  volume = 1.0f 
)

Definition at line 1927 of file Sound.cpp.

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

◆ AddLoopingVehicleSound()

void Sound::AddLoopingVehicleSound ( int  soundEnum,
unsigned char  array 
)

Definition at line 1954 of file Sound.cpp.

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

◆ AdvanceStage()

void CALLBACK Sound::AdvanceStage ( HSYNC  handle,
DWORD  channel,
DWORD  data,
void *  user 
)
static

Definition at line 797 of file Sound.cpp.

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

◆ ChangeCockpit()

void Sound::ChangeCockpit ( bool  force)

Definition at line 1977 of file Sound.cpp.

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

◆ ChangeVolume() [1/3]

void Sound::ChangeVolume ( SoundConfig config,
float  modVolume 
)

Definition at line 504 of file Sound.cpp.

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

◆ ChangeVolume() [2/3]

void Sound::ChangeVolume ( int  soundEnum,
float  modVolume 
)

Definition at line 548 of file Sound.cpp.

Here is the call graph for this function:

◆ ChangeVolume() [3/3]

void Sound::ChangeVolume ( )

Definition at line 564 of file Sound.cpp.

Here is the caller graph for this function:

◆ Close()

void Sound::Close ( )

Definition at line 375 of file Sound.cpp.

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

◆ EnumDevices()

void Sound::EnumDevices ( )

Definition at line 218 of file Sound.cpp.

Here is the caller graph for this function:

◆ FrameMove()

void Sound::FrameMove ( float  elapsedTime)

Definition at line 1053 of file Sound.cpp.

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

◆ FrameMoveAAC()

void Sound::FrameMoveAAC ( )

Definition at line 1285 of file Sound.cpp.

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

◆ FrameMoveDelayedEffects()

void Sound::FrameMoveDelayedEffects ( float  elapsedTime)
private

http://www.emmco.org/Documents/Siren%20abstract.pdf

Definition at line 1372 of file Sound.cpp.

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

◆ FrameMoveDopplerEffects()

void Sound::FrameMoveDopplerEffects ( float  elapsedTime)
private

Definition at line 1531 of file Sound.cpp.

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

◆ GetAttenuation()

float Sound::GetAttenuation ( bool  applyDensity) const

Definition at line 1062 of file Sound.cpp.

Here is the caller graph for this function:

◆ GetLength()

float Sound::GetLength ( int  soundEnum)

Definition at line 572 of file Sound.cpp.

◆ GlobalAttenuate()

void Sound::GlobalAttenuate ( float  prmGaTimeToFadeOut,
float  prmGaTimeToHold,
float  prmGaTimeToFadeIn,
int  soundEnum,
float  prmExTimeToFadeIn,
float  prmExTimeToHold,
float  prmExTimeToFadeOut,
float  volumeAdj = 1.0f 
)

Definition at line 489 of file Sound.cpp.

Here is the caller graph for this function:

◆ Init()

void Sound::Init ( )

Definition at line 248 of file Sound.cpp.

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

◆ InitDevice()

void Sound::InitDevice ( SoundConfig deviceConfig)

Definition at line 274 of file Sound.cpp.

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

◆ LegacySoundRequestUniverse()

void Sound::LegacySoundRequestUniverse ( SServerPacket  datapacket)

Definition at line 1133 of file Sound.cpp.

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

◆ LoadCockpitSound()

void Sound::LoadCockpitSound ( int  soundEnum,
const char *  path,
bool  force,
SoundConfig device = nullptr 
)

Definition at line 983 of file Sound.cpp.

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

◆ LoadSound()

void Sound::LoadSound ( int  soundEnum,
SoundConfig device = nullptr 
)
private

Definition at line 911 of file Sound.cpp.

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

◆ LoadSounds()

void Sound::LoadSounds ( short  instage)

Definition at line 1073 of file Sound.cpp.

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

◆ MetaData()

void CALLBACK Sound::MetaData ( HSYNC  handle,
DWORD  channel,
DWORD  data,
void *  user 
)
static

Definition at line 756 of file Sound.cpp.

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

◆ Play()

float Sound::Play ( int  soundEnum)

Definition at line 577 of file Sound.cpp.

Here is the call graph for this function:

◆ PlayAudioData()

void Sound::PlayAudioData ( unsigned char *  data,
size_t  length 
)

Definition at line 402 of file Sound.cpp.

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

◆ PlayEx()

void Sound::PlayEx ( int  soundEnum,
bool  loop,
float  volume = 1.0f,
float  frequencyMod = 1.0f,
float  pan = 0.0f,
bool  restart = true 
)
Todo:
should be a way to do 360?
Bug:
https://jira.risetvp.com/view.php?id=1424

Definition at line 606 of file Sound.cpp.

Here is the call graph for this function:

◆ PrecipWindSoundBarrier()

void Sound::PrecipWindSoundBarrier ( D3DXVECTOR3  relativewind,
float  elapsedTime 
)
Todo:
this was all wrong ... should be D3DXVec3Lerp(&relativewindtarget, &relativewindtarget, &relativewind, elapsedTime); and then use relativewindtarget not relativewind
Todo:
not really how it works... the wave it makes is continuous so they could hit someone with the wave later if they maintain supersonic flight

Definition at line 1764 of file Sound.cpp.

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

◆ RemoveLoopingVehicleSound()

void Sound::RemoveLoopingVehicleSound ( int  soundEnum,
unsigned char  array 
)

Definition at line 1964 of file Sound.cpp.

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

◆ Reset()

void Sound::Reset ( )

Definition at line 583 of file Sound.cpp.

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

◆ Stop()

void Sound::Stop ( int  soundEnum)

Definition at line 1946 of file Sound.cpp.

Here is the caller graph for this function:

◆ Trace()

void Sound::Trace ( const char *  msg,
Logger::Level  severity = Logger::Level::Info 
) const
private

Definition at line 395 of file Sound.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ comms

HSTREAM Sound::comms = NULL
private

Definition at line 283 of file Sound.h.

◆ currentRadioDevice

char Sound::currentRadioDevice = -2
private

Definition at line 295 of file Sound.h.

◆ currentSoundDevice

char Sound::currentSoundDevice = -2
private

Definition at line 294 of file Sound.h.

◆ delayedeffects

std::vector<Sdelayedeffects> Sound::delayedeffects
private

Definition at line 318 of file Sound.h.

◆ deviceGuids

std::vector<GUID> Sound::deviceGuids

Definition at line 337 of file Sound.h.

◆ deviceNames

std::vector<std::string> Sound::deviceNames

Definition at line 336 of file Sound.h.

◆ excludeFromGlobalAttenuate

int Sound::excludeFromGlobalAttenuate = -1
private

Definition at line 303 of file Sound.h.

◆ exTimeToFadeIn

float Sound::exTimeToFadeIn = 0.0f
private

Definition at line 310 of file Sound.h.

◆ exTimeToFadeOut

float Sound::exTimeToFadeOut = 0.0f
private

Definition at line 312 of file Sound.h.

◆ exTimeToHold

float Sound::exTimeToHold = 0.0f
private

Definition at line 311 of file Sound.h.

◆ g_bRadioPlaying

bool Sound::g_bRadioPlaying = false
private

Definition at line 297 of file Sound.h.

◆ g_pSoundIntro

HSTREAM Sound::g_pSoundIntro = NULL

Definition at line 329 of file Sound.h.

◆ game

GameClass* Sound::game = nullptr
private

Definition at line 278 of file Sound.h.

◆ gaTimer

float Sound::gaTimer = 0.0f
private

Definition at line 305 of file Sound.h.

◆ gaTimeToFadeIn

float Sound::gaTimeToFadeIn = 0.0f
private

Definition at line 308 of file Sound.h.

◆ gaTimeToFadeOut

float Sound::gaTimeToFadeOut = 0.0f
private

Definition at line 306 of file Sound.h.

◆ gaTimeToHold

float Sound::gaTimeToHold = 0.0f
private

Definition at line 307 of file Sound.h.

◆ gaVolumeAdj

float Sound::gaVolumeAdj = 0.0f
private

Definition at line 309 of file Sound.h.

◆ globalAttenuate

float Sound::globalAttenuate = 1.0f
private

Definition at line 304 of file Sound.h.

◆ headpan

float Sound::headpan = 0.0f
private

Definition at line 316 of file Sound.h.

◆ hsync

HSYNC Sound::hsync = NULL

Definition at line 330 of file Sound.h.

◆ issuedWarning

bool Sound::issuedWarning = false
private

Definition at line 326 of file Sound.h.

◆ loopingeffects

std::vector<Sloopingeffects> Sound::loopingeffects
private

Definition at line 319 of file Sound.h.

◆ loopintro

bool Sound::loopintro = true

Definition at line 332 of file Sound.h.

◆ maxrate

const float Sound::maxrate = 100000
private

Definition at line 280 of file Sound.h.

◆ metadata

char Sound::metadata[999] = { 0 }
private

Definition at line 300 of file Sound.h.

◆ minrate

const float Sound::minrate = 100
private

Definition at line 280 of file Sound.h.

◆ musicdone

float Sound::musicdone = 0.0f

Definition at line 334 of file Sound.h.

◆ musicleft

float Sound::musicleft = 0.0f

Definition at line 334 of file Sound.h.

◆ musicstage

GameState Sound::musicstage = GameState::STATUS_SPLASH

Definition at line 333 of file Sound.h.

◆ oldFrequencyMod

float Sound::oldFrequencyMod = 1.0f
private

Definition at line 314 of file Sound.h.

◆ oldFrequencyMod2

float Sound::oldFrequencyMod2 = 1.0f
private

Definition at line 315 of file Sound.h.

◆ oldPan

float Sound::oldPan = 0.0f
private

Definition at line 314 of file Sound.h.

◆ oldPan2

float Sound::oldPan2 = 0.0f
private

Definition at line 315 of file Sound.h.

◆ oldstation

short Sound::oldstation = -1
private

Definition at line 298 of file Sound.h.

◆ oldtitle

char Sound::oldtitle[99] = { 0 }
private

Definition at line 299 of file Sound.h.

◆ oldvolume

float Sound::oldvolume = 0.0f
private

Definition at line 314 of file Sound.h.

◆ oldvolume2

float Sound::oldvolume2 = 0.0f
private

Definition at line 315 of file Sound.h.

◆ radio

HSTREAM Sound::radio = NULL
private

Definition at line 282 of file Sound.h.

◆ sound_channel

HCHANNEL Sound::sound_channel[SOUND_ENUMERATION]
private

Definition at line 286 of file Sound.h.

◆ sound_config

SoundConfig* Sound::sound_config[SOUND_ENUMERATION]
private

Definition at line 290 of file Sound.h.

◆ sound_device

char Sound::sound_device[SOUND_ENUMERATION]
private

Definition at line 289 of file Sound.h.

◆ sound_length

float Sound::sound_length[SOUND_ENUMERATION]
private

Definition at line 287 of file Sound.h.

◆ sound_path

char * Sound::sound_path
staticprivate

Definition at line 291 of file Sound.h.

◆ sound_rate

float Sound::sound_rate[SOUND_ENUMERATION] {}
private

Definition at line 288 of file Sound.h.

◆ sound_sample

HSAMPLE Sound::sound_sample[SOUND_ENUMERATION]
private

Definition at line 285 of file Sound.h.

◆ sound_volume

float Sound::sound_volume[SOUND_ENUMERATION]
private

Definition at line 292 of file Sound.h.

◆ station

short Sound::station = 0

Definition at line 335 of file Sound.h.

◆ stationIdentification

char Sound::stationIdentification = rand() % 3
private

Definition at line 301 of file Sound.h.


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