diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llvieweraudio.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmgr.h | 6 |
4 files changed, 25 insertions, 6 deletions
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 2447f5dea8..0114c292dc 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -53,11 +53,14 @@ LLViewerAudio::LLViewerAudio() : { mTeleportFailedConnection = LLViewerParcelMgr::getInstance()-> setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this)); + mTeleportFinishedConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLViewerAudio::onTeleportFinished, this, _1, _2)); } LLViewerAudio::~LLViewerAudio() { mTeleportFailedConnection.disconnect(); + mTeleportFinishedConnection.disconnect(); } void LLViewerAudio::registerIdleListener() @@ -253,6 +256,19 @@ void LLViewerAudio::onTeleportFailed() if (parcel) { mNextStreamURI = parcel->getMusicURL(); + llinfos << "Teleport failed -- resetting music stream" << llendl; + } + } +} + +void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) +{ + if (gAudiop && local) + { + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + LLViewerParcelMgr::optionally_start_music(parcel->getMusicURL()); } } } diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index a3da9fc6b8..d3a7d74de2 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -77,11 +77,13 @@ private: bool mIdleListnerActive; bool mForcedTeleportFade; boost::signals2::connection mTeleportFailedConnection; + boost::signals2::connection mTeleportFinishedConnection; void registerIdleListener(); void deregisterIdleListener() { mIdleListnerActive = false; }; void startFading(); void onTeleportFailed(); + void onTeleportFinished(const LLVector3d& pos, const bool& local); }; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 9db784101d..a89fafdc62 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -82,7 +82,6 @@ LLPointer<LLViewerTexture> sBlockedImage; LLPointer<LLViewerTexture> sPassImage; // Local functions -void optionally_start_music(const std::string& music_url); void callback_start_music(S32 option, void* data); void optionally_prepare_video(const LLParcel *parcelp); void callback_prepare_video(S32 option, void* data); @@ -1589,7 +1588,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; - instance->mTeleportFinishedSignal(gAgent.getPositionGlobal()); + instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); } } } @@ -1773,7 +1772,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use }; } -void optionally_start_music(const std::string& music_url) +void LLViewerParcelMgr::optionally_start_music(const std::string& music_url) { if (gSavedSettings.getBOOL("AudioStreamingMusic")) { @@ -2559,7 +2558,7 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos { // Local teleport. We already have the agent parcel data. // Emit the signal immediately. - getInstance()->mTeleportFinishedSignal(new_pos); + getInstance()->mTeleportFinishedSignal(new_pos, local); } else { diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index cac8d8391c..2a11549426 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -78,8 +78,8 @@ class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr> { public: - typedef boost::function<void (const LLVector3d&)> teleport_finished_callback_t; - typedef boost::signals2::signal<void (const LLVector3d&)> teleport_finished_signal_t; + typedef boost::function<void (const LLVector3d&, const bool& local)> teleport_finished_callback_t; + typedef boost::signals2::signal<void (const LLVector3d&, const bool&)> teleport_finished_signal_t; typedef boost::function<void()> parcel_changed_callback_t; typedef boost::signals2::signal<void()> parcel_changed_signal_t; @@ -275,6 +275,8 @@ public: // *NOTE: Taken out 2005-03-21. Phoenix. //void makeLandmarkAtSelection(); + static void optionally_start_music(const std::string& music_url); + static void processParcelOverlay(LLMessageSystem *msg, void **user_data); static void processParcelProperties(LLMessageSystem *msg, void **user_data); static void processParcelAccessListReply(LLMessageSystem *msg, void **user); |