Reset play offset when switching song while paused

Fixes #735
This commit is contained in:
Jonas Kvinge
2021-07-23 21:32:12 +02:00
parent a353631892
commit c6e42e1032
3 changed files with 21 additions and 23 deletions

View File

@@ -73,7 +73,7 @@ class PlayerInterface : public QObject {
virtual void ReloadSettings() = 0;
// Manual track change to the specified track
virtual void PlayAt(const int index, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) = 0;
virtual void PlayAt(const int index, const qint64 offset_nanosec, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) = 0;
// If there's currently a song playing, pause it, otherwise play the track that was playing last, or the first one on the playlist
virtual void PlayPause(const quint64 offset_nanosec = 0, const Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) = 0;
@@ -159,7 +159,7 @@ class Player : public PlayerInterface {
public slots:
void ReloadSettings() override;
void PlayAt(const int index, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) override;
void PlayAt(const int index, const qint64 offset_nanosec, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) override;
void PlayPause(const quint64 offset_nanosec = 0, const Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) override;
void PlayPauseHelper() override { PlayPause(play_offset_nanosec_); }
void RestartOrPrevious() override;