Skip to content
Snippets Groups Projects
Commit bce1630e authored by maxim_productengine's avatar maxim_productengine
Browse files

SL-10780 FIXED Speaker icon is shown for all friends

parent ec9a70de
Branches
Tags
No related merge requests found
......@@ -119,6 +119,7 @@ BOOL LLAvatarListItem::postBuild()
mIconPermissionEditTheirs->setVisible(false);
mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
mSpeakingIndicator->setChannelState(LLOutputMonitorCtrl::UNDEFINED_CHANNEL);
mInfoBtn = getChild<LLButton>("info_btn");
mProfileBtn = getChild<LLButton>("profile_btn");
......
......@@ -74,9 +74,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
mSpeakerId(p.speaker_id),
mIsModeratorMuted(false),
mIsAgentControl(false),
mIsActiveChannel(false),
mIndicatorToggled(false),
mShowParticipantsSpeaking(false)
mShowParticipantsSpeaking(false),
mChannelState(INACTIVE_CHANNEL)
{
//static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange);
//static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red);
......@@ -259,8 +259,13 @@ BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
void LLOutputMonitorCtrl::setIsActiveChannel(bool val)
{
mIsActiveChannel = val;
if (!val)
setChannelState(val ? ACTIVE_CHANNEL : INACTIVE_CHANNEL);
}
void LLOutputMonitorCtrl::setChannelState(EChannelState state)
{
mChannelState = state;
if (state == INACTIVE_CHANNEL)
{
// switchIndicator will set it to TRUE when channel becomes active
setVisible(FALSE);
......@@ -316,7 +321,7 @@ void LLOutputMonitorCtrl::onChange()
// virtual
void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
{
if (mIsActiveChannel && getVisible() != (BOOL)switch_on)
if ((mChannelState != INACTIVE_CHANNEL) && (getVisible() != (BOOL)switch_on))
{
setVisible(switch_on);
......
......@@ -81,8 +81,16 @@ class LLOutputMonitorCtrl
void setIsAgentControl(bool val) { mIsAgentControl = val; }
void setIsTalking(bool val) { mIsTalking = val; }
enum EChannelState
{
ACTIVE_CHANNEL,
INACTIVE_CHANNEL,
UNDEFINED_CHANNEL
};
// switchIndicator controls visibility, 'active channel' governs if we are allowed to show indicator
void setIsActiveChannel(bool val);
void setChannelState(EChannelState state);
void setShowParticipantsSpeaking(bool show) { mShowParticipantsSpeaking = show; }
......@@ -139,7 +147,6 @@ class LLOutputMonitorCtrl
bool mIsModeratorMuted;
bool mIsMuted;
bool mIsTalking;
bool mIsActiveChannel;
bool mShowParticipantsSpeaking;
LLPointer<LLUIImage> mImageMute;
LLPointer<LLUIImage> mImageOff;
......@@ -155,6 +162,8 @@ class LLOutputMonitorCtrl
LLUUID mSpeakerId;
bool mIndicatorToggled;
EChannelState mChannelState;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment