aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llaudio/llaudioengine.cpp79
-rw-r--r--linden/indra/llaudio/llaudioengine.h21
-rw-r--r--linden/indra/llaudio/llstreamingaudio.h3
-rw-r--r--linden/indra/newview/CMakeLists.txt2
-rw-r--r--linden/indra/newview/chatbar_as_cmdline.cpp4
-rw-r--r--linden/indra/newview/kokuastreamingaudio.cpp129
-rw-r--r--linden/indra/newview/kokuastreamingaudio.h71
-rw-r--r--linden/indra/newview/llappviewer.cpp14
-rw-r--r--linden/indra/newview/lloverlaybar.cpp13
-rw-r--r--linden/indra/newview/llstartup.cpp17
-rw-r--r--linden/indra/newview/llvieweraudio.cpp125
-rw-r--r--linden/indra/newview/llviewercontrol.cpp11
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.cpp7
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.h2
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp18
15 files changed, 318 insertions, 198 deletions
diff --git a/linden/indra/llaudio/llaudioengine.cpp b/linden/indra/llaudio/llaudioengine.cpp
index bed791a..6b0003a 100644
--- a/linden/indra/llaudio/llaudioengine.cpp
+++ b/linden/indra/llaudio/llaudioengine.cpp
@@ -36,7 +36,6 @@
36#include "linden_common.h" 36#include "linden_common.h"
37 37
38#include "llaudioengine.h" 38#include "llaudioengine.h"
39#include "llstreamingaudio.h"
40 39
41#include "llerror.h" 40#include "llerror.h"
42#include "llmath.h" 41#include "llmath.h"
@@ -48,7 +47,6 @@
48#include "llaudiodecodemgr.h" 47#include "llaudiodecodemgr.h"
49#include "llassetstorage.h" 48#include "llassetstorage.h"
50 49
51
52// necessary for grabbing sounds from sim (implemented in viewer) 50// necessary for grabbing sounds from sim (implemented in viewer)
53extern void request_sound(const LLUUID &sound_guid); 51extern void request_sound(const LLUUID &sound_guid);
54 52
@@ -70,16 +68,6 @@ LLAudioEngine::~LLAudioEngine()
70{ 68{
71} 69}
72 70
73LLStreamingAudioInterface* LLAudioEngine::getStreamingAudioImpl()
74{
75 return mStreamingAudioImpl;
76}
77
78void LLAudioEngine::setStreamingAudioImpl(LLStreamingAudioInterface *impl)
79{
80 mStreamingAudioImpl = impl;
81}
82
83void LLAudioEngine::setDefaults() 71void LLAudioEngine::setDefaults()
84{ 72{
85 mMaxWindGain = 1.f; 73 mMaxWindGain = 1.f;
@@ -108,8 +96,6 @@ void LLAudioEngine::setDefaults()
108 mInternalGain = 0.f; 96 mInternalGain = 0.f;
109 mNextWindUpdate = 0.f; 97 mNextWindUpdate = 0.f;
110 98
111 mStreamingAudioImpl = NULL;
112
113 for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++) 99 for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++)
114 mSecondaryGain[i] = 1.0f; 100 mSecondaryGain[i] = 1.0f;
115} 101}
@@ -174,62 +160,6 @@ void LLAudioEngine::shutdown()
174 } 160 }
175} 161}
176 162
177
178// virtual
179void LLAudioEngine::startInternetStream(const std::string& url)
180{
181 if (mStreamingAudioImpl)
182 mStreamingAudioImpl->start(url);
183}
184
185
186// virtual
187void LLAudioEngine::stopInternetStream()
188{
189 if (mStreamingAudioImpl)
190 mStreamingAudioImpl->stop();
191}
192
193// virtual
194void LLAudioEngine::pauseInternetStream(int pause)
195{
196 if (mStreamingAudioImpl)
197 mStreamingAudioImpl->pause(pause);
198}
199
200// virtual
201void LLAudioEngine::updateInternetStream()
202{
203 if (mStreamingAudioImpl)
204 mStreamingAudioImpl->update();
205}
206
207// virtual
208int LLAudioEngine::isInternetStreamPlaying()
209{
210 if (mStreamingAudioImpl)
211 return mStreamingAudioImpl->isPlaying();
212
213 return 0; // Stopped
214}
215
216
217// virtual
218void LLAudioEngine::setInternetStreamGain(F32 vol)
219{
220 if (mStreamingAudioImpl)
221 mStreamingAudioImpl->setGain(vol);
222}
223
224// virtual
225std::string LLAudioEngine::getInternetStreamURL()
226{
227 if (mStreamingAudioImpl)
228 return mStreamingAudioImpl->getURL();
229 else return std::string();
230}
231
232
233void LLAudioEngine::updateChannels() 163void LLAudioEngine::updateChannels()
234{ 164{
235 S32 i; 165 S32 i;
@@ -512,7 +442,6 @@ void LLAudioEngine::idle(F32 max_decode_time)
512 // or request new data. 442 // or request new data.
513 startNextTransfer(); 443 startNextTransfer();
514 444
515 updateInternetStream();
516} 445}
517 446
518 447
@@ -754,14 +683,6 @@ F32 LLAudioEngine::getSecondaryGain(S32 type)
754 return mSecondaryGain[type]; 683 return mSecondaryGain[type];
755} 684}
756 685
757F32 LLAudioEngine::getInternetStreamGain()
758{
759 if (mStreamingAudioImpl)
760 return mStreamingAudioImpl->getGain();
761 else
762 return 1.0f;
763}
764
765void LLAudioEngine::setMaxWindGain(F32 gain) 686void LLAudioEngine::setMaxWindGain(F32 gain)
766{ 687{
767 mMaxWindGain = gain; 688 mMaxWindGain = gain;
diff --git a/linden/indra/llaudio/llaudioengine.h b/linden/indra/llaudio/llaudioengine.h
index a1b240e..7237ce2 100644
--- a/linden/indra/llaudio/llaudioengine.h
+++ b/linden/indra/llaudio/llaudioengine.h
@@ -71,8 +71,6 @@ class LLAudioData;
71class LLAudioChannel; 71class LLAudioChannel;
72class LLAudioChannelOpenAL; 72class LLAudioChannelOpenAL;
73class LLAudioBuffer; 73class LLAudioBuffer;
74class LLStreamingAudioInterface;
75
76 74
77// 75//
78// LLAudioEngine definition 76// LLAudioEngine definition
@@ -119,16 +117,13 @@ public:
119 // stops playing new sounds. 117 // stops playing new sounds.
120 void setMuted(bool muted); 118 void setMuted(bool muted);
121 bool getMuted() const { return mMuted; } 119 bool getMuted() const { return mMuted; }
122#ifdef USE_PLUGIN_MEDIA 120
123 LLPluginClassMedia* initializeMedia(const std::string& media_type);
124#endif
125 F32 getMasterGain(); 121 F32 getMasterGain();
126 void setMasterGain(F32 gain); 122 void setMasterGain(F32 gain);
127 123
128 F32 getSecondaryGain(S32 type); 124 F32 getSecondaryGain(S32 type);
129 void setSecondaryGain(S32 type, F32 gain); 125 void setSecondaryGain(S32 type, F32 gain);
130 126
131 F32 getInternetStreamGain();
132 127
133 virtual void setDopplerFactor(F32 factor); 128 virtual void setDopplerFactor(F32 factor);
134 virtual F32 getDopplerFactor(); 129 virtual F32 getDopplerFactor();
@@ -150,19 +145,6 @@ public:
150 LLAudioSource *findAudioSource(const LLUUID &source_id); 145 LLAudioSource *findAudioSource(const LLUUID &source_id);
151 LLAudioData *getAudioData(const LLUUID &audio_uuid); 146 LLAudioData *getAudioData(const LLUUID &audio_uuid);
152 147
153 // Internet stream implementation manipulation
154 LLStreamingAudioInterface *getStreamingAudioImpl();
155 void setStreamingAudioImpl(LLStreamingAudioInterface *impl);
156 // Internet stream methods - these will call down into the *mStreamingAudioImpl if it exists
157 void startInternetStream(const std::string& url);
158 void stopInternetStream();
159 void pauseInternetStream(int pause);
160 void updateInternetStream(); // expected to be called often
161 int isInternetStreamPlaying();
162 // use a value from 0.0 to 1.0, inclusive
163 void setInternetStreamGain(F32 vol);
164 std::string getInternetStreamURL();
165
166 // For debugging usage 148 // For debugging usage
167 virtual LLVector3 getListenerPos(); 149 virtual LLVector3 getListenerPos();
168 150
@@ -247,7 +229,6 @@ protected:
247 229
248private: 230private:
249 void setDefaults(); 231 void setDefaults();
250 LLStreamingAudioInterface *mStreamingAudioImpl;
251}; 232};
252 233
253 234
diff --git a/linden/indra/llaudio/llstreamingaudio.h b/linden/indra/llaudio/llstreamingaudio.h
index aa89e6a..f5d5334 100644
--- a/linden/indra/llaudio/llstreamingaudio.h
+++ b/linden/indra/llaudio/llstreamingaudio.h
@@ -36,7 +36,7 @@
36 36
37#include "stdtypes.h" // from llcommon 37#include "stdtypes.h" // from llcommon
38 38
39// Entirely abstract. Based exactly on the historic API. 39// Entirely abstract. Based on the historic API.
40class LLStreamingAudioInterface 40class LLStreamingAudioInterface
41{ 41{
42 public: 42 public:
@@ -51,6 +51,7 @@ class LLStreamingAudioInterface
51 virtual void setGain(F32 vol) = 0; 51 virtual void setGain(F32 vol) = 0;
52 virtual F32 getGain() = 0; 52 virtual F32 getGain() = 0;
53 virtual std::string getURL() = 0; 53 virtual std::string getURL() = 0;
54 virtual std::string getVersion() = 0;
54}; 55};
55 56
56#endif // LL_STREAMINGAUDIO_H 57#endif // LL_STREAMINGAUDIO_H
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index e6c1767..4a30be3 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -88,6 +88,7 @@ set(viewer_SOURCE_FILES
88 impprefsfonts.cpp 88 impprefsfonts.cpp
89 jcfloater_animation_list.cpp 89 jcfloater_animation_list.cpp
90 jcfloaterareasearch.cpp 90 jcfloaterareasearch.cpp
91 kokuastreamingaudio.cpp
91 kowopenregionsettings.cpp 92 kowopenregionsettings.cpp
92 lightshare.cpp 93 lightshare.cpp
93 llagent.cpp 94 llagent.cpp
@@ -541,6 +542,7 @@ set(viewer_HEADER_FILES
541 impprefsfonts.h 542 impprefsfonts.h
542 jcfloater_animation_list.h 543 jcfloater_animation_list.h
543 jcfloaterareasearch.h 544 jcfloaterareasearch.h
545 kokuastreamingaudio.h
544 lightshare.h 546 lightshare.h
545 lggautocorrectfloater.h 547 lggautocorrectfloater.h
546 lggautocorrect.h 548 lggautocorrect.h
diff --git a/linden/indra/newview/chatbar_as_cmdline.cpp b/linden/indra/newview/chatbar_as_cmdline.cpp
index 0593091..b5a7e8c 100644
--- a/linden/indra/newview/chatbar_as_cmdline.cpp
+++ b/linden/indra/newview/chatbar_as_cmdline.cpp
@@ -69,7 +69,7 @@
69#include "llviewerparcelmgr.h" 69#include "llviewerparcelmgr.h"
70#include "llviewerparcelmedia.h" 70#include "llviewerparcelmedia.h"
71#include "llparcel.h" 71#include "llparcel.h"
72#include "llaudioengine.h" 72#include "kokuastreamingaudio.h"
73#include "llviewerparcelmediaautoplay.h" 73#include "llviewerparcelmediaautoplay.h"
74#include "lloverlaybar.h" 74#include "lloverlaybar.h"
75#include "lggautocorrectfloater.h" 75#include "lggautocorrectfloater.h"
@@ -367,7 +367,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
367 { 367 {
368 gOverlayBar->toggleMusicPlay(gOverlayBar); 368 gOverlayBar->toggleMusicPlay(gOverlayBar);
369 } 369 }
370 gAudiop->startInternetStream(status); 370 gAudioStream->startInternetStream(status);
371 return false; 371 return false;
372 } 372 }
373 } 373 }
diff --git a/linden/indra/newview/kokuastreamingaudio.cpp b/linden/indra/newview/kokuastreamingaudio.cpp
new file mode 100644
index 0000000..ed606db
--- /dev/null
+++ b/linden/indra/newview/kokuastreamingaudio.cpp
@@ -0,0 +1,129 @@
1 /**
2 * @file kokuastreamingaudio.cpp
3 * @brief Definition of KOKUAStreamingAudio base class for streaming audio support
4 *
5 * $LicenseInfo:firstyear=2011&license=viewergpl$
6 * Kokua Viewer Source Code
7 * Copyright (C) 2011, Armin.Weatherwax (at) googlemail.com
8 * for the Kokua Viewer Team, in special for our Imprudence Viewer.
9 *
10 * The source code in this file ("Source Code") is provided by the author
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in this
13 * distribution, or online at
14 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at
20 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * THIS SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 *
30 * $/LicenseInfo$
31 */
32
33#include "kokuastreamingaudio.h"
34#include "llstreamingaudio.h"
35
36
37KOKUAStreamingAudio* gAudioStream = NULL;
38
39KOKUAStreamingAudio::KOKUAStreamingAudio(LLStreamingAudioInterface *impl) :
40mStreamingAudioImpl (impl)
41{
42
43}
44
45KOKUAStreamingAudio::~KOKUAStreamingAudio()
46{
47 if (mStreamingAudioImpl)
48 {
49 delete mStreamingAudioImpl;
50 mStreamingAudioImpl = NULL;
51 }
52}
53
54LLStreamingAudioInterface* KOKUAStreamingAudio::getStreamingAudioImpl()
55{
56 return mStreamingAudioImpl;
57}
58
59// void KOKUAStreamingAudio::setStreamingAudioImpl(LLStreamingAudioInterface *impl)
60// {
61// mStreamingAudioImpl = impl;
62// }
63
64// virtual
65void KOKUAStreamingAudio::startInternetStream(const std::string& url)
66{
67 if (mStreamingAudioImpl)
68 mStreamingAudioImpl->start(url);
69}
70
71// virtual
72void KOKUAStreamingAudio::stopInternetStream()
73{
74 if (mStreamingAudioImpl)
75 mStreamingAudioImpl->stop();
76}
77
78// virtual
79void KOKUAStreamingAudio::pauseInternetStream(int pause)
80{
81 if (mStreamingAudioImpl)
82 mStreamingAudioImpl->pause(pause);
83}
84
85// virtual
86void KOKUAStreamingAudio::updateInternetStream()
87{
88 if (mStreamingAudioImpl)
89 mStreamingAudioImpl->update();
90}
91
92// virtual
93KOKUAStreamingAudio::KOKUAAudioPlayState KOKUAStreamingAudio::isInternetStreamPlaying()
94{
95 if (mStreamingAudioImpl)
96 return (KOKUAStreamingAudio::KOKUAAudioPlayState) mStreamingAudioImpl->isPlaying();
97
98 return KOKUAStreamingAudio::AUDIO_STOPPED; // Stopped
99}
100
101// virtual
102void KOKUAStreamingAudio::setInternetStreamGain(F32 vol)
103{
104 if (mStreamingAudioImpl)
105 mStreamingAudioImpl->setGain(vol);
106}
107
108F32 KOKUAStreamingAudio::getInternetStreamGain()
109{
110 if (mStreamingAudioImpl)
111 return mStreamingAudioImpl->getGain();
112 else
113 return 1.0f;
114}
115
116// virtual
117std::string KOKUAStreamingAudio::getInternetStreamURL()
118{
119 if (mStreamingAudioImpl)
120 return mStreamingAudioImpl->getURL();
121 else return std::string();
122}
123
124std::string KOKUAStreamingAudio::getVersion()
125{
126 if (mStreamingAudioImpl)
127 return mStreamingAudioImpl->getVersion();
128 else return std::string();
129} \ No newline at end of file
diff --git a/linden/indra/newview/kokuastreamingaudio.h b/linden/indra/newview/kokuastreamingaudio.h
new file mode 100644
index 0000000..eb49f25
--- /dev/null
+++ b/linden/indra/newview/kokuastreamingaudio.h
@@ -0,0 +1,71 @@
1/**
2 * @file kokuastreamingaudio.h
3 * @brief Definition of KOKUAStreamingAudio base class for streaming audio support
4 *
5 * $LicenseInfo:firstyear=2011&license=viewergpl$
6 * Kokua Viewer Source Code
7 * Copyright (C) 2011, Armin.Weatherwax (at) googlemail.com
8 * for the Kokua Viewer Team.
9 *
10 * The source code in this file ("Source Code") is provided by the author
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in this
13 * distribution, or online at
14 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at
20 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * THIS SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 *
30 * $/LicenseInfo$
31 */
32#ifndef KOKUA_STREAMINGAUDIO_H
33#define KOKUA_STREAMINGAUDIO_H
34
35#include "linden_common.h"
36
37class LLStreamingAudioInterface;
38
39class KOKUAStreamingAudio
40{
41public:
42 enum KOKUAAudioPlayState
43 {
44 // isInternetStreamPlaying() returns an *int*, with
45 // 0 = stopped, 1 = playing, 2 = paused.
46 AUDIO_STOPPED = 0,
47 AUDIO_PLAYING = 1,
48 AUDIO_PAUSED = 2
49 };
50
51 KOKUAStreamingAudio(LLStreamingAudioInterface *impl);
52 virtual ~KOKUAStreamingAudio();
53
54 LLStreamingAudioInterface *getStreamingAudioImpl();
55// void setStreamingAudioImpl(LLStreamingAudioInterface *impl);
56 void startInternetStream(const std::string& url);
57 void stopInternetStream();
58 void pauseInternetStream(int pause);
59 void updateInternetStream();
60 KOKUAAudioPlayState isInternetStreamPlaying();
61 void setInternetStreamGain(F32 vol);
62 F32 getInternetStreamGain();
63 std::string getInternetStreamURL();
64 std::string getVersion();
65private:
66 LLStreamingAudioInterface *mStreamingAudioImpl;
67};
68
69extern KOKUAStreamingAudio* gAudioStream;
70
71#endif
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 8aea221..eb03727 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -104,6 +104,7 @@
104#include "llassetstorage.h" 104#include "llassetstorage.h"
105#include "llpolymesh.h" 105#include "llpolymesh.h"
106#include "llcachename.h" 106#include "llcachename.h"
107#include "kokuastreamingaudio.h"
107#include "llaudioengine.h" 108#include "llaudioengine.h"
108#include "llstreamingaudio.h" 109#include "llstreamingaudio.h"
109#include "llviewermenu.h" 110#include "llviewermenu.h"
@@ -1278,14 +1279,17 @@ bool LLAppViewer::cleanup()
1278 1279
1279 llinfos << "Global stuff deleted" << llendflush; 1280 llinfos << "Global stuff deleted" << llendflush;
1280 1281
1281 if (gAudiop) 1282 if (gAudioStream)
1282 { 1283 {
1283 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem. 1284 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
1284 1285
1285 LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl(); 1286 LLStreamingAudioInterface *sai = gAudioStream->getStreamingAudioImpl();
1286 delete sai; 1287 delete sai;
1287 gAudiop->setStreamingAudioImpl(NULL); 1288// gAudioStream->setStreamingAudioImpl(NULL);
1289 }
1288 1290
1291 if (gAudiop)
1292 {
1289 // shut down the audio subsystem 1293 // shut down the audio subsystem
1290 1294
1291 bool want_longname = false; 1295 bool want_longname = false;
@@ -3732,6 +3736,10 @@ void LLAppViewer::idle()
3732 const F32 max_audio_decode_time = 0.002f; // 2 ms decode time 3736 const F32 max_audio_decode_time = 0.002f; // 2 ms decode time
3733 gAudiop->idle(max_audio_decode_time); 3737 gAudiop->idle(max_audio_decode_time);
3734 } 3738 }
3739
3740 // update streaming audio
3741 if (gAudioStream)
3742 gAudioStream->updateInternetStream();
3735 } 3743 }
3736 3744
3737 3745
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index ed406e8..4e1d03e 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -38,7 +38,7 @@
38#include "lloverlaybar.h" 38#include "lloverlaybar.h"
39 39
40#include "aoremotectrl.h" 40#include "aoremotectrl.h"
41#include "llaudioengine.h" 41#include "kokuastreamingaudio.h"
42#include "llrender.h" 42#include "llrender.h"
43#include "llagent.h" 43#include "llagent.h"
44#include "llbutton.h" 44#include "llbutton.h"
@@ -438,17 +438,16 @@ void LLOverlayBar::toggleMusicPlay(void*)
438 if (gOverlayBar->mMusicState != PLAYING) 438 if (gOverlayBar->mMusicState != PLAYING)
439 { 439 {
440 gOverlayBar->mMusicState = PLAYING; // desired state 440 gOverlayBar->mMusicState = PLAYING; // desired state
441 if (gAudiop) 441 if (gAudioStream)
442 { 442 {
443 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 443 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
444 if ( parcel ) 444 if ( parcel )
445 { 445 {
446 // this doesn't work properly when crossing parcel boundaries - even when the 446 // this doesn't work properly when crossing parcel boundaries - even when the
447 // stream is stopped, it doesn't return the right thing - commenting out for now. 447 // stream is stopped, it doesn't return the right thing - commenting out for now.
448 // if ( gAudiop->isInternetStreamPlaying() == 0 ) 448 // if ( gAudioStream->isInternetStreamPlaying() == 0 )
449 { 449 {
450 gAudiop->startInternetStream(parcel->getMusicURL()); 450 gAudioStream->startInternetStream(parcel->getMusicURL());
451//awfixme sTitleObserver.init(parcel->getMusicURL());
452 } 451 }
453 } 452 }
454 } 453 }
@@ -456,9 +455,9 @@ void LLOverlayBar::toggleMusicPlay(void*)
456 else 455 else
457 { 456 {
458 gOverlayBar->mMusicState = STOPPED; // desired state 457 gOverlayBar->mMusicState = STOPPED; // desired state
459 if (gAudiop) 458 if (gAudioStream)
460 { 459 {
461 gAudiop->stopInternetStream(); 460 gAudioStream->stopInternetStream();
462 } 461 }
463 } 462 }
464} 463}
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index b744961..0417f61 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -41,6 +41,7 @@
41#endif 41#endif
42#include "llpluginclassmediaowner.h" 42#include "llpluginclassmediaowner.h"
43#include "llviewermedia_streamingaudio.h" 43#include "llviewermedia_streamingaudio.h"
44#include "kokuastreamingaudio.h"
44#include "llaudioengine.h" 45#include "llaudioengine.h"
45 46
46#ifdef LL_FMOD 47#ifdef LL_FMOD
@@ -681,19 +682,13 @@ bool idle_startup()
681 delete gAudiop; 682 delete gAudiop;
682 gAudiop = NULL; 683 gAudiop = NULL;
683 } 684 }
684
685 if (gAudiop)
686 {
687 // if the audio engine hasn't set up its own preferred handler for streaming audio then set up the generic streaming audio implementation which uses media plugins
688 if (NULL == gAudiop->getStreamingAudioImpl())
689 {
690 LL_INFOS("AppInit") << "Using media plugins to render streaming audio" << LL_ENDL;
691 gAudiop->setStreamingAudioImpl(new LLStreamingAudio_MediaPlugins());
692 }
693 }
694 } 685 }
695 } 686 }
696 687
688
689 if (!gAudioStream)
690 gAudioStream = new KOKUAStreamingAudio(new LLStreamingAudio_MediaPlugins());
691
697 LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; 692 LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL;
698 693
699 694
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
47void init_audio() 48void 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
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp
index 3675072..00e3a9a 100644
--- a/linden/indra/newview/llviewercontrol.cpp
+++ b/linden/indra/newview/llviewercontrol.cpp
@@ -38,7 +38,8 @@
38#include "indra_constants.h" 38#include "indra_constants.h"
39 39
40// For Listeners 40// For Listeners
41#include "llaudioengine.h" 41// #include "llaudioengine.h"
42#include "kokuastreamingaudio.h"
42#include "llagent.h" 43#include "llagent.h"
43#include "llconsole.h" 44#include "llconsole.h"
44#include "lldrawpoolterrain.h" 45#include "lldrawpoolterrain.h"
@@ -310,7 +311,7 @@ static bool handleJoystickChanged(const LLSD& newvalue)
310 311
311static bool handleAudioStreamMusicChanged(const LLSD& newvalue) 312static bool handleAudioStreamMusicChanged(const LLSD& newvalue)
312{ 313{
313 if (gAudiop) 314 if (gAudioStream)
314 { 315 {
315 if ( newvalue.asBoolean() ) 316 if ( newvalue.asBoolean() )
316 { 317 {
@@ -319,15 +320,15 @@ static bool handleAudioStreamMusicChanged(const LLSD& newvalue)
319 { 320 {
320 // if stream is already playing, don't call this 321 // if stream is already playing, don't call this
321 // otherwise music will briefly stop 322 // otherwise music will briefly stop
322 if ( !gAudiop->isInternetStreamPlaying() ) 323 if ( !gAudioStream->isInternetStreamPlaying() )
323 { 324 {
324 gAudiop->startInternetStream(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL()); 325 gAudioStream->startInternetStream(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL());
325 } 326 }
326 } 327 }
327 } 328 }
328 else 329 else
329 { 330 {
330 gAudiop->stopInternetStream(); 331 gAudioStream->stopInternetStream();
331 } 332 }
332 } 333 }
333 return true; 334 return true;
diff --git a/linden/indra/newview/llviewermedia_streamingaudio.cpp b/linden/indra/newview/llviewermedia_streamingaudio.cpp
index 575dbc8..4bbc519 100644
--- a/linden/indra/newview/llviewermedia_streamingaudio.cpp
+++ b/linden/indra/newview/llviewermedia_streamingaudio.cpp
@@ -69,6 +69,8 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
69 llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl; 69 llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl;
70 } 70 }
71 71
72 mVersion = mMediaPlugin ? mMediaPlugin->getPluginVersion() : std::string();
73
72 if(!mMediaPlugin) 74 if(!mMediaPlugin)
73 return; 75 return;
74 76
@@ -156,6 +158,11 @@ std::string LLStreamingAudio_MediaPlugins::getURL()
156 return mURL; 158 return mURL;
157} 159}
158 160
161std::string LLStreamingAudio_MediaPlugins::getVersion()
162{
163 return mVersion;
164}
165
159void LLStreamingAudio_MediaPlugins::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) 166void LLStreamingAudio_MediaPlugins::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
160{ 167{
161 if (event == MEDIA_EVENT_NAME_CHANGED) 168 if (event == MEDIA_EVENT_NAME_CHANGED)
diff --git a/linden/indra/newview/llviewermedia_streamingaudio.h b/linden/indra/newview/llviewermedia_streamingaudio.h
index 816e213..5802a31 100644
--- a/linden/indra/newview/llviewermedia_streamingaudio.h
+++ b/linden/indra/newview/llviewermedia_streamingaudio.h
@@ -56,6 +56,7 @@ class LLStreamingAudio_MediaPlugins :
56 /*virtual*/ void setGain(F32 vol); 56 /*virtual*/ void setGain(F32 vol);
57 /*virtual*/ F32 getGain(); 57 /*virtual*/ F32 getGain();
58 /*virtual*/ std::string getURL(); 58 /*virtual*/ std::string getURL();
59 /*virtual*/ std::string getVersion();
59 60
60 // inherited from LLPluginClassMediaOwner 61 // inherited from LLPluginClassMediaOwner
61 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); 62 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
@@ -66,6 +67,7 @@ private:
66 LLPluginClassMedia *mMediaPlugin; 67 LLPluginClassMedia *mMediaPlugin;
67 std::string mURL; 68 std::string mURL;
68 F32 mGain; 69 F32 mGain;
70 std::string mVersion;
69}; 71};
70 72
71 73
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index b589f2e..630da54 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -35,7 +35,7 @@
35#include "llviewerparcelmgr.h" 35#include "llviewerparcelmgr.h"
36 36
37// Library includes 37// Library includes
38#include "llaudioengine.h" 38#include "kokuastreamingaudio.h"
39#include "indra_constants.h" 39#include "indra_constants.h"
40#include "llcachename.h" 40#include "llcachename.h"
41#include "llgl.h" 41#include "llgl.h"
@@ -1672,7 +1672,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1672 else 1672 else
1673 { 1673 {
1674 // look for music. 1674 // look for music.
1675 if (gAudiop) 1675 if (gAudioStream)
1676 { 1676 {
1677 if (parcel) 1677 if (parcel)
1678 { 1678 {
@@ -1685,12 +1685,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1685 // On entering a new parcel, stop the last stream if the 1685 // On entering a new parcel, stop the last stream if the
1686 // new parcel has a different music url. (Empty URL counts 1686 // new parcel has a different music url. (Empty URL counts
1687 // as different.) 1687 // as different.)
1688 const std::string& stream_url = gAudiop->getInternetStreamURL(); 1688 const std::string& stream_url = gAudioStream->getInternetStreamURL();
1689 1689
1690 if (music_url.empty() || music_url != stream_url) 1690 if (music_url.empty() || music_url != stream_url)
1691 { 1691 {
1692 // URL is different from one currently playing. 1692 // URL is different from one currently playing.
1693 gAudiop->stopInternetStream(); 1693 gAudioStream->stopInternetStream();
1694 1694
1695 // If there is a new music URL and it's valid, play it. 1695 // If there is a new music URL and it's valid, play it.
1696 if (music_url.size() > 12) 1696 if (music_url.size() > 12)
@@ -1700,19 +1700,19 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1700 optionally_start_music(music_url); 1700 optionally_start_music(music_url);
1701 } 1701 }
1702 } 1702 }
1703 else if (!gAudiop->getInternetStreamURL().empty()) 1703 else if (!gAudioStream->getInternetStreamURL().empty())
1704 { 1704 {
1705 llinfos << "Stopping parcel music" << llendl; 1705 llinfos << "Stopping parcel music" << llendl;
1706 gAudiop->startInternetStream(LLStringUtil::null); 1706 gAudioStream->startInternetStream(LLStringUtil::null);
1707 } 1707 }
1708 } 1708 }
1709 } 1709 }
1710 else 1710 else
1711 { 1711 {
1712 // Public land has no music 1712 // Public land has no music
1713 gAudiop->stopInternetStream(); 1713 gAudioStream->stopInternetStream();
1714 } 1714 }
1715 }//if gAudiop 1715 }//if gAudioStream
1716 1716
1717 // now check for video 1717 // now check for video
1718 LLViewerParcelMedia::update( parcel ); 1718 LLViewerParcelMedia::update( parcel );
@@ -1730,7 +1730,7 @@ void optionally_start_music(const std::string& music_url)
1730 // changed as part of SL-4878 1730 // changed as part of SL-4878
1731 if ( gOverlayBar && gOverlayBar->musicPlaying()) 1731 if ( gOverlayBar && gOverlayBar->musicPlaying())
1732 { 1732 {
1733 gAudiop->startInternetStream(music_url); 1733 gAudioStream->startInternetStream(music_url);
1734 } 1734 }
1735 } 1735 }
1736} 1736}