diff options
author | George Hazan <ghazan@miranda.im> | 2022-09-10 07:11:37 -0700 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-09-10 07:11:37 -0700 |
commit | a929d4c862a60c9abc1b6e9fe507831326f232dc (patch) | |
tree | ebdfd47a4781e11e1501c6ff8a0e62000feda4a0 /plugins | |
parent | f0585b3e81a1a0a9cfde43313cadf0ee72daad27 (diff) |
fixes #3192 (VoiceService: звук звонка воспроизводится лишь один раз)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/VoiceService/src/VoiceCall.cpp | 13 | ||||
-rw-r--r-- | plugins/VoiceService/src/stdafx.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/plugins/VoiceService/src/VoiceCall.cpp b/plugins/VoiceService/src/VoiceCall.cpp index 40ea12aedf..8198ee8c61 100644 --- a/plugins/VoiceService/src/VoiceCall.cpp +++ b/plugins/VoiceService/src/VoiceCall.cpp @@ -196,6 +196,11 @@ void VoiceCall::RemoveNotifications() g_clistApi.pfnRemoveEvent(hContact, MEVENT(1001)); clistBlinking = false; } + + if (soundActive) { + Skin_PlaySoundFile(nullptr); + soundActive = false; + } } void VoiceCall::SetState(int aState) @@ -259,10 +264,12 @@ void VoiceCall::SetStatus(const wchar_t *text) void VoiceCall::Notify(bool popup, bool sound, bool clist) { - if (sound) - Skin_PlaySound(g_sounds[state].szName); + if (sound) { + soundActive = true; + Skin_PlaySound(g_sounds[state].szName, SPS_LOOP); + } - if(IsWindowVisible(GetHwnd())) + if (IsWindowVisible(GetHwnd())) return; if (popup) diff --git a/plugins/VoiceService/src/stdafx.h b/plugins/VoiceService/src/stdafx.h index 4233afc08c..1c99427162 100644 --- a/plugins/VoiceService/src/stdafx.h +++ b/plugins/VoiceService/src/stdafx.h @@ -125,7 +125,7 @@ public: wchar_t number[256]; wchar_t displayName[256]; int state = -1; - bool incoming = false, secure = false, clistBlinking = false; + bool incoming = false, secure = false, clistBlinking = false, soundActive = false; VoiceCall(VoiceProvider *module, const char *id); ~VoiceCall(); |