summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp64
1 files changed, 43 insertions, 21 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index a113cc93..c3565828 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -109,7 +109,9 @@ cAudioManager::Service()
if (m_bIsInitialised) {
m_nPreviousUserPause = m_nUserPause;
m_nUserPause = CTimer::GetIsUserPaused();
+#ifdef GTA_PC
UpdateReflections();
+#endif
ServiceSoundEffects();
MusicManager.Service();
}
@@ -216,33 +218,33 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol)
}
void
-cAudioManager::SetEffectsMasterVolume(uint8 volume) const
+cAudioManager::SetEffectsMasterVolume(uint8 volume)
{
SampleManager.SetEffectsMasterVolume(volume);
}
void
-cAudioManager::SetMusicMasterVolume(uint8 volume) const
+cAudioManager::SetMusicMasterVolume(uint8 volume)
{
SampleManager.SetMusicMasterVolume(volume);
}
void
-cAudioManager::SetEffectsFadeVol(uint8 volume) const
+cAudioManager::SetEffectsFadeVol(uint8 volume)
{
SampleManager.SetEffectsFadeVolume(volume);
}
void
-cAudioManager::SetMonoMode(bool8 mono)
+cAudioManager::SetMusicFadeVol(uint8 volume)
{
- SampleManager.SetMonoMode(mono);
+ SampleManager.SetMusicFadeVolume(volume);
}
void
-cAudioManager::SetMusicFadeVol(uint8 volume) const
+cAudioManager::SetMonoMode(bool8 mono)
{
- SampleManager.SetMusicFadeVolume(volume);
+ SampleManager.SetMonoMode(mono);
}
void
@@ -307,8 +309,10 @@ cAudioManager::DestroyAllGameCreatedEntities()
}
}
+#ifdef GTA_PC
+
uint8
-cAudioManager::GetNum3DProvidersAvailable() const
+cAudioManager::GetNum3DProvidersAvailable()
{
if (m_bIsInitialised)
return SampleManager.GetNum3DProvidersAvailable();
@@ -316,7 +320,7 @@ cAudioManager::GetNum3DProvidersAvailable() const
}
char *
-cAudioManager::Get3DProviderName(uint8 id) const
+cAudioManager::Get3DProviderName(uint8 id)
{
if (!m_bIsInitialised)
return nil;
@@ -331,7 +335,7 @@ cAudioManager::Get3DProviderName(uint8 id) const
}
int8
-cAudioManager::GetCurrent3DProviderIndex() const
+cAudioManager::GetCurrent3DProviderIndex()
{
if (m_bIsInitialised)
return SampleManager.GetCurrent3DProviderIndex();
@@ -363,13 +367,13 @@ cAudioManager::SetCurrent3DProvider(uint8 which)
}
void
-cAudioManager::SetSpeakerConfig(int32 conf) const
+cAudioManager::SetSpeakerConfig(int32 conf)
{
SampleManager.SetSpeakerConfig(conf);
}
bool8
-cAudioManager::IsMP3RadioChannelAvailable() const
+cAudioManager::IsMP3RadioChannelAvailable()
{
if (m_bIsInitialised)
return SampleManager.IsMP3RadioChannelAvailable();
@@ -378,7 +382,7 @@ cAudioManager::IsMP3RadioChannelAvailable() const
}
void
-cAudioManager::ReleaseDigitalHandle() const
+cAudioManager::ReleaseDigitalHandle()
{
if (m_bIsInitialised) {
SampleManager.ReleaseDigitalHandle();
@@ -386,7 +390,7 @@ cAudioManager::ReleaseDigitalHandle() const
}
void
-cAudioManager::ReacquireDigitalHandle() const
+cAudioManager::ReacquireDigitalHandle()
{
if (m_bIsInitialised) {
SampleManager.ReacquireDigitalHandle();
@@ -400,13 +404,13 @@ cAudioManager::SetDynamicAcousticModelingStatus(bool8 status)
}
bool8
-cAudioManager::CheckForAnAudioFileOnCD() const
+cAudioManager::CheckForAnAudioFileOnCD()
{
return SampleManager.CheckForAnAudioFileOnCD();
}
char
-cAudioManager::GetCDAudioDriveLetter() const
+cAudioManager::GetCDAudioDriveLetter()
{
if (m_bIsInitialised)
return SampleManager.GetCDAudioDriveLetter();
@@ -415,11 +419,13 @@ cAudioManager::GetCDAudioDriveLetter() const
}
bool8
-cAudioManager::IsAudioInitialised() const
+cAudioManager::IsAudioInitialised()
{
return m_bIsInitialised;
}
+#endif // GTA_PC
+
void
cAudioManager::ServiceSoundEffects()
{
@@ -469,8 +475,14 @@ cAudioManager::ServiceSoundEffects()
m_sAudioScriptObjectManager.m_nScriptObjectEntityTotal = 0;
}
+uint32
+cAudioManager::FL(float f)
+{
+ return SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) * f;
+}
+
uint8
-cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const
+cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance)
{
float newSoundIntensity;
if (soundIntensity <= 0.0f)
@@ -482,7 +494,7 @@ cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float d
}
void
-cAudioManager::TranslateEntity(Const CVector *in, CVector *out) const
+cAudioManager::TranslateEntity(Const CVector *in, CVector *out)
{
*out = MultiplyInverse(TheCamera.GetMatrix(), *in);
}
@@ -501,7 +513,7 @@ cAudioManager::ComputePan(float dist, CVector *vec)
}
int32
-cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const
+cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier)
{
uint32 newFreq = oldFreq;
if (!TheCamera.Get_Just_Switched_Status() && speedMultiplier != 0.0f) {
@@ -522,7 +534,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1,
}
int32
-cAudioManager::RandomDisplacement(uint32 seed) const
+cAudioManager::RandomDisplacement(uint32 seed)
{
int32 value;
@@ -593,6 +605,7 @@ cAudioManager::AddSampleToRequestedQueue()
AddReflectionsToRequestedQueue();
}
}
+
void
cAudioManager::AddDetailsToRequestedOrderList(uint8 sample)
{
@@ -610,6 +623,7 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample)
m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = sample;
}
+#ifdef GTA_PC
void
cAudioManager::AddReflectionsToRequestedQueue()
{
@@ -687,6 +701,7 @@ cAudioManager::UpdateReflections()
m_afReflectionsDistances[4] = 50.0f;
}
}
+#endif // GTA_PC
void
cAudioManager::AddReleasingSounds()
@@ -965,6 +980,13 @@ cAudioManager::ClearActiveSamples()
}
void
+cAudioManager::LoadBankIfNecessary(uint8 bank)
+{
+ if(!SampleManager.IsSampleBankLoaded(bank))
+ SampleManager.LoadSampleBank(bank);
+}
+
+void
cAudioManager::GenerateIntegerRandomNumberTable()
{
for (int32 i = 0; i < ARRAY_SIZE(m_anRandomTable); i++) {