diff options
Diffstat (limited to 'linden/indra/newview/llvieweraudio.cpp')
-rw-r--r-- | linden/indra/newview/llvieweraudio.cpp | 125 |
1 files changed, 64 insertions, 61 deletions
diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp index 91e7ce5..d465177 100644 --- a/linden/indra/newview/llvieweraudio.cpp +++ b/linden/indra/newview/llvieweraudio.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "llviewerprecompiledheaders.h" | 33 | #include "llviewerprecompiledheaders.h" |
34 | 34 | ||
35 | #include "llaudioengine.h" | 35 | #include "llaudioengine.h" |
36 | #include "kokuastreamingaudio.h" | ||
36 | #include "llagent.h" | 37 | #include "llagent.h" |
37 | #include "llappviewer.h" | 38 | #include "llappviewer.h" |
38 | #include "llvieweraudio.h" | 39 | #include "llvieweraudio.h" |
@@ -46,69 +47,71 @@ | |||
46 | 47 | ||
47 | void init_audio() | 48 | void init_audio() |
48 | { | 49 | { |
49 | if (!gAudiop) | 50 | if (gAudiop) |
50 | { | 51 | { |
51 | llwarns << "Failed to create an appropriate Audio Engine" << llendl; | 52 | LLVector3d lpos_global = gAgent.getCameraPositionGlobal(); |
52 | return; | 53 | LLVector3 lpos_global_f; |
54 | |||
55 | lpos_global_f.setVec(lpos_global); | ||
56 | |||
57 | gAudiop->setListener(lpos_global_f, | ||
58 | LLVector3::zero, // LLViewerCamera::getInstance()->getVelocity(), // !!! BUG need to replace this with smoothed velocity! | ||
59 | LLViewerCamera::getInstance()->getUpAxis(), | ||
60 | LLViewerCamera::getInstance()->getAtAxis()); | ||
61 | |||
62 | // load up our initial set of sounds we'll want so they're in memory and ready to be played | ||
63 | |||
64 | bool mute_audio = gSavedSettings.getBOOL("MuteAudio"); | ||
65 | |||
66 | if (!mute_audio && FALSE == gSavedSettings.getBOOL("NoPreload")) | ||
67 | { | ||
68 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); | ||
69 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); | ||
70 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndChatFromObject"))); | ||
71 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClick"))); | ||
72 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClickRelease"))); | ||
73 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionF"))); | ||
74 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionM"))); | ||
75 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingChat"))); | ||
76 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingIM"))); | ||
77 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvApplyToObject"))); | ||
78 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvalidOp"))); | ||
79 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInventoryCopyToInv"))); | ||
80 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeDown"))); | ||
81 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeUp"))); | ||
82 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCopyToInv"))); | ||
83 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCreate"))); | ||
84 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectDelete"))); | ||
85 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezIn"))); | ||
86 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezOut"))); | ||
87 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuAppear"))); | ||
88 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuHide"))); | ||
89 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight0"))); | ||
90 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight1"))); | ||
91 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight2"))); | ||
92 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight3"))); | ||
93 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight4"))); | ||
94 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight5"))); | ||
95 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight6"))); | ||
96 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight7"))); | ||
97 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndSnapshot"))); | ||
98 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartAutopilot"))); | ||
99 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartFollowpilot"))); | ||
100 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartIM"))); | ||
101 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStopAutopilot"))); | ||
102 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTeleportOut"))); | ||
103 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureApplyToObject"))); | ||
104 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureCopyToInv"))); | ||
105 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTyping"))); | ||
106 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowClose"))); | ||
107 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowOpen"))); | ||
108 | } | ||
53 | } | 109 | } |
54 | LLVector3d lpos_global = gAgent.getCameraPositionGlobal(); | 110 | else |
55 | LLVector3 lpos_global_f; | ||
56 | |||
57 | lpos_global_f.setVec(lpos_global); | ||
58 | |||
59 | gAudiop->setListener(lpos_global_f, | ||
60 | LLVector3::zero, // LLViewerCamera::getInstance()->getVelocity(), // !!! BUG need to replace this with smoothed velocity! | ||
61 | LLViewerCamera::getInstance()->getUpAxis(), | ||
62 | LLViewerCamera::getInstance()->getAtAxis()); | ||
63 | |||
64 | // load up our initial set of sounds we'll want so they're in memory and ready to be played | ||
65 | |||
66 | bool mute_audio = gSavedSettings.getBOOL("MuteAudio"); | ||
67 | |||
68 | if (!mute_audio && FALSE == gSavedSettings.getBOOL("NoPreload")) | ||
69 | { | 111 | { |
70 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); | 112 | llwarns << "Failed to create an appropriate Audio Engine" << llendl; |
71 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); | 113 | return; |
72 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndChatFromObject"))); | ||
73 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClick"))); | ||
74 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClickRelease"))); | ||
75 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionF"))); | ||
76 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionM"))); | ||
77 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingChat"))); | ||
78 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingIM"))); | ||
79 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvApplyToObject"))); | ||
80 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvalidOp"))); | ||
81 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInventoryCopyToInv"))); | ||
82 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeDown"))); | ||
83 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeUp"))); | ||
84 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCopyToInv"))); | ||
85 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCreate"))); | ||
86 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectDelete"))); | ||
87 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezIn"))); | ||
88 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezOut"))); | ||
89 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuAppear"))); | ||
90 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuHide"))); | ||
91 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight0"))); | ||
92 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight1"))); | ||
93 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight2"))); | ||
94 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight3"))); | ||
95 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight4"))); | ||
96 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight5"))); | ||
97 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight6"))); | ||
98 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight7"))); | ||
99 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndSnapshot"))); | ||
100 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartAutopilot"))); | ||
101 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartFollowpilot"))); | ||
102 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartIM"))); | ||
103 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStopAutopilot"))); | ||
104 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTeleportOut"))); | ||
105 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureApplyToObject"))); | ||
106 | //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureCopyToInv"))); | ||
107 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTyping"))); | ||
108 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowClose"))); | ||
109 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowOpen"))); | ||
110 | } | 114 | } |
111 | |||
112 | audio_update_volume(true); | 115 | audio_update_volume(true); |
113 | } | 116 | } |
114 | 117 | ||
@@ -158,12 +161,12 @@ void audio_update_volume(bool force_update) | |||
158 | } | 161 | } |
159 | 162 | ||
160 | // Streaming Music | 163 | // Streaming Music |
161 | if (gAudiop) | 164 | if (gAudioStream) |
162 | { | 165 | { |
163 | F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); | 166 | F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); |
164 | BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); | 167 | BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); |
165 | music_volume = mute_volume * master_volume * (music_volume*music_volume); | 168 | music_volume = mute_volume * master_volume * (music_volume*music_volume); |
166 | gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); | 169 | gAudioStream->setInternetStreamGain ( music_muted ? 0.f : music_volume ); |
167 | 170 | ||
168 | } | 171 | } |
169 | 172 | ||