mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-21 13:48:08 +00:00
feat(ui/views/App/Calls/Incall): supports call quality
This commit is contained in:
parent
3721814e6f
commit
ff749bbb7b
3 changed files with 24 additions and 1 deletions
|
|
@ -57,6 +57,10 @@ void CallModel::transfer () {
|
|||
// TODO
|
||||
}
|
||||
|
||||
float CallModel::getQuality () const {
|
||||
return m_linphone_call->getCurrentQuality();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString CallModel::getSipAddress () const {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ public:
|
|||
Q_INVOKABLE void terminate ();
|
||||
Q_INVOKABLE void transfer ();
|
||||
|
||||
Q_INVOKABLE float getQuality () const;
|
||||
|
||||
signals:
|
||||
void statusChanged (CallStatus status);
|
||||
void microMutedChanged (bool status);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,25 @@ Rectangle {
|
|||
id: callQuality
|
||||
|
||||
anchors.left: parent.left
|
||||
icon: 'call_quality_' + 2
|
||||
icon: 'call_quality_0'
|
||||
iconSize: CallStyle.header.iconSize
|
||||
onIconChanged: console.log(icon)
|
||||
// See: http://www.linphone.org/docs/liblinphone/group__call__misc.html#ga62c7d3d08531b0cc634b797e273a0a73
|
||||
Timer {
|
||||
interval: 5000
|
||||
repeat: true
|
||||
running: true
|
||||
triggeredOnStart: true
|
||||
|
||||
onTriggered: {
|
||||
var quality = call.getQuality()
|
||||
callQuality.icon = 'call_quality_' + (
|
||||
// Note: `quality` is in the [0, 5] interval.
|
||||
// It's necessary to map in the `call_quality_` interval. ([0, 3])
|
||||
quality >= 0 ? Math.round(quality / (5 / 3)) : 0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContactDescription {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue