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
+15
View File
@@ -21,6 +21,8 @@
#include <Wt/WTemplate>
#include <Wt/WText>
#include "utils/Logger.hpp"
#include "MediaPlayer.hpp"
namespace UserInterface {
@@ -35,9 +37,17 @@ MediaPlayer::MediaPlayer(Wt::WContainerWidget* parent)
auto prevBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-prev"), Wt::XHTMLText);
player->bindWidget("previous", prevBtn);
prevBtn->clicked().connect(std::bind([=]
{
playPrevious.emit();
}));
auto nextBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-next"), Wt::XHTMLText);
player->bindWidget("next", nextBtn);
nextBtn->clicked().connect(std::bind([=]
{
playNext.emit();
}));
auto shuffleBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-shuffle"), Wt::XHTMLText);
player->bindWidget("shuffle", shuffleBtn);
@@ -53,7 +63,12 @@ MediaPlayer::MediaPlayer(Wt::WContainerWidget* parent)
auto trackName = new Wt::WText("---");
player->bindWidget("track-name", trackName);
}
void
MediaPlayer::playTrack(Database::Track::id_type id)
{
LMS_LOG(UI, DEBUG) << "Playing track ID = " << id;
}
} // namespace UserInterface