Commits

Anonymous committed 7f29d6f

STORM-1812 First pass at adding teleport started signal

Comments (0)

Files changed (4)

indra/newview/llvieweraudio.cpp

 #include "llstartup.h"
 #include "llviewerparcelmgr.h"
 #include "llparcel.h"
+#include "llviewermessage.h"
 
 /////////////////////////////////////////////////////////
 
 		setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this));
 	mTeleportFinishedConnection = LLViewerParcelMgr::getInstance()->
 		setTeleportFinishedCallback(boost::bind(&LLViewerAudio::onTeleportFinished, this, _1, _2));
+	mTeleportStartedConnection = LLViewerMessage::getInstance()->
+		setTeleportStartedCallback(boost::bind(&LLViewerAudio::onTeleportStarted, this));
 }
 
 LLViewerAudio::~LLViewerAudio()
 	return fade_volume;
 }
 
+void LLViewerAudio::onTeleportStarted()
+{
+llwarns << "DBG teleport started" << llendl;
+}
+
 void LLViewerAudio::onTeleportFailed()
 {
 	// Calling audio_update_volume makes sure that the music stream is properly set to be restored to

indra/newview/llvieweraudio.h

 	bool mWasPlaying;
 	boost::signals2::connection	mTeleportFailedConnection;
 	boost::signals2::connection	mTeleportFinishedConnection;
+	boost::signals2::connection mTeleportStartedConnection;
 
 	void registerIdleListener();
 	void deregisterIdleListener() { mIdleListnerActive = false; };
 	void startFading();
 	void onTeleportFailed();
 	void onTeleportFinished(const LLVector3d& pos, const bool& local);
-
+	void onTeleportStarted();
 };
 
 #endif //LL_VIEWER_H

indra/newview/llviewermessage.cpp

 	}
 }
 
+boost::signals2::connection LLViewerMessage::setTeleportStartedCallback(teleport_started_callback_t cb)
+{
+	return mTeleportStartedSignal.connect(cb);
+}
+
 void process_teleport_progress(LLMessageSystem* msg, void**)
 {
 	LLUUID agent_id;

indra/newview/llviewermessage.h

 void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid);
 void set_dad_inbox_object(const LLUUID& object_id);
 
+class LLViewerMessage : public  LLSingleton<LLViewerMessage>
+{
+public:
+	typedef boost::function<void()> teleport_started_callback_t;
+	typedef boost::signals2::signal<void()> teleport_started_signal_t;
+	boost::signals2::connection setTeleportStartedCallback(teleport_started_callback_t cb);
+
+protected:
+	teleport_started_signal_t	mTeleportStartedSignal;
+};
 
 class LLOfferInfo : public LLNotificationResponderInterface
 {
 void process_feature_disabled_message(LLMessageSystem* msg, void**);
 
 #endif
-
-