mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(audio):OutgoingCallSound
Adds outgoing call sound when call is started
This commit is contained in:
parent
23ed1a3966
commit
a06ad7048e
BIN
audio/ToxOutgoingCall.pcm
Normal file
BIN
audio/ToxOutgoingCall.pcm
Normal file
Binary file not shown.
1
res.qrc
1
res.qrc
|
@ -8,6 +8,7 @@
|
|||
<qresource prefix="/">
|
||||
<file>audio/notification.pcm</file>
|
||||
<file>audio/ToxIncomingCall.pcm</file>
|
||||
<file>audio/ToxOutgoingCall.pcm</file>
|
||||
<file>img/add.svg</file>
|
||||
<file>img/avatar_mask.svg</file>
|
||||
<file>img/contact.svg</file>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
* @value NewMessage Returns the new message notification sound.
|
||||
* @value Test Returns the test sound.
|
||||
* @value IncomingCall Returns the incoming call sound.
|
||||
* @value OutgoingCall Returns the outgoing call sound.
|
||||
*
|
||||
* @fn QString Audio::getSound(Sound s)
|
||||
* @brief Function to get the path of the requested sound.
|
||||
|
|
|
@ -39,7 +39,8 @@ public:
|
|||
{
|
||||
NewMessage,
|
||||
Test,
|
||||
IncomingCall
|
||||
IncomingCall,
|
||||
OutgoingCall
|
||||
};
|
||||
|
||||
inline static QString getSound(Sound s)
|
||||
|
@ -51,6 +52,8 @@ public:
|
|||
return QStringLiteral(":/audio/notification.pcm");
|
||||
case Sound::IncomingCall:
|
||||
return QStringLiteral(":/audio/ToxIncomingCall.pcm");
|
||||
case Sound::OutgoingCall:
|
||||
return QStringLiteral(":/audio/ToxOutgoingCall.pcm");
|
||||
}
|
||||
assert(false);
|
||||
return QString();
|
||||
|
|
|
@ -369,6 +369,7 @@ void ChatForm::onAvStart(uint32_t friendId, bool video)
|
|||
hideNetcam();
|
||||
}
|
||||
|
||||
Audio::getInstance().stopLoop();
|
||||
updateCallButtons();
|
||||
startCounter();
|
||||
}
|
||||
|
@ -399,6 +400,7 @@ void ChatForm::showOutgoingCall(bool video)
|
|||
btn->setToolTip(video ? tr("Cancel video call") : tr("Cancel audio call"));
|
||||
addSystemInfoMessage(tr("Calling %1").arg(f->getDisplayedName()), ChatMessage::INFO,
|
||||
QDateTime::currentDateTime());
|
||||
emit outgoingNotification();
|
||||
Widget::getInstance()->updateFriendActivity(f);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
signals:
|
||||
void aliasChanged(const QString& alias);
|
||||
void incomingNotification(uint32_t friendId);
|
||||
void outgoingNotification();
|
||||
void rejectCall(uint32_t friendId);
|
||||
void acceptCall(uint32_t friendId);
|
||||
|
||||
|
|
|
@ -934,6 +934,13 @@ void Widget::incomingNotification(uint32_t friendId)
|
|||
audio.playMono16Sound(Audio::getSound(Audio::Sound::IncomingCall));
|
||||
}
|
||||
|
||||
void Widget::outgoingNotification()
|
||||
{
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.startLoop();
|
||||
audio.playMono16Sound(Audio::getSound(Audio::Sound::OutgoingCall));
|
||||
}
|
||||
|
||||
void Widget::onRejectCall(uint32_t friendId)
|
||||
{
|
||||
Audio::getInstance().stopLoop();
|
||||
|
@ -977,6 +984,7 @@ void Widget::addFriend(int friendId, const ToxPk& friendPk)
|
|||
connect(newfriend, &Friend::nameChanged, this, &Widget::onFriendAliasChanged);
|
||||
|
||||
connect(friendForm, &ChatForm::incomingNotification, this, &Widget::incomingNotification);
|
||||
connect(friendForm, &ChatForm::outgoingNotification, this, &Widget::outgoingNotification);
|
||||
connect(friendForm, &ChatForm::rejectCall, this, &Widget::onRejectCall);
|
||||
connect(friendForm, &ChatForm::acceptCall, this, &Widget::onAcceptCall);
|
||||
|
||||
|
|
|
@ -217,6 +217,7 @@ private slots:
|
|||
void groupInvitesUpdate();
|
||||
void groupInvitesClear();
|
||||
void onDialogShown(GenericChatroomWidget* widget);
|
||||
void outgoingNotification();
|
||||
void incomingNotification(uint32_t friendId);
|
||||
void onRejectCall(uint32_t friendId);
|
||||
void onAcceptCall(uint32_t friendId);
|
||||
|
|
Loading…
Reference in New Issue
Block a user