diff options
Diffstat (limited to 'linden/indra/newview/llfloateractivespeakers.cpp')
-rw-r--r-- | linden/indra/newview/llfloateractivespeakers.cpp | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloateractivespeakers.cpp b/linden/indra/newview/llfloateractivespeakers.cpp index 4561110..a8f3f91 100644 --- a/linden/indra/newview/llfloateractivespeakers.cpp +++ b/linden/indra/newview/llfloateractivespeakers.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | 7 | * Copyright (c) 2005-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -47,6 +47,7 @@ | |||
47 | #include "llsdutil.h" | 47 | #include "llsdutil.h" |
48 | #include "llimview.h" | 48 | #include "llimview.h" |
49 | #include "llviewerwindow.h" | 49 | #include "llviewerwindow.h" |
50 | #include "llappviewer.h" | ||
50 | 51 | ||
51 | const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers | 52 | const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers |
52 | const F32 RESORT_TIMEOUT = 5.f; // seconds of mouse inactivity before it's ok to sort regardless of mouse-in-view. | 53 | const F32 RESORT_TIMEOUT = 5.f; // seconds of mouse inactivity before it's ok to sort regardless of mouse-in-view. |
@@ -546,7 +547,8 @@ void LLPanelActiveSpeakers::refreshSpeakers() | |||
546 | && gVoiceClient->getVoiceEnabled(selected_id) | 547 | && gVoiceClient->getVoiceEnabled(selected_id) |
547 | && selected_id.notNull() | 548 | && selected_id.notNull() |
548 | && selected_id != gAgent.getID() | 549 | && selected_id != gAgent.getID() |
549 | && (selected_speakerp.notNull() && selected_speakerp->mType == LLSpeaker::SPEAKER_AGENT)); | 550 | && (selected_speakerp.notNull() && (selected_speakerp->mType == LLSpeaker::SPEAKER_AGENT || selected_speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL))); |
551 | |||
550 | } | 552 | } |
551 | if (mMuteTextCtrl) | 553 | if (mMuteTextCtrl) |
552 | { | 554 | { |
@@ -554,6 +556,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() | |||
554 | mMuteTextCtrl->setEnabled(selected_id.notNull() | 556 | mMuteTextCtrl->setEnabled(selected_id.notNull() |
555 | && selected_id != gAgent.getID() | 557 | && selected_id != gAgent.getID() |
556 | && selected_speakerp.notNull() | 558 | && selected_speakerp.notNull() |
559 | && selected_speakerp->mType != LLSpeaker::SPEAKER_EXTERNAL | ||
557 | && !LLMuteList::getInstance()->isLinden(selected_speakerp->mDisplayName)); | 560 | && !LLMuteList::getInstance()->isLinden(selected_speakerp->mDisplayName)); |
558 | } | 561 | } |
559 | childSetValue("speaker_volume", gVoiceClient->getUserVolume(selected_id)); | 562 | childSetValue("speaker_volume", gVoiceClient->getUserVolume(selected_id)); |
@@ -561,7 +564,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() | |||
561 | && gVoiceClient->getVoiceEnabled(selected_id) | 564 | && gVoiceClient->getVoiceEnabled(selected_id) |
562 | && selected_id.notNull() | 565 | && selected_id.notNull() |
563 | && selected_id != gAgent.getID() | 566 | && selected_id != gAgent.getID() |
564 | && (selected_speakerp.notNull() && selected_speakerp->mType == LLSpeaker::SPEAKER_AGENT)); | 567 | && (selected_speakerp.notNull() && (selected_speakerp->mType == LLSpeaker::SPEAKER_AGENT || selected_speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL))); |
565 | 568 | ||
566 | childSetEnabled( | 569 | childSetEnabled( |
567 | "moderator_controls_label", | 570 | "moderator_controls_label", |
@@ -579,7 +582,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() | |||
579 | 582 | ||
580 | if (mProfileBtn) | 583 | if (mProfileBtn) |
581 | { | 584 | { |
582 | mProfileBtn->setEnabled(selected_id.notNull()); | 585 | mProfileBtn->setEnabled(selected_id.notNull() && (selected_speakerp.notNull() && selected_speakerp->mType != LLSpeaker::SPEAKER_EXTERNAL) ); |
583 | } | 586 | } |
584 | 587 | ||
585 | // show selected user name in large font | 588 | // show selected user name in large font |
@@ -1033,9 +1036,17 @@ void LLSpeakerMgr::update(BOOL resort_ok) | |||
1033 | // speaker no longer registered in voice channel, demote to text only | 1036 | // speaker no longer registered in voice channel, demote to text only |
1034 | else if (speakerp->mStatus != LLSpeaker::STATUS_NOT_IN_CHANNEL) | 1037 | else if (speakerp->mStatus != LLSpeaker::STATUS_NOT_IN_CHANNEL) |
1035 | { | 1038 | { |
1036 | speakerp->mStatus = LLSpeaker::STATUS_TEXT_ONLY; | 1039 | if(speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL) |
1037 | speakerp->mSpeechVolume = 0.f; | 1040 | { |
1038 | speakerp->mDotColor = ACTIVE_COLOR; | 1041 | // external speakers should be timed out when they leave the voice channel (since they only exist via SLVoice) |
1042 | speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; | ||
1043 | } | ||
1044 | else | ||
1045 | { | ||
1046 | speakerp->mStatus = LLSpeaker::STATUS_TEXT_ONLY; | ||
1047 | speakerp->mSpeechVolume = 0.f; | ||
1048 | speakerp->mDotColor = ACTIVE_COLOR; | ||
1049 | } | ||
1039 | } | 1050 | } |
1040 | } | 1051 | } |
1041 | 1052 | ||
@@ -1087,13 +1098,16 @@ void LLSpeakerMgr::updateSpeakerList() | |||
1087 | if ((!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) | 1098 | if ((!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) |
1088 | { | 1099 | { |
1089 | LLVoiceClient::participantMap* participants = gVoiceClient->getParticipantList(); | 1100 | LLVoiceClient::participantMap* participants = gVoiceClient->getParticipantList(); |
1090 | LLVoiceClient::participantMap::iterator participant_it; | 1101 | if(participants) |
1091 | |||
1092 | // add new participants to our list of known speakers | ||
1093 | for (participant_it = participants->begin(); participant_it != participants->end(); ++participant_it) | ||
1094 | { | 1102 | { |
1095 | LLVoiceClient::participantState* participantp = participant_it->second; | 1103 | LLVoiceClient::participantMap::iterator participant_it; |
1096 | setSpeaker(participantp->mAvatarID, LLStringUtil::null, LLSpeaker::STATUS_VOICE_ACTIVE); | 1104 | |
1105 | // add new participants to our list of known speakers | ||
1106 | for (participant_it = participants->begin(); participant_it != participants->end(); ++participant_it) | ||
1107 | { | ||
1108 | LLVoiceClient::participantState* participantp = participant_it->second; | ||
1109 | setSpeaker(participantp->mAvatarID, participantp->mDisplayName, LLSpeaker::STATUS_VOICE_ACTIVE, (participantp->mAvatarIDValid?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL)); | ||
1110 | } | ||
1097 | } | 1111 | } |
1098 | } | 1112 | } |
1099 | } | 1113 | } |
@@ -1166,6 +1180,10 @@ void LLIMSpeakerMgr::updateSpeakerList() | |||
1166 | { | 1180 | { |
1167 | // don't do normal updates which are pulled from voice channel | 1181 | // don't do normal updates which are pulled from voice channel |
1168 | // rely on user list reported by sim | 1182 | // rely on user list reported by sim |
1183 | |||
1184 | // We need to do this to allow PSTN callers into group chats to show in the list. | ||
1185 | LLSpeakerMgr::updateSpeakerList(); | ||
1186 | |||
1169 | return; | 1187 | return; |
1170 | } | 1188 | } |
1171 | 1189 | ||
@@ -1358,6 +1376,11 @@ void LLLocalSpeakerMgr::updateSpeakerList() | |||
1358 | // pull speakers from voice channel | 1376 | // pull speakers from voice channel |
1359 | LLSpeakerMgr::updateSpeakerList(); | 1377 | LLSpeakerMgr::updateSpeakerList(); |
1360 | 1378 | ||
1379 | if (gDisconnected)//the world is cleared. | ||
1380 | { | ||
1381 | return ; | ||
1382 | } | ||
1383 | |||
1361 | // add non-voice speakers in chat range | 1384 | // add non-voice speakers in chat range |
1362 | std::vector< LLCharacter* >::iterator avatar_it; | 1385 | std::vector< LLCharacter* >::iterator avatar_it; |
1363 | for(avatar_it = LLCharacter::sInstances.begin(); avatar_it != LLCharacter::sInstances.end(); ++avatar_it) | 1386 | for(avatar_it = LLCharacter::sInstances.begin(); avatar_it != LLCharacter::sInstances.end(); ++avatar_it) |