diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a31ffe02d..e851677c5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -691,6 +691,7 @@ void MainWindow::SetCurrentPlaylist(PlaylistView* pCurrent){ // connects !! :) connect(current_playlist_, SIGNAL(CurrentSongChanged(Song)), osd_, SLOT(SongChanged(Song))); + connect(current_playlist_, SIGNAL(CurrentSongChanged(Song)), player_, SLOT(CurrentMetadataChanged(Song))); connect(current_playlist_view_, SIGNAL(doubleClicked(QModelIndex)), SLOT(PlayIndex(QModelIndex))); connect(current_playlist_view_, SIGNAL(PlayPauseItem(QModelIndex)), SLOT(PlayIndex(QModelIndex))); connect(current_playlist_view_, SIGNAL(RightClicked(QPoint,QModelIndex)), SLOT(PlaylistRightClick(QPoint,QModelIndex))); diff --git a/src/player.cpp b/src/player.cpp index 5d53b1b8e..f17e6635e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -210,9 +210,13 @@ void Player::StreamReady(const QUrl& original_url, const QUrl& media_url) { engine_->play(media_url); - lastfm_->NowPlaying(item->Metadata()); - current_item_options_ = item->options(); current_item_ = item->Metadata(); + current_item_options_ = item->options(); +} + +void Player::CurrentMetadataChanged(const Song &metadata) { + lastfm_->NowPlaying(metadata); + current_item_ = metadata; } void Player::Seek(int seconds) { diff --git a/src/player.h b/src/player.h index 98eb5b982..cac06c5ab 100644 --- a/src/player.h +++ b/src/player.h @@ -46,6 +46,7 @@ class Player : public QObject { void TrackEnded(); void StreamReady(const QUrl& original_url, const QUrl& media_url); + void CurrentMetadataChanged(const Song& metadata); signals: void InitFinished();