summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.h
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-02-25 16:50:21 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-02-25 16:50:21 -0800
commit5ed6e0720af1b6cdf1a983e2c040eeb5d8ae33ba (patch)
tree5d0141f43cfaf59e5cb62eb2f4ca9541160e6173 /indra/newview/llvoiceclient.h
parent3ab4b0f58326a01a09aa99f262c03d2703215af2 (diff)
parent6e932911d5b0a02b44caf3bf81a9c00fd0e1dc89 (diff)
warn-on-failure:unix-eol
automated merge from trunk
Diffstat (limited to 'indra/newview/llvoiceclient.h')
-rw-r--r--indra/newview/llvoiceclient.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index dce24ff541..60f2b74d11 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -403,6 +403,48 @@ protected:
LLPumpIO *m_servicePump;
};
+/**
+ * Speaker volume storage helper class
+ **/
+
+class LLSpeakerVolumeStorage : public LLSingleton<LLSpeakerVolumeStorage>
+{
+ LOG_CLASS(LLSpeakerVolumeStorage);
+public:
+
+ /**
+ * Sets internal voluem level for specified user.
+ *
+ * @param[in] speaker_id - LLUUID of user to store volume level for
+ * @param[in] volume - internal volume level to be stored for user.
+ */
+ void storeSpeakerVolume(const LLUUID& speaker_id, S32 volume);
+
+ /**
+ * Gets stored internal volume level for specified speaker.
+ *
+ * If specified user is not found default level will be returned. It is equivalent of
+ * external level 0.5 from the 0.0..1.0 range.
+ * Default internal level is calculated as: internal = 400 * external^2
+ * Maps 0.0 to 1.0 to internal values 0-400 with default 0.5 == 100
+ *
+ * @param[in] speaker_id - LLUUID of user to get his volume level
+ */
+ S32 getSpeakerVolume(const LLUUID& speaker_id);
+
+private:
+ friend class LLSingleton<LLSpeakerVolumeStorage>;
+ LLSpeakerVolumeStorage();
+ ~LLSpeakerVolumeStorage();
+
+ const static std::string SETTINGS_FILE_NAME;
+
+ void load();
+ void save();
+
+ typedef std::map<LLUUID, S32> speaker_data_map_t;
+ speaker_data_map_t mSpeakersData;
+};
#endif //LL_VOICE_CLIENT_H