summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevisualizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevisualizer.h')
-rw-r--r--indra/newview/llvoicevisualizer.h60
1 files changed, 38 insertions, 22 deletions
diff --git a/indra/newview/llvoicevisualizer.h b/indra/newview/llvoicevisualizer.h
index 3543f254db..e434c7f3f1 100644
--- a/indra/newview/llvoicevisualizer.h
+++ b/indra/newview/llvoicevisualizer.h
@@ -2,30 +2,25 @@
* @file llvoicevisualizer.h
* @brief Draws in-world speaking indicators.
*
- * $LicenseInfo:firstyear=2000&license=viewergpl$
- *
- * Copyright (c) 2000-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2000&license=viewerlgpl$
* 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://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * 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://secondlife.com/developers/opensource/flossexception
+ * 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.
*
- * 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.
+ * 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.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * 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
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -90,7 +85,9 @@ class LLVoiceVisualizer : public LLHUDEffect
void setStopSpeaking(); // tell me when the av stops speaking
bool getCurrentlySpeaking(); // the get for the above set
VoiceGesticulationLevel getCurrentGesticulationLevel(); // based on voice amplitude, I'll give you the current "energy level" of avatar speech
-
+ static void setPreferences( );
+ static void lipStringToF32s ( std::string& in_string, F32*& out_F32s, U32& count_F32s ); // convert a string of digits to an array of floats
+ void lipSyncOohAah( F32& ooh, F32& aah );
void render(); // inherited from HUD Effect
void packData(LLMessageSystem *mesgsys); // inherited from HUD Effect
void unpackData(LLMessageSystem *mesgsys, S32 blocknum); // inherited from HUD Effect
@@ -118,12 +115,13 @@ class LLVoiceVisualizer : public LLHUDEffect
bool mWaveActive [ NUM_VOICE_SYMBOL_WAVES ];
F64 mWaveFadeOutStartTime [ NUM_VOICE_SYMBOL_WAVES ];
F32 mWaveOpacity [ NUM_VOICE_SYMBOL_WAVES ];
- LLPointer<LLImageGL> mTexture [ NUM_VOICE_SYMBOL_WAVES ];
+ LLPointer<LLViewerFetchedTexture> mTexture [ NUM_VOICE_SYMBOL_WAVES ];
bool mActive;
LLVector3 mPosition;
};
LLFrameTimer mTimer; // so I can ask the current time in seconds
+ F64 mStartTime; // time in seconds when speaking started
F64 mCurrentTime; // current time in seconds, captured every step
F64 mPreviousTime; // copy of "current time" from last frame
SoundSymbol mSoundSymbol; // the sound symbol that appears over the avatar's head
@@ -134,6 +132,24 @@ class LLVoiceVisualizer : public LLHUDEffect
F32 mMaxGesticulationAmplitude; // this is the upper-limit of the envelope of detectable gesticulation leves
F32 mMinGesticulationAmplitude; // this is the lower-limit of the envelope of detectable gesticulation leves
+ //---------------------------------------------------
+ // private static members
+ //---------------------------------------------------
+
+ static BOOL sLipSyncEnabled; // 0 disabled, 1 babble loop
+ static bool sPrefsInitialized; // the first instance will initialize the static members
+ static F32* sOoh; // the babble loop of amplitudes for the ooh morph
+ static F32* sAah; // the babble loop of amplitudes for the ooh morph
+ static U32 sOohs; // the number of entries in the ooh loop
+ static U32 sAahs; // the number of entries in the aah loop
+ static F32 sOohAahRate; // frames per second for the babble loop
+ static F32* sOohPowerTransfer; // the power transfer characteristics for the ooh amplitude
+ static U32 sOohPowerTransfers; // the number of entries in the ooh transfer characteristics
+ static F32 sOohPowerTransfersf; // the number of entries in the ooh transfer characteristics as a float
+ static F32* sAahPowerTransfer; // the power transfer characteristics for the aah amplitude
+ static U32 sAahPowerTransfers; // the number of entries in the aah transfer characteristics
+ static F32 sAahPowerTransfersf; // the number of entries in the aah transfer characteristics as a float
+
};//-----------------------------------------------------------------
// end of LLVoiceVisualizer class
//------------------------------------------------------------------