Fix a bug that meant the track progress slider was greyed out on the first song in a last.fm radio stream

This commit is contained in:
David Sansome 2010-03-07 23:28:40 +00:00
parent 3d34aa240c
commit 6f2119bce0
3 changed files with 8 additions and 2 deletions

View File

@ -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)));

View File

@ -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) {

View File

@ -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();