Mark spotify streams as not seekable

This commit is contained in:
David Sansome 2011-11-28 18:19:11 +00:00
parent 22e6a649b7
commit 05460f9975
4 changed files with 9 additions and 5 deletions

View File

@ -941,7 +941,8 @@ void LastFMService::TuneFinished() {
PlaylistItem::Options LastFMService::playlistitem_options() const {
return PlaylistItem::LastFMControls |
PlaylistItem::PauseDisabled;
PlaylistItem::PauseDisabled |
PlaylistItem::SeekDisabled;
}
PlaylistItemPtr LastFMService::PlaylistItemForUrl(const QUrl& url) {

View File

@ -475,7 +475,7 @@ void SpotifyService::SongFromProtobuf(const spotify_pb::Track& track, Song* song
}
PlaylistItem::Options SpotifyService::playlistitem_options() const {
return PlaylistItem::PauseDisabled;
return PlaylistItem::PauseDisabled | PlaylistItem::SeekDisabled;
}
void SpotifyService::EnsureMenuCreated() {

View File

@ -47,6 +47,9 @@ class PlaylistItem : public boost::enable_shared_from_this<PlaylistItem> {
// Enables the last.fm "ban" action.
LastFMControls = 0x02,
// Disables the seek slider.
SeekDisabled = 0x04,
};
Q_DECLARE_FLAGS(Options, Option);

View File

@ -875,6 +875,9 @@ void MainWindow::MediaPlaying() {
bool enable_play_pause = !(player_->GetCurrentItem()->options() & PlaylistItem::PauseDisabled);
ui_->action_play_pause->setEnabled(enable_play_pause);
bool can_seek = !(player_->GetCurrentItem()->options() & PlaylistItem::SeekDisabled);
ui_->track_slider->SetCanSeek(can_seek);
#ifdef HAVE_LIBLASTFM
bool is_lastfm = (player_->GetCurrentItem()->options() & PlaylistItem::LastFMControls);
LastFMService* lastfm = InternetModel::Service<LastFMService>();
@ -887,10 +890,7 @@ void MainWindow::MediaPlaying() {
tray_icon_->LastFMButtonLoveStateChanged(enable_love);
tray_icon_->SetPlaying(enable_play_pause, enable_ban, enable_love);
ui_->track_slider->SetCanSeek(!is_lastfm);
#else
ui_->track_slider->SetCanSeek(true);
tray_icon_->SetPlaying(enable_play_pause);
#endif