summaryrefslogtreecommitdiffstats
path: root/libQtSpotify/qspotifysession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libQtSpotify/qspotifysession.cpp')
-rw-r--r--libQtSpotify/qspotifysession.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libQtSpotify/qspotifysession.cpp b/libQtSpotify/qspotifysession.cpp
index 3002cd4..3bca818 100644
--- a/libQtSpotify/qspotifysession.cpp
+++ b/libQtSpotify/qspotifysession.cpp
@@ -435,6 +435,7 @@ QSpotifySession::QSpotifySession()
, m_currentTrack(0)
, m_isPlaying(false)
, m_currentTrackPosition(0)
+ , m_currentTrackPlayedDuration(0)
, m_shuffle(false)
, m_repeat(false)
{
@@ -595,6 +596,7 @@ bool QSpotifySession::event(QEvent *e)
// Track progressed
QSpotifyTrackProgressEvent *ev = static_cast<QSpotifyTrackProgressEvent *>(e);
m_currentTrackPosition += ev->delta();
+ m_currentTrackPlayedDuration += ev->delta();
emit currentTrackPositionChanged();
e->accept();
return true;
@@ -815,6 +817,7 @@ void QSpotifySession::play(QSpotifyTrack *track)
}
m_currentTrack = track;
m_currentTrackPosition = 0;
+ m_currentTrackPlayedDuration = 0;
emit currentTrackChanged();
emit currentTrackPositionChanged();
@@ -861,6 +864,7 @@ void QSpotifySession::stop(bool dontEmitSignals)
m_isPlaying = false;
m_currentTrack = 0;
m_currentTrackPosition = 0;
+ m_currentTrackPlayedDuration = 0;
if (!dontEmitSignals) {
emit isPlayingChanged();