Commit ff749bbb authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent 3721814e
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment