diff --git a/ext/libclementine-remote/remotecontrolmessages.proto b/ext/libclementine-remote/remotecontrolmessages.proto index faee383cd..abfb8dde0 100644 --- a/ext/libclementine-remote/remotecontrolmessages.proto +++ b/ext/libclementine-remote/remotecontrolmessages.proto @@ -20,6 +20,7 @@ enum MsgType { // Lastfm LOVE = 12; BAN = 13; + STOP_AFTER = 17; // Messages send by both DISCONNECT = 2; diff --git a/src/core/player.cpp b/src/core/player.cpp index 0cb98496e..4cdf33f18 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -254,6 +254,10 @@ void Player::Stop() { current_item_.reset(); } +void Player::StopAfterCurrent() { + app_->playlist_manager()->active()->StopAfter(app_->playlist_manager()->active()->current_row()); +} + void Player::Previous() { PreviousItem(Engine::Manual); } diff --git a/src/core/player.h b/src/core/player.h index 5eee6f0c7..c8b7b7854 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -142,6 +142,7 @@ public slots: void Mute(); void Pause(); void Stop(); + void StopAfterCurrent(); void Play(); void ShowOSD(); void TogglePrettyOSD(); diff --git a/src/networkremote/incomingdataparser.cpp b/src/networkremote/incomingdataparser.cpp index 2421ae0c6..afa70f01c 100644 --- a/src/networkremote/incomingdataparser.cpp +++ b/src/networkremote/incomingdataparser.cpp @@ -43,6 +43,8 @@ IncomingDataParser::IncomingDataParser(Application* app) app_->player(), SLOT(Pause())); connect(this, SIGNAL(Stop()), app_->player(), SLOT(Stop())); + connect(this, SIGNAL(StopAfterCurrent()), + app_->player(), SLOT(StopAfterCurrent())); connect(this, SIGNAL(Next()), app_->player(), SLOT(Next())); connect(this, SIGNAL(Previous()), @@ -115,6 +117,8 @@ void IncomingDataParser::Parse(const pb::remote::Message& msg) { break; case pb::remote::STOP: emit Stop(); break; + case pb::remote::STOP_AFTER: emit StopAfterCurrent(); + break; case pb::remote::NEXT: emit Next(); break; case pb::remote::PREVIOUS: emit Previous(); diff --git a/src/networkremote/incomingdataparser.h b/src/networkremote/incomingdataparser.h index df7394e7c..47afb2833 100644 --- a/src/networkremote/incomingdataparser.h +++ b/src/networkremote/incomingdataparser.h @@ -33,6 +33,7 @@ signals: void PlayPause(); void Pause(); void Stop(); + void StopAfterCurrent(); void Next(); void Previous(); void SetVolume(int volume); diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 04fd39ece..87f9cc8eb 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -258,6 +258,10 @@ void PlaylistView::setModel(QAbstractItemModel *m) { this, SLOT(InvalidateCachedCurrentPixmap())); disconnect(model(), SIGNAL(layoutAboutToBeChanged()), this, SLOT(RatingHoverOut())); + // When changing the model, always invalidate the current pixmap. + // If a remote client uses "stop after", without invaliding the stop + // mark would not appear. + InvalidateCachedCurrentPixmap(); } QTreeView::setModel(m);