mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
5dc4e6de81
commit
65896e4501
BIN
audio/ToxEndCall.pcm
Normal file
BIN
audio/ToxEndCall.pcm
Normal file
Binary file not shown.
1
res.qrc
1
res.qrc
|
@ -9,6 +9,7 @@
|
||||||
<file>audio/notification.pcm</file>
|
<file>audio/notification.pcm</file>
|
||||||
<file>audio/ToxIncomingCall.pcm</file>
|
<file>audio/ToxIncomingCall.pcm</file>
|
||||||
<file>audio/ToxOutgoingCall.pcm</file>
|
<file>audio/ToxOutgoingCall.pcm</file>
|
||||||
|
<file>audio/ToxEndCall.pcm</file>
|
||||||
<file>img/add.svg</file>
|
<file>img/add.svg</file>
|
||||||
<file>img/avatar_mask.svg</file>
|
<file>img/avatar_mask.svg</file>
|
||||||
<file>img/contact.svg</file>
|
<file>img/contact.svg</file>
|
||||||
|
|
|
@ -40,7 +40,8 @@ public:
|
||||||
NewMessage,
|
NewMessage,
|
||||||
Test,
|
Test,
|
||||||
IncomingCall,
|
IncomingCall,
|
||||||
OutgoingCall
|
OutgoingCall,
|
||||||
|
CallEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
inline static QString getSound(Sound s)
|
inline static QString getSound(Sound s)
|
||||||
|
@ -54,6 +55,8 @@ public:
|
||||||
return QStringLiteral(":/audio/ToxIncomingCall.pcm");
|
return QStringLiteral(":/audio/ToxIncomingCall.pcm");
|
||||||
case Sound::OutgoingCall:
|
case Sound::OutgoingCall:
|
||||||
return QStringLiteral(":/audio/ToxOutgoingCall.pcm");
|
return QStringLiteral(":/audio/ToxOutgoingCall.pcm");
|
||||||
|
case Sound::CallEnd:
|
||||||
|
return QStringLiteral(":/audio/ToxEndCall.pcm");
|
||||||
}
|
}
|
||||||
assert(false);
|
assert(false);
|
||||||
return QString();
|
return QString();
|
||||||
|
|
|
@ -402,6 +402,7 @@ void ChatForm::onAvEnd(uint32_t friendId, bool error)
|
||||||
}
|
}
|
||||||
|
|
||||||
emit stopNotification();
|
emit stopNotification();
|
||||||
|
emit endCallNotification();
|
||||||
updateCallButtons();
|
updateCallButtons();
|
||||||
stopCounter(error);
|
stopCounter(error);
|
||||||
hideNetcam();
|
hideNetcam();
|
||||||
|
|
|
@ -60,6 +60,7 @@ signals:
|
||||||
void incomingNotification(uint32_t friendId);
|
void incomingNotification(uint32_t friendId);
|
||||||
void outgoingNotification();
|
void outgoingNotification();
|
||||||
void stopNotification();
|
void stopNotification();
|
||||||
|
void endCallNotification();
|
||||||
void rejectCall(uint32_t friendId);
|
void rejectCall(uint32_t friendId);
|
||||||
void acceptCall(uint32_t friendId);
|
void acceptCall(uint32_t friendId);
|
||||||
|
|
||||||
|
|
|
@ -955,6 +955,12 @@ void Widget::outgoingNotification()
|
||||||
audio.playMono16Sound(Audio::getSound(Audio::Sound::OutgoingCall));
|
audio.playMono16Sound(Audio::getSound(Audio::Sound::OutgoingCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::onCallEnd()
|
||||||
|
{
|
||||||
|
Audio& audio = Audio::getInstance();
|
||||||
|
audio.playMono16Sound(Audio::getSound(Audio::Sound::CallEnd));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Widget::onStopNotification Stop the notification sound.
|
* @brief Widget::onStopNotification Stop the notification sound.
|
||||||
*/
|
*/
|
||||||
|
@ -997,6 +1003,7 @@ void Widget::addFriend(uint32_t friendId, const ToxPk& friendPk)
|
||||||
connect(friendForm, &ChatForm::incomingNotification, this, &Widget::incomingNotification);
|
connect(friendForm, &ChatForm::incomingNotification, this, &Widget::incomingNotification);
|
||||||
connect(friendForm, &ChatForm::outgoingNotification, this, &Widget::outgoingNotification);
|
connect(friendForm, &ChatForm::outgoingNotification, this, &Widget::outgoingNotification);
|
||||||
connect(friendForm, &ChatForm::stopNotification, this, &Widget::onStopNotification);
|
connect(friendForm, &ChatForm::stopNotification, this, &Widget::onStopNotification);
|
||||||
|
connect(friendForm, &ChatForm::endCallNotification, this, &Widget::onCallEnd);
|
||||||
connect(friendForm, &ChatForm::rejectCall, this, &Widget::onRejectCall);
|
connect(friendForm, &ChatForm::rejectCall, this, &Widget::onRejectCall);
|
||||||
|
|
||||||
connect(widget, &FriendWidget::newWindowOpened, this, &Widget::openNewDialog);
|
connect(widget, &FriendWidget::newWindowOpened, this, &Widget::openNewDialog);
|
||||||
|
|
|
@ -218,6 +218,7 @@ private slots:
|
||||||
void groupInvitesClear();
|
void groupInvitesClear();
|
||||||
void onDialogShown(GenericChatroomWidget* widget);
|
void onDialogShown(GenericChatroomWidget* widget);
|
||||||
void outgoingNotification();
|
void outgoingNotification();
|
||||||
|
void onCallEnd();
|
||||||
void incomingNotification(uint32_t friendId);
|
void incomingNotification(uint32_t friendId);
|
||||||
void onRejectCall(uint32_t friendId);
|
void onRejectCall(uint32_t friendId);
|
||||||
void onStopNotification();
|
void onStopNotification();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user