From 7ffc9a3262908d862ba182a156e475ff85ebc91a Mon Sep 17 00:00:00 2001 From: emeric Date: Fri, 16 Feb 2018 12:42:27 +0100 Subject: [PATCH] Added mediaplayer skeleton --- src/ui/MediaPlayer.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++ src/ui/MediaPlayer.hpp | 33 +++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 src/ui/MediaPlayer.cpp create mode 100644 src/ui/MediaPlayer.hpp diff --git a/src/ui/MediaPlayer.cpp b/src/ui/MediaPlayer.cpp new file mode 100644 index 00000000..23d603c6 --- /dev/null +++ b/src/ui/MediaPlayer.cpp @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2018 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ +#include +#include +#include +#include + +#include "MediaPlayer.hpp" + +namespace UserInterface { + +MediaPlayer::MediaPlayer(Wt::WContainerWidget* parent) +: Wt::WContainerWidget(parent) +{ + auto player = new Wt::WTemplate(Wt::WString::tr("template-mediaplayer"), this); + + auto playPauseBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-play"), Wt::XHTMLText); + player->bindWidget("play-pause", playPauseBtn); + + auto prevBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-prev"), Wt::XHTMLText); + player->bindWidget("previous", prevBtn); + + auto nextBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-next"), Wt::XHTMLText); + player->bindWidget("next", nextBtn); + + auto shuffleBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-shuffle"), Wt::XHTMLText); + player->bindWidget("shuffle", shuffleBtn); + + auto repeatBtn = new Wt::WText(Wt::WString::tr("btn-mediaplayer-repeat"), Wt::XHTMLText); + player->bindWidget("repeat", repeatBtn); + + player->bindString("current-time", "00:00"); + player->bindString("total-time", "00:00"); + + auto cover = new Wt::WImage(); + player->bindWidget("cover", cover); + + auto trackName = new Wt::WText("---"); + player->bindWidget("track-name", trackName); + +} + +} // namespace UserInterface + diff --git a/src/ui/MediaPlayer.hpp b/src/ui/MediaPlayer.hpp new file mode 100644 index 00000000..69615b68 --- /dev/null +++ b/src/ui/MediaPlayer.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2018 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + +#pragma once + +#include + +namespace UserInterface { + +class MediaPlayer : public Wt::WContainerWidget +{ + public: + MediaPlayer(Wt::WContainerWidget* parent = 0); +}; + +} // namespace UserInterface +