Browse Source

Fix vol/mic toggle buttons

They were suffering from double-connection syndrom, and the way muting worked was now conflicting with how the output sound level setting works

Fixes #1442
pull/1637/head
tux3 10 years ago
parent
commit
600401a606
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
  1. 5
      src/core/coreav.cpp
  2. 2
      src/widget/form/chatform.cpp

5
src/core/coreav.cpp

@ -244,7 +244,7 @@ void Core::playCallAudio(void* toxav, int32_t callId, const int16_t *data, uint1
{ {
Q_UNUSED(user_data); Q_UNUSED(user_data);
if (!calls[callId].active) if (!calls[callId].active || calls[callId].muteVol)
return; return;
if (!calls[callId].alSource) if (!calls[callId].alSource)
@ -356,10 +356,7 @@ void Core::micMuteToggle(int32_t callId)
void Core::volMuteToggle(int32_t callId) void Core::volMuteToggle(int32_t callId)
{ {
if (calls[callId].active) if (calls[callId].active)
{
calls[callId].muteVol = !calls[callId].muteVol; calls[callId].muteVol = !calls[callId].muteVol;
alSourcef(calls[callId].alSource, AL_GAIN, calls[callId].muteVol ? 0.f : 1.f);
}
} }
void Core::onAvCancel(void* _toxav, int32_t callId, void* core) void Core::onAvCancel(void* _toxav, int32_t callId, void* core)

2
src/widget/form/chatform.cpp

@ -91,8 +91,6 @@ ChatForm::ChatForm(Friend* chatFriend)
connect(videoButton, &QPushButton::clicked, this, &ChatForm::onVideoCallTriggered); connect(videoButton, &QPushButton::clicked, this, &ChatForm::onVideoCallTriggered);
connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered); connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered);
connect(msgEdit, &ChatTextEdit::textChanged, this, &ChatForm::onTextEditChanged); connect(msgEdit, &ChatTextEdit::textChanged, this, &ChatForm::onTextEditChanged);
connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle()));
connect(volButton, SIGNAL(clicked()), this, SLOT(onVolMuteToggle()));
connect(Core::getInstance(), &Core::fileSendFailed, this, &ChatForm::onFileSendFailed); connect(Core::getInstance(), &Core::fileSendFailed, this, &ChatForm::onFileSendFailed);
connect(this, SIGNAL(chatAreaCleared()), getOfflineMsgEngine(), SLOT(removeAllReciepts())); connect(this, SIGNAL(chatAreaCleared()), getOfflineMsgEngine(), SLOT(removeAllReciepts()));
connect(&typingTimer, &QTimer::timeout, this, [=]{ connect(&typingTimer, &QTimer::timeout, this, [=]{

Loading…
Cancel
Save