Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1102,10 +1102,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1101 unmodified lines | |||
| 1102 | auto audioScriptingInterface = DependencyManager::get<AudioScriptingInterface>(); | 1102 | auto audioScriptingInterface = DependencyManager::get<AudioScriptingInterface>(); |
| 1103 | auto myAvatarPosition = DependencyManager::get<AvatarManager>()->getMyAvatar()->getWorldPosition(); | 1103 | auto myAvatarPosition = DependencyManager::get<AvatarManager>()->getMyAvatar()->getWorldPosition(); |
| 1104 | float distance = glm::distance(myAvatarPosition, position); | 1104 | float distance = glm::distance(myAvatarPosition, position); |
| 1105 | bool shouldMute = !audioClient->isMuted() && (distance < radius); | ||
| 1106 | 1105 | ||
| 1107 | if (shouldMute) { | 1106 | if (distance < radius) { |
| 1108 | audioClient->toggleMute(); | 1107 | audioClient->setMuted(true); |
| 1109 | audioScriptingInterface->environmentMuted(); | 1108 | audioScriptingInterface->environmentMuted(); |
| 1110 | } | 1109 | } |
| 1111 | }); | 1110 | }); |
| @@ -1508,7 +1507,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 396 unmodified lines | |||
| 1508 | 1507 | ||
| 1509 | if (state) { | 1508 | if (state) { |
| 1510 | if (action == controller::toInt(controller::Action::TOGGLE_MUTE)) { | 1509 | if (action == controller::toInt(controller::Action::TOGGLE_MUTE)) { |
| 1511 | DependencyManager::get<AudioClient>()->toggleMute(); | 1510 | auto audioClient = DependencyManager::get<AudioClient>(); |
| 1511 | audioClient->setMuted(!audioClient->isMuted()); | ||
| 1512 | } else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) { | 1512 | } else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) { |
| 1513 | cycleCamera(); | 1513 | cycleCamera(); |
| 1514 | } else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { | 1514 | } else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { |
| @@ -3461,7 +3461,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1946 unmodified lines | |||
| 3461 | 3461 | ||
| 3462 | case Qt::Key_M: | 3462 | case Qt::Key_M: |
| 3463 | if (isMeta) { | 3463 | if (isMeta) { |
| 3464 | DependencyManager::get<AudioClient>()->toggleMute(); | 3464 | auto audioClient = DependencyManager::get<AudioClient>(); |
| 3465 | audioClient->setMuted(!audioClient->isMuted()); | ||
| 3465 | } | 3466 | } |
| 3466 | break; | 3467 | break; |
| 3467 | 3468 | ||
| @@ -5119,7 +5120,7 @@ void Application::update(float deltaTime) { · 1651 unmodified lines | |||
| 5119 | if (menu->isOptionChecked(MenuOption::AutoMuteAudio) && !audioClient->isMuted()) { | 5120 | if (menu->isOptionChecked(MenuOption::AutoMuteAudio) && !audioClient->isMuted()) { |
| 5120 | if (_lastFaceTrackerUpdate > 0 | 5121 | if (_lastFaceTrackerUpdate > 0 |
| 5121 | && ((usecTimestampNow() - _lastFaceTrackerUpdate) > MUTE_MICROPHONE_AFTER_USECS)) { | 5122 | && ((usecTimestampNow() - _lastFaceTrackerUpdate) > MUTE_MICROPHONE_AFTER_USECS)) { |
| 5122 | audioClient->toggleMute(); | 5123 | audioClient->setMuted(true); |
| 5123 | _lastFaceTrackerUpdate = 0; | 5124 | _lastFaceTrackerUpdate = 0; |
| 5124 | } | 5125 | } |
| 5125 | } else { | 5126 | } else { |