From b92717fa4f4beef48b9efc0e6a29f15bc3a693c7 Mon Sep 17 00:00:00 2001 From: emeric Date: Fri, 25 May 2018 23:10:25 +0200 Subject: [PATCH] Added some notifications when queing/playing files --- approot/messages.xml | 2 ++ src/ui/PlayQueueView.cpp | 14 +++++++++++--- src/ui/PlayQueueView.hpp | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/approot/messages.xml b/approot/messages.xml index 7c8d693f..f1e6febe 100644 --- a/approot/messages.xml +++ b/approot/messages.xml @@ -70,6 +70,8 @@ Play Queue {1} tracks +Added {1} tracks +Playing {1} tracks Account diff --git a/src/ui/PlayQueueView.cpp b/src/ui/PlayQueueView.cpp index bc2f00fe..ed27df15 100644 --- a/src/ui/PlayQueueView.cpp +++ b/src/ui/PlayQueueView.cpp @@ -165,7 +165,7 @@ PlayQueue::updateCurrentTrack(bool selected) } void -PlayQueue::addTracks(const std::vector& tracks) +PlayQueue::enqueueTracks(const std::vector& tracks) { // Use a "session" playqueue in order to store the current playqueue // so that the user can disconnect and get its playqueue back @@ -181,6 +181,13 @@ PlayQueue::addTracks(const std::vector& tracks) addSome(); } +void +PlayQueue::addTracks(const std::vector& tracks) +{ + enqueueTracks(tracks); + LmsApp->notifyMsg(Wt::WString::tr("Lms.PlayQueue.nb-tracks-added").arg(tracks.size())); +} + void PlayQueue::playTracks(const std::vector& tracks) { @@ -193,9 +200,10 @@ PlayQueue::playTracks(const std::vector& tracks) _entriesContainer->clear(); - addTracks(tracks); - + enqueueTracks(tracks); play(0); + + LmsApp->notifyMsg(Wt::WString::tr("Lms.PlayQueue.nb-tracks-playing").arg(tracks.size())); } diff --git a/src/ui/PlayQueueView.hpp b/src/ui/PlayQueueView.hpp index 9249073d..b2652bb8 100644 --- a/src/ui/PlayQueueView.hpp +++ b/src/ui/PlayQueueView.hpp @@ -51,6 +51,7 @@ class PlayQueue : public Wt::WTemplate Wt::Signal<> playbackStop; private: + void enqueueTracks(const std::vector& tracks); void addSome(); void updateInfo(); void updateCurrentTrack(bool selected);