diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llaudiosourcevo.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llpreviewsound.cpp | 3 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 51 | ||||
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 3 | ||||
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 3 | ||||
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 11 |
6 files changed, 47 insertions, 26 deletions
diff --git a/linden/indra/newview/llaudiosourcevo.cpp b/linden/indra/newview/llaudiosourcevo.cpp index e668078..9c25d94 100644 --- a/linden/indra/newview/llaudiosourcevo.cpp +++ b/linden/indra/newview/llaudiosourcevo.cpp | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "llviewerparcelmgr.h" | 39 | #include "llviewerparcelmgr.h" |
40 | 40 | ||
41 | LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp) | 41 | LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp) |
42 | : LLAudioSource(sound_id, owner_id, gain), | 42 | : LLAudioSource(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX), |
43 | mObjectp(objectp), | 43 | mObjectp(objectp), |
44 | mActualGain(gain) | 44 | mActualGain(gain) |
45 | { | 45 | { |
diff --git a/linden/indra/newview/llpreviewsound.cpp b/linden/indra/newview/llpreviewsound.cpp index 9ba6fd5..6b79bfb 100644 --- a/linden/indra/newview/llpreviewsound.cpp +++ b/linden/indra/newview/llpreviewsound.cpp | |||
@@ -106,7 +106,6 @@ void LLPreviewSound::auditionSound( void *userdata ) | |||
106 | if(item && gAudiop) | 106 | if(item && gAudiop) |
107 | { | 107 | { |
108 | LLVector3d lpos_global = gAgent.getPositionGlobal(); | 108 | LLVector3d lpos_global = gAgent.getPositionGlobal(); |
109 | F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : SOUND_GAIN * gSavedSettings.getF32("AudioLevelSFX"); | 109 | gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); |
110 | gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), volume, lpos_global); | ||
111 | } | 110 | } |
112 | } | 111 | } |
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 636cf31..11e4ac5 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -583,28 +583,55 @@ bool idle_startup() | |||
583 | 583 | ||
584 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) | 584 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) |
585 | { | 585 | { |
586 | 586 | gAudiop = NULL; | |
587 | gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); | 587 | |
588 | #ifdef LL_OPENAL | ||
589 | if (!gAudiop | ||
590 | #if !LL_WINDOWS | ||
591 | && NULL == getenv("LL_BAD_OPENAL_DRIVER") | ||
592 | #endif // !LL_WINDOWS | ||
593 | ) | ||
594 | { | ||
595 | gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); | ||
596 | } | ||
597 | #endif | ||
598 | |||
599 | #ifdef LL_FMOD | ||
600 | if (!gAudiop | ||
601 | #if !LL_WINDOWS | ||
602 | && NULL == getenv("LL_BAD_FMOD_DRIVER") | ||
603 | #endif // !LL_WINDOWS | ||
604 | ) | ||
605 | { | ||
606 | gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); | ||
607 | } | ||
608 | #endif | ||
588 | 609 | ||
589 | if (gAudiop) | 610 | if (gAudiop) |
590 | { | 611 | { |
591 | BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES); | 612 | #if LL_WINDOWS |
592 | if(!init) | 613 | // FMOD on Windows needs the window handle to stop playing audio |
614 | // when window is minimized. JC | ||
615 | void* window_handle = (HWND)gViewerWindow->getPlatformWindow(); | ||
616 | #else | ||
617 | void* window_handle = NULL; | ||
618 | #endif | ||
619 | bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); | ||
620 | if(init) | ||
593 | { | 621 | { |
594 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; | 622 | gAudiop->setMuted(TRUE); |
595 | gAudiop=NULL; | ||
596 | } | 623 | } |
597 | else | 624 | else |
598 | { | 625 | { |
599 | gAudiop->setMuted(TRUE); | 626 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; |
600 | LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; | 627 | delete gAudiop; |
628 | gAudiop = NULL; | ||
601 | } | 629 | } |
602 | } | 630 | } |
603 | } | 631 | } |
604 | else | 632 | |
605 | { | 633 | LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; |
606 | gAudiop = NULL; | 634 | |
607 | } | ||
608 | 635 | ||
609 | if (LLTimer::knownBadTimer()) | 636 | if (LLTimer::knownBadTimer()) |
610 | { | 637 | { |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 0e39026..260265e 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -3308,8 +3308,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) | |||
3308 | return; | 3308 | return; |
3309 | } | 3309 | } |
3310 | 3310 | ||
3311 | F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : (gain * gSavedSettings.getF32("AudioLevelSFX")); | 3311 | gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global); |
3312 | gAudiop->triggerSound(sound_id, owner_id, volume, pos_global); | ||
3313 | } | 3312 | } |
3314 | 3313 | ||
3315 | void process_preload_sound(LLMessageSystem *msg, void **user_data) | 3314 | void process_preload_sound(LLMessageSystem *msg, void **user_data) |
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 8a55b3f..1dda1ca 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -1402,8 +1402,7 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item ) | |||
1402 | const F32 SOUND_GAIN = 1.0f; | 1402 | const F32 SOUND_GAIN = 1.0f; |
1403 | if(gAudiop) | 1403 | if(gAudiop) |
1404 | { | 1404 | { |
1405 | F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : (SOUND_GAIN * gSavedSettings.getF32("AudioLevelSFX")); | 1405 | gAudiop->triggerSound(item->getAssetUUID(), gAgentID, SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); |
1406 | gAudiop->triggerSound(item->getAssetUUID(), gAgentID, volume, lpos_global); | ||
1407 | } | 1406 | } |
1408 | showCopyToInvDialog( item ); | 1407 | showCopyToInvDialog( item ); |
1409 | } | 1408 | } |
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index e480eb3..327cd57 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -3828,10 +3828,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) | |||
3828 | // AUDIO_STEP_LO_SPEED, AUDIO_STEP_HI_SPEED, | 3828 | // AUDIO_STEP_LO_SPEED, AUDIO_STEP_HI_SPEED, |
3829 | // AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN ); | 3829 | // AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN ); |
3830 | 3830 | ||
3831 | F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient"); | 3831 | const F32 STEP_VOLUME = 0.5f; |
3832 | F32 gain = gSavedSettings.getBOOL("MuteAmbient") | ||
3833 | ? 0.f | ||
3834 | : (.50f * ambient_volume * ambient_volume); | ||
3835 | LLUUID& step_sound_id = getStepSound(); | 3832 | LLUUID& step_sound_id = getStepSound(); |
3836 | 3833 | ||
3837 | LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); | 3834 | LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); |
@@ -3839,7 +3836,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) | |||
3839 | if (LLViewerParcelMgr::getInstance()->canHearSound(foot_pos_global) | 3836 | if (LLViewerParcelMgr::getInstance()->canHearSound(foot_pos_global) |
3840 | && !LLMuteList::getInstance()->isMuted(getID(), LLMute::flagObjectSounds)) | 3837 | && !LLMuteList::getInstance()->isMuted(getID(), LLMute::flagObjectSounds)) |
3841 | { | 3838 | { |
3842 | gAudiop->triggerSound(step_sound_id, getID(), gain, foot_pos_global); | 3839 | gAudiop->triggerSound(step_sound_id, getID(), STEP_VOLUME, LLAudioEngine::AUDIO_TYPE_AMBIENT, foot_pos_global); |
3843 | } | 3840 | } |
3844 | } | 3841 | } |
3845 | } | 3842 | } |
@@ -4819,8 +4816,8 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL | |||
4819 | //else | 4816 | //else |
4820 | { | 4817 | { |
4821 | LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); | 4818 | LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); |
4822 | F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX"); | 4819 | gAudiop->triggerSound(sound_id, getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_SFX, char_pos_global); |
4823 | gAudiop->triggerSound(sound_id, getID(), volume, char_pos_global); | 4820 | |
4824 | } | 4821 | } |
4825 | } | 4822 | } |
4826 | } | 4823 | } |