diff options
Diffstat (limited to 'indra/newview/llvoicevisualizer.cpp')
-rw-r--r-- | indra/newview/llvoicevisualizer.cpp | 76 |
1 files changed, 47 insertions, 29 deletions
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 47060720e7..d380a8672f 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -45,6 +45,7 @@ //29de489d-0491-fb00-7dab-f9e686d31e83 +#ifdef XXX_STINSON_CHUI_REWORK //-------------------------------------------------------------------------------------- // sound symbol constants //-------------------------------------------------------------------------------------- @@ -60,6 +61,7 @@ const F32 BASE_BRIGHTNESS = 0.7f; // gray level of the voice indicator when qu const F32 DOT_SIZE = 0.05f; // size of the dot billboard texture const F32 DOT_OPACITY = 0.7f; // how opaque the dot is const F32 WAVE_MOTION_RATE = 1.5f; // scalar applied to consecutive waves as a function of speaking amplitude +#endif // XXX_STINSON_CHUI_REWORK //-------------------------------------------------------------------------------------- // gesticulation constants @@ -67,22 +69,13 @@ const F32 WAVE_MOTION_RATE = 1.5f; // scalar applied to consecutive waves as a const F32 DEFAULT_MINIMUM_GESTICULATION_AMPLITUDE = 0.2f; const F32 DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE = 1.0f; +#ifdef XXX_STINSON_CHUI_REWORK //-------------------------------------------------------------------------------------- // other constants //-------------------------------------------------------------------------------------- const F32 ONE_HALF = 1.0f; // to clarify intent and reduce magic numbers in the code. const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is up in SL - - -//------------------------------------------------------------------ -// handles parameter updates -//------------------------------------------------------------------ -static bool handleVoiceVisualizerPrefsChanged(const LLSD& newvalue) -{ - // Note: Ignore the specific event value, we look up the ones we want - LLVoiceVisualizer::setPreferences(); - return true; -} +#endif // XXX_STINSON_CHUI_REWORK //------------------------------------------------------------------ // Initialize the statics @@ -105,12 +98,28 @@ F32 LLVoiceVisualizer::sAahPowerTransfersf = 0.0f; //----------------------------------------------- // constructor //----------------------------------------------- +#ifdef XXX_STINSON_CHUI_REWORK LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) -:LLHUDEffect( type ) + : LLHUDEffect(type) +#else // XXX_STINSON_CHUI_REWORK +LLVoiceVisualizer::LLVoiceVisualizer() + : LLRefCount(), + mTimer(), + mStartTime(0.0), + mCurrentlySpeaking(false), + mSpeakingAmplitude(0.0f), + mMaxGesticulationAmplitude(DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE), + mMinGesticulationAmplitude(DEFAULT_MINIMUM_GESTICULATION_AMPLITUDE) +#endif // XXX_STINSON_CHUI_REWORK { +#ifdef XXX_STINSON_CHUI_REWORK mCurrentTime = mTimer.getTotalSeconds(); mPreviousTime = mCurrentTime; mStartTime = mCurrentTime; +#else // XXX_STINSON_CHUI_REWORK + mStartTime = mTimer.getTotalSeconds(); +#endif // XXX_STINSON_CHUI_REWORK +#ifdef XXX_STINSON_CHUI_REWORK mVoiceSourceWorldPosition = LLVector3( 0.0f, 0.0f, 0.0f ); mSpeakingAmplitude = 0.0f; mCurrentlySpeaking = false; @@ -119,9 +128,11 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) mMaxGesticulationAmplitude = DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE; mSoundSymbol.mActive = true; mSoundSymbol.mPosition = LLVector3( 0.0f, 0.0f, 0.0f ); +#endif // XXX_STINSON_CHUI_REWORK mTimer.reset(); +#ifdef XXX_STINSON_CHUI_REWORK const char* sound_level_img[] = { "voice_meter_dot.j2c", @@ -143,6 +154,7 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) } mSoundSymbol.mTexture[0]->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC); +#endif // XXX_STINSON_CHUI_REWORK // The first instance loads the initial state from prefs. if (!sPrefsInitialized) @@ -150,18 +162,19 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) setPreferences(); // Set up our listener to get updates on all prefs values we care about. - gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); - gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); - gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); - gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); - gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); - gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged, _2)); sPrefsInitialized = true; } }//--------------------------------------------------- +#ifdef XXX_STINSON_CHUI_REWORK //--------------------------------------------------- void LLVoiceVisualizer::setMinGesticulationAmplitude( F32 m ) { @@ -182,13 +195,16 @@ void LLVoiceVisualizer::setVoiceEnabled( bool v ) mVoiceEnabled = v; }//--------------------------------------------------- +#endif // XXX_STINSON_CHUI_REWORK //--------------------------------------------------- void LLVoiceVisualizer::setStartSpeaking() { mStartTime = mTimer.getTotalSeconds(); mCurrentlySpeaking = true; +#ifdef XXX_STINSON_CHUI_REWORK mSoundSymbol.mActive = true; +#endif // XXX_STINSON_CHUI_REWORK }//--------------------------------------------------- @@ -217,6 +233,15 @@ void LLVoiceVisualizer::setSpeakingAmplitude( F32 a ) }//--------------------------------------------------- +//------------------------------------------------------------------ +// handles parameter updates +//------------------------------------------------------------------ +bool LLVoiceVisualizer::handleVoiceVisualizerPrefsChanged(const LLSD& newvalue) +{ + // Note: Ignore the specific event value, we look up the ones we want + LLVoiceVisualizer::setPreferences(); + return true; +} //--------------------------------------------------- void LLVoiceVisualizer::setPreferences( ) @@ -334,6 +359,7 @@ void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah ) }//--------------------------------------------------- +#ifdef XXX_STINSON_CHUI_REWORK //--------------------------------------------------- // this method is inherited from HUD Effect //--------------------------------------------------- @@ -526,16 +552,13 @@ void LLVoiceVisualizer::render() }//--------------------------------------------------- - - - - //--------------------------------------------------- void LLVoiceVisualizer::setVoiceSourceWorldPosition( const LLVector3 &p ) { mVoiceSourceWorldPosition = p; }//--------------------------------------------------- +#endif // XXX_STINSON_CHUI_REWORK //--------------------------------------------------- VoiceGesticulationLevel LLVoiceVisualizer::getCurrentGesticulationLevel() @@ -566,6 +589,7 @@ LLVoiceVisualizer::~LLVoiceVisualizer() }//---------------------------------------------- +#ifdef XXX_STINSON_CHUI_REWORK //--------------------------------------------------- // "packData" is inherited from HUDEffect //--------------------------------------------------- @@ -616,10 +640,4 @@ void LLVoiceVisualizer::markDead() LLHUDEffect::markDead(); }//------------------------------------------------------------------ - - - - - - - +#endif // XXX_STINSON_CHUI_REWORK |