MCPcopy Create free account
hub / github.com/Soundux/Soundux / onAllSoundsFinished

Method onAllSoundsFinished

src/ui/ui.cpp:940–977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938 }
939 }
940 void Window::onAllSoundsFinished()
941 {
942 if (!Globals::gSettings.pushToTalkKeys.empty())
943 {
944 Globals::gHotKeys.releaseKeys(Globals::gSettings.pushToTalkKeys);
945 }
946
947#if defined(__linux__)
948 if (Globals::gAudioBackend)
949 {
950 if (Globals::gSettings.muteDuringPlayback)
951 {
952 if (!Globals::gAudioBackend->muteInput(false))
953 {
954 onError(Enums::ErrorCode::FailedToMute);
955 }
956 }
957 if (Globals::gAudioBackend->currentlyPassedThrough().empty())
958 {
959 if (!Globals::gAudioBackend->stopSoundInput())
960 {
961 onError(Enums::ErrorCode::FailedToMoveBack);
962 }
963 }
964 }
965#elif defined(_WIN32)
966 if (Globals::gSettings.muteDuringPlayback)
967 {
968 if (Globals::gWinSound && Globals::gWinSound->getMic())
969 {
970 if (!Globals::gWinSound->getMic()->mute(false))
971 {
972 onError(Enums::ErrorCode::FailedToMute);
973 }
974 }
975 }
976#endif
977 }
978 void Window::onSoundPlayed([[maybe_unused]] const PlayingSound &sound)
979 {
980 if (!Globals::gSettings.pushToTalkKeys.empty())

Callers

nothing calls this directly

Calls 6

getMicMethod · 0.80
muteMethod · 0.80
releaseKeysMethod · 0.45
muteInputMethod · 0.45
stopSoundInputMethod · 0.45

Tested by

no test coverage detected