feat(ui/views/App/Calls/Incall): supports call quality

This commit is contained in:
Ronan Abhamon 2017-01-23 16:51:59 +01:00
parent 3721814e6f
commit ff749bbb7b
3 changed files with 24 additions and 1 deletions

View file

@ -57,6 +57,10 @@ void CallModel::transfer () {
// TODO
}
float CallModel::getQuality () const {
return m_linphone_call->getCurrentQuality();
}
// -----------------------------------------------------------------------------
QString CallModel::getSipAddress () const {

View file

@ -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);

View file

@ -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 {