Merge pull request #6475 from rohtie/bugfix-position-not-resumed
Fix resuming playback position on startup
This commit is contained in:
commit
9eeb6d3758
|
@ -1342,7 +1342,19 @@ void MainWindow::ResumePlayback() {
|
||||||
|
|
||||||
app_->player()->Play();
|
app_->player()->Play();
|
||||||
|
|
||||||
app_->player()->SeekTo(saved_playback_position_);
|
connect(track_position_timer_, SIGNAL(timeout()),
|
||||||
|
SLOT(ResumePlaybackPosition()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::ResumePlaybackPosition() {
|
||||||
|
// We must wait until the song has a length because
|
||||||
|
// seeking a song without length does not work
|
||||||
|
if (app_->player()->engine()->length_nanosec() > 0) {
|
||||||
|
disconnect(track_position_timer_, SIGNAL(timeout()), this,
|
||||||
|
SLOT(ResumePlaybackPosition()));
|
||||||
|
|
||||||
|
app_->player()->SeekTo(saved_playback_position_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::PlayIndex(const QModelIndex& index) {
|
void MainWindow::PlayIndex(const QModelIndex& index) {
|
||||||
|
|
|
@ -271,6 +271,7 @@ signals:
|
||||||
void SavePlaybackStatus(QSettings* settings);
|
void SavePlaybackStatus(QSettings* settings);
|
||||||
void LoadPlaybackStatus();
|
void LoadPlaybackStatus();
|
||||||
void ResumePlayback();
|
void ResumePlayback();
|
||||||
|
void ResumePlaybackPosition();
|
||||||
|
|
||||||
void AddSongInfoGenerator(smart_playlists::GeneratorPtr gen);
|
void AddSongInfoGenerator(smart_playlists::GeneratorPtr gen);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue