Commit 3b369fa6 authored by Alexander Stippich's avatar Alexander Stippich
Browse files

Merge branch 'release/19.12'

parents 0b2c4be9 ec519752
......@@ -151,9 +151,9 @@
<project_group>KDE</project_group>
<content_rating type="oars-1.0"/>
<releases>
<release version="19.12.2" date="2020-02-06"/>
<release version="19.12.1" date="2020-01-09"/>
<release version="19.12.0" date="2019-12-12"/>
<release version="19.11.80" date="2019-11-14"/>
<release version="0.4.2" date="2019-06-30"/>
</releases>
</component>
......@@ -213,13 +213,21 @@ void MediaPlayer2Player::setPropertyPosition(int newPositionInMs)
Q_EMIT Seeked(m_position);
QVariantMap parameters;
parameters.insert(QStringLiteral("progress-visible"), true);
parameters.insert(QStringLiteral("progress"), static_cast<double>(newPositionInMs) / m_audioPlayer->duration());
/* only sent new progress when it has advanced more than 1 %
* to limit DBus traffic
*/
const auto incrementalProgress = static_cast<double>(newPositionInMs - mPreviousProgressPosition) / m_audioPlayer->duration();
if (incrementalProgress > 0.01 || incrementalProgress < 0)
{
mPreviousProgressPosition = newPositionInMs;
QVariantMap parameters;
parameters.insert(QStringLiteral("progress-visible"), true);
parameters.insert(QStringLiteral("progress"), static_cast<double>(newPositionInMs) / m_audioPlayer->duration());
mProgressIndicatorSignal.setArguments({QStringLiteral("application://org.kde.elisa.desktop"), parameters});
mProgressIndicatorSignal.setArguments({QStringLiteral("application://org.kde.elisa.desktop"), parameters});
QDBusConnection::sessionBus().send(mProgressIndicatorSignal);
QDBusConnection::sessionBus().send(mProgressIndicatorSignal);
}
}
double MediaPlayer2Player::Rate() const
......
......@@ -161,6 +161,7 @@ private:
ManageHeaderBar * m_manageHeaderBar = nullptr;
AudioWrapper *m_audioPlayer = nullptr;
mutable QDBusMessage mProgressIndicatorSignal;
int mPreviousProgressPosition = 0;
};
#endif // MEDIAPLAYER2PLAYER_H
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