Added some logic in the playqueue (play next / play previous handling)

This commit is contained in:
emeric
2018-03-19 13:45:09 +01:00
parent 50036c8918
commit 5006a82ce6
8 changed files with 163 additions and 188 deletions
+17
View File
@@ -20,9 +20,12 @@
#pragma once
#include <Wt/WContainerWidget>
#include <Wt/WSignal>
#include <Wt/WTemplate>
#include <Wt/WText>
#include <boost/optional.hpp>
#include "database/Types.hpp"
namespace UserInterface {
@@ -35,13 +38,27 @@ class PlayQueue : public Wt::WContainerWidget
void addTracks(const std::vector<Database::Track::pointer>& tracks);
void playTracks(const std::vector<Database::Track::pointer>& tracks);
// play the next track in the queue
void playNext();
// play the previous track in the queue
void playPrevious();
// Signal emitted when a track is to be played
Wt::Signal<Database::Track::id_type> playTrack;
private:
void addSome();
void updateInfo();
void updateCurrentTrack(bool selected);
void play(std::size_t pos);
void stop();
Wt::WContainerWidget* _entriesContainer;
Wt::WTemplate* _showMore;
Wt::WText* _nbTracks;
boost::optional<std::size_t> _trackPos; // current track position, if set
};
} // namespace UserInterface