summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.h')
-rw-r--r--indra/newview/llvoicevivox.h228
1 files changed, 49 insertions, 179 deletions
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index d10a562616..59fec8b954 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -2,25 +2,31 @@
* @file llvoicevivox.h
* @brief Declaration of LLDiamondwareVoiceClient class which is the interface to the voice client process.
*
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-2010, Linden Research, Inc.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
*
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_VOICE_VIVOX_H
@@ -51,9 +57,15 @@ class LLVivoxVoiceClientMuteListObserver;
class LLVivoxVoiceClientFriendsObserver;
-class LLVivoxVoiceClient : public LLSingleton<LLVivoxVoiceClient>,
- virtual public LLVoiceModuleInterface,
- virtual public LLVoiceEffectInterface
+class LLVivoxVoiceClientParticipantObserver
+{
+public:
+ virtual ~LLVivoxVoiceClientParticipantObserver() { }
+ virtual void onChange() = 0;
+};
+
+
+class LLVivoxVoiceClient: public LLSingleton<LLVivoxVoiceClient>, virtual public LLVoiceModuleInterface
{
LOG_CLASS(LLVivoxVoiceClient);
public:
@@ -72,7 +84,7 @@ public:
virtual void updateSettings(); // call after loading settings and whenever they change
// Returns true if vivox has successfully logged in and is not in error state
- virtual bool isVoiceWorking() const;
+ virtual bool isVoiceWorking();
/////////////////////
/// @name Tuning
@@ -220,49 +232,15 @@ public:
virtual void removeObserver(LLFriendObserver* observer);
virtual void addObserver(LLVoiceClientParticipantObserver* observer);
virtual void removeObserver(LLVoiceClientParticipantObserver* observer);
+
+
+
//@}
virtual std::string sipURIFromID(const LLUUID &id);
//@}
- /// @name LLVoiceEffectInterface virtual implementations
- /// @see LLVoiceEffectInterface
- //@{
-
- //////////////////////////
- /// @name Accessors
- //@{
- virtual bool setVoiceEffect(const LLUUID& id);
- virtual const LLUUID getVoiceEffect();
- virtual LLSD getVoiceEffectProperties(const LLUUID& id);
-
- virtual void refreshVoiceEffectLists(bool clear_lists);
- virtual const voice_effect_list_t& getVoiceEffectList() const;
- virtual const voice_effect_list_t& getVoiceEffectTemplateList() const;
- //@}
-
- //////////////////////////////
- /// @name Status notification
- //@{
- virtual void addObserver(LLVoiceEffectObserver* observer);
- virtual void removeObserver(LLVoiceEffectObserver* observer);
- //@}
-
- //////////////////////////////
- /// @name Effect preview buffer
- //@{
- virtual void enablePreviewBuffer(bool enable);
- virtual void recordPreviewBuffer();
- virtual void playPreviewBuffer(const LLUUID& effect_id = LLUUID::null);
- virtual void stopPreviewBuffer();
-
- virtual bool isPreviewRecording();
- virtual bool isPreviewPlaying();
- //@}
-
- //@}
-
-
+
protected:
//////////////////////
// Vivox Specific definitions
@@ -300,13 +278,14 @@ protected:
bool mIsSpeaking;
bool mIsModeratorMuted;
bool mOnMuteList; // true if this avatar is on the user's mute list (and should be muted)
- bool mVolumeSet; // true if incoming volume messages should not change the volume
+ bool mVolumeSet; // true if incoming volume messages should not change the volume
bool mVolumeDirty; // true if this participant needs a volume command sent (either mOnMuteList or mUserVolume has changed)
bool mAvatarIDValid;
bool mIsSelf;
};
typedef std::map<const std::string, participantState*> participantMap;
+
typedef std::map<const LLUUID, participantState*> participantUUIDMap;
struct sessionState
@@ -353,17 +332,14 @@ protected:
bool mIncoming;
bool mVoiceEnabled;
bool mReconnect; // Whether we should try to reconnect to this session if it's dropped
-
- // Set to true when the volume/mute state of someone in the participant list changes.
+ // Set to true when the mute state of someone in the participant list changes.
// The code will have to walk the list to find the changed participant(s).
bool mVolumeDirty;
- bool mMuteDirty;
-
+ bool mMuteDirty;
+
bool mParticipantsChanged;
participantMap mParticipantsByURI;
participantUUIDMap mParticipantsByUUID;
-
- LLUUID mVoiceFontID;
};
// internal state for a simple state machine. This is used to deal with the asynchronous nature of some of the messages.
@@ -380,11 +356,6 @@ protected:
stateMicTuningStart,
stateMicTuningRunning,
stateMicTuningStop,
- stateCaptureBufferPaused,
- stateCaptureBufferRecStart,
- stateCaptureBufferRecording,
- stateCaptureBufferPlayStart,
- stateCaptureBufferPlaying,
stateConnectorStart, // connector needs to be started
stateConnectorStarting, // waiting for connector handle
stateConnectorStarted, // connector handle received
@@ -393,8 +364,6 @@ protected:
stateNeedsLogin, // send login request
stateLoggingIn, // waiting for account handle
stateLoggedIn, // account handle received
- stateVoiceFontsWait, // Awaiting the list of voice fonts
- stateVoiceFontsReceived, // List of voice fonts received
stateCreatingSessionGroup, // Creating the main session group
stateNoChannel, //
stateJoiningSession, // waiting for session handle
@@ -467,6 +436,8 @@ protected:
void tuningCaptureStartSendMessage(int duration);
void tuningCaptureStopSendMessage();
+ bool inTuningStates();
+
//----------------------------------
// devices
void clearCaptureDevices();
@@ -493,7 +464,6 @@ protected:
void connectorShutdownResponse(int statusCode, std::string &statusString);
void accountLoginStateChangeEvent(std::string &accountHandle, int statusCode, std::string &statusString, int state);
- void mediaCompletionEvent(std::string &sessionGroupHandle, std::string &mediaCompletionType);
void mediaStreamUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, int statusCode, std::string &statusString, int state, bool incoming);
void textStreamUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, bool enabled, int state, bool incoming);
void sessionAddedEvent(std::string &uriString, std::string &alias, std::string &sessionHandle, std::string &sessionGroupHandle, bool isChannel, bool incoming, std::string &nameString, std::string &applicationString);
@@ -621,8 +591,8 @@ protected:
void deleteAllAutoAcceptRules(void);
void addAutoAcceptRule(const std::string &autoAcceptMask, const std::string &autoAddAsBuddy);
void accountListBlockRulesResponse(int statusCode, const std::string &statusString);
- void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString);
-
+ void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString);
+
/////////////////////////////
// session control messages
@@ -651,21 +621,7 @@ protected:
void lookupName(const LLUUID &id);
static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
void avatarNameResolved(const LLUUID &id, const std::string &name);
-
- /////////////////////////////
- // Voice fonts
-
- void addVoiceFont(const S32 id,
- const std::string &name,
- const std::string &description,
- const LLDate &expiration_date,
- bool has_expired,
- const S32 font_type,
- const S32 font_status,
- const bool template_font = false);
- void accountGetSessionFontsResponse(int statusCode, const std::string &statusString);
- void accountGetTemplateFontsResponse(int statusCode, const std::string &statusString);
-
+
private:
LLVoiceVersionInfo mVoiceVersion;
@@ -848,88 +804,6 @@ private:
typedef std::set<LLFriendObserver*> friend_observer_set_t;
friend_observer_set_t mFriendObservers;
void notifyFriendObservers();
-
- // Voice Fonts
-
- void expireVoiceFonts();
- void deleteVoiceFont(const LLUUID& id);
- void deleteAllVoiceFonts();
- void deleteVoiceFontTemplates();
-
- S32 getVoiceFontIndex(const LLUUID& id) const;
- S32 getVoiceFontTemplateIndex(const LLUUID& id) const;
-
- void accountGetSessionFontsSendMessage();
- void accountGetTemplateFontsSendMessage();
- void sessionSetVoiceFontSendMessage(sessionState *session);
-
- void notifyVoiceFontObservers();
-
- typedef enum e_voice_font_type
- {
- VOICE_FONT_TYPE_NONE = 0,
- VOICE_FONT_TYPE_ROOT = 1,
- VOICE_FONT_TYPE_USER = 2,
- VOICE_FONT_TYPE_UNKNOWN
- } EVoiceFontType;
-
- typedef enum e_voice_font_status
- {
- VOICE_FONT_STATUS_NONE = 0,
- VOICE_FONT_STATUS_FREE = 1,
- VOICE_FONT_STATUS_NOT_FREE = 2,
- VOICE_FONT_STATUS_UNKNOWN
- } EVoiceFontStatus;
-
- struct voiceFontEntry
- {
- voiceFontEntry(LLUUID& id);
- ~voiceFontEntry();
-
- LLUUID mID;
- S32 mFontIndex;
- std::string mName;
- LLDate mExpirationDate;
- S32 mFontType;
- S32 mFontStatus;
- bool mIsNew;
-
- LLFrameTimer mExpiryTimer;
- LLFrameTimer mExpiryWarningTimer;
- };
-
- bool mVoiceFontsReceived;
- bool mVoiceFontsNew;
- bool mVoiceFontListDirty;
- voice_effect_list_t mVoiceFontList;
- voice_effect_list_t mVoiceFontTemplateList;
-
- typedef std::map<const LLUUID, voiceFontEntry*> voice_font_map_t;
- voice_font_map_t mVoiceFontMap;
- voice_font_map_t mVoiceFontTemplateMap;
-
- typedef std::set<LLVoiceEffectObserver*> voice_font_observer_set_t;
- voice_font_observer_set_t mVoiceFontObservers;
-
- LLFrameTimer mVoiceFontExpiryTimer;
-
-
- // Audio capture buffer
-
- void captureBufferRecordStartSendMessage();
- void captureBufferRecordStopSendMessage();
- void captureBufferPlayStartSendMessage(const LLUUID& voice_font_id = LLUUID::null);
- void captureBufferPlayStopSendMessage();
-
- bool mCaptureBufferMode; // Disconnected from voice channels while using the capture buffer.
- bool mCaptureBufferRecording; // A voice sample is being captured.
- bool mCaptureBufferRecorded; // A voice sample is captured in the buffer ready to play.
- bool mCaptureBufferPlaying; // A voice sample is being played.
-
- LLTimer mCaptureTimer;
- LLUUID mPreviewVoiceFont;
- LLUUID mPreviewVoiceFontLast;
- S32 mPlayRequestCount;
};
/**
@@ -1016,13 +890,7 @@ protected:
int numberOfAliases;
std::string subscriptionHandle;
std::string subscriptionType;
- S32 id;
- std::string descriptionString;
- LLDate expirationDate;
- bool hasExpired;
- S32 fontType;
- S32 fontStatus;
- std::string mediaCompletionType;
+
// Members for processing text between tags
std::string textBuffer;
@@ -1039,9 +907,11 @@ protected:
void StartTag(const char *tag, const char **attr);
void EndTag(const char *tag);
void CharData(const char *buffer, int length);
- LLDate expiryTimeStampToLLDate(const std::string& vivox_ts);
+
};
#endif //LL_VIVOX_VOICE_CLIENT_H
+
+