Created UserInterface namespace, WebServerService -> UserInterfaceService.

This commit is contained in:
emeric
2014-04-12 21:28:20 +02:00
parent 788a7638bc
commit 298f6fb885
46 changed files with 291 additions and 167 deletions
+8 -6
View File
@@ -9,9 +9,10 @@
#include "SearchFilterWidget.hpp"
#include "TrackWidget.hpp"
AudioDatabaseWidget::AudioDatabaseWidget( Wt::WContainerWidget *parent)
namespace UserInterface {
AudioDatabaseWidget::AudioDatabaseWidget( DatabaseHandler& db, Wt::WContainerWidget *parent)
: Wt::WContainerWidget(parent),
_db("test.db"), // TODO
_refreshingFilters(false)
{
std::size_t idFilter (0);
@@ -22,23 +23,23 @@ _refreshingFilters(false)
}
{
TableFilterWidget* filterTable = new TableFilterWidget(_db, "genre", "name", this);
TableFilterWidget* filterTable = new TableFilterWidget(db, "genre", "name", this);
_filters.push_back( filterTable );
filterTable->update().connect( boost::bind(&AudioDatabaseWidget::handleFilterUpdated, this, idFilter++) );
}
{
TableFilterWidget* filterTable = new TableFilterWidget(_db, "artist", "name", this);
TableFilterWidget* filterTable = new TableFilterWidget(db, "artist", "name", this);
_filters.push_back( filterTable );
filterTable->update().connect( boost::bind(&AudioDatabaseWidget::handleFilterUpdated, this, idFilter++) );
}
{
TableFilterWidget* filterTable = new TableFilterWidget(_db, "release", "name", this);
TableFilterWidget* filterTable = new TableFilterWidget(db, "release", "name", this);
_filters.push_back( filterTable );
filterTable->update().connect( boost::bind(&AudioDatabaseWidget::handleFilterUpdated, this, idFilter++) );
}
{
TrackWidget* track = new TrackWidget(_db, this);
TrackWidget* track = new TrackWidget(db, this);
_filters.push_back( track );
track->trackSelected().connect(this, &AudioDatabaseWidget::handleTrackSelected);
}
@@ -104,5 +105,6 @@ AudioDatabaseWidget::selectNextTrack(void)
trackWidget->selectNextTrack();
}
} // namespace UserInterface
+5 -4
View File
@@ -6,14 +6,16 @@
#include <Wt/WContainerWidget>
#include <Wt/WSignal>
#include "database/DatabaseHandler.hpp"
#include "common/SessionData.hpp"
#include "FilterWidget.hpp"
namespace UserInterface {
class AudioDatabaseWidget : public Wt::WContainerWidget
{
public:
AudioDatabaseWidget( Wt::WContainerWidget *parent = 0);
AudioDatabaseWidget( DatabaseHandler& db, Wt::WContainerWidget *parent = 0);
void search(const std::string& text);
@@ -24,8 +26,6 @@ class AudioDatabaseWidget : public Wt::WContainerWidget
private:
DatabaseHandler _db;
Wt::Signal< boost::filesystem::path > _trackSelected;
void handleTrackSelected(boost::filesystem::path p);
@@ -37,6 +37,7 @@ class AudioDatabaseWidget : public Wt::WContainerWidget
};
} // namespace UserInterface
#endif
+3
View File
@@ -4,6 +4,7 @@
#include "AudioMediaPlayerWidget.hpp"
namespace UserInterface {
AudioMediaPlayerWidget::AudioMediaPlayerWidget( Wt::WContainerWidget *parent)
: Wt::WContainerWidget(parent),
@@ -155,3 +156,5 @@ AudioMediaPlayerWidget::handleVolumeSliderMoved(int value)
{
_mediaPlayer->setVolume( value / 100. );
}
} // namespace UserInterface
+3 -1
View File
@@ -10,10 +10,11 @@
#include <Wt/WLink>
#include <Wt/WText>
#include "transcode/Parameters.hpp"
#include "resource/AvConvTranscodeStreamResource.hpp"
namespace UserInterface {
class AudioMediaPlayerWidget : public Wt::WContainerWidget
{
public:
@@ -63,6 +64,7 @@ class AudioMediaPlayerWidget : public Wt::WContainerWidget
};
} // namespace UserInterface
#endif
+5 -2
View File
@@ -4,15 +4,17 @@
#include "metadata/Extractor.hpp"
namespace UserInterface {
AudioWidget::AudioWidget(Wt::WContainerWidget* parent)
AudioWidget::AudioWidget(SessionData& sessionData, Wt::WContainerWidget* parent)
: Wt::WContainerWidget(parent),
_sessionData(sessionData),
_audioDbWidget(nullptr),
_mediaPlayer(nullptr),
_imgResource(nullptr),
_img(nullptr)
{
_audioDbWidget = new AudioDatabaseWidget(this);
_audioDbWidget = new AudioDatabaseWidget(sessionData.getDatabaseHandler(), this);
_audioDbWidget->trackSelected().connect(this, &AudioWidget::playTrack);
@@ -78,4 +80,5 @@ AudioWidget::handleTrackEnded(void)
_audioDbWidget->selectNextTrack();
}
} // namespace UserInterface
+7 -1
View File
@@ -11,12 +11,14 @@
#include "audio/AudioMediaPlayerWidget.hpp"
#include "audio/AudioDatabaseWidget.hpp"
namespace UserInterface {
class AudioWidget : public Wt::WContainerWidget
{
public:
AudioWidget(Wt::WContainerWidget* parent = 0);
AudioWidget(SessionData& sessionData, Wt::WContainerWidget* parent = 0);
void search(const std::string& searchText);
@@ -26,6 +28,8 @@ class AudioWidget : public Wt::WContainerWidget
void handleTrackEnded(void);
SessionData& _sessionData;
AudioDatabaseWidget* _audioDbWidget;
AudioMediaPlayerWidget* _mediaPlayer;
@@ -39,5 +43,7 @@ class AudioWidget : public Wt::WContainerWidget
};
} // namespace UserInterface
#endif
+3 -3
View File
@@ -10,6 +10,8 @@
#include "database/SqlQuery.hpp"
namespace UserInterface {
class FilterWidget : public Wt::WContainerWidget {
public:
@@ -39,8 +41,6 @@ class FilterWidget : public Wt::WContainerWidget {
Wt::Signal<void> _update;
};
} // namespace UserInterface
#endif
+2
View File
@@ -2,6 +2,7 @@
#include "SearchFilterWidget.hpp"
namespace UserInterface {
SearchFilterWidget::SearchFilterWidget(Wt::WContainerWidget* parent)
: FilterWidget( parent )
@@ -30,4 +31,5 @@ SearchFilterWidget::getConstraint(Constraint& constraint)
// else no constraint!
}
} // namespace UserInterface
+3 -3
View File
@@ -5,6 +5,8 @@
#include "FilterWidget.hpp"
namespace UserInterface {
class SearchFilterWidget : public FilterWidget {
public:
SearchFilterWidget(Wt::WContainerWidget* parent = 0);
@@ -24,9 +26,7 @@ class SearchFilterWidget : public FilterWidget {
std::string _lastEmittedText;
};
} // namespace UserInterface
#endif
+4
View File
@@ -2,6 +2,8 @@
#include "TableFilterWidget.hpp"
namespace UserInterface {
TableFilterWidget::TableFilterWidget(DatabaseHandler& db, std::string table, std::string field, Wt::WContainerWidget* parent)
: FilterWidget( parent ),
_db(db),
@@ -88,3 +90,5 @@ TableFilterWidget::getConstraint(Constraint& constraint)
constraint.where.And( clause );
}
} // namespace UserInterface
+3 -1
View File
@@ -8,6 +8,8 @@
#include "FilterWidget.hpp"
#include "database/DatabaseHandler.hpp"
namespace UserInterface {
class TableFilterWidget : public FilterWidget
{
@@ -32,7 +34,7 @@ class TableFilterWidget : public FilterWidget
Wt::WTableView* _tableView;
};
} // namespace UserInterface
#endif
+4
View File
@@ -6,6 +6,8 @@
#include "TrackWidget.hpp"
namespace UserInterface {
TrackWidget::TrackWidget( DatabaseHandler& db, Wt::WContainerWidget* parent)
: FilterWidget( parent ),
_db(db),
@@ -132,3 +134,5 @@ TrackWidget::selectNextTrack(void)
}
}
} // namespace UserInterface
+3
View File
@@ -9,6 +9,7 @@
#include "FilterWidget.hpp"
namespace UserInterface {
class TrackWidget : public FilterWidget
{
@@ -45,5 +46,7 @@ class TrackWidget : public FilterWidget
};
} // namespace UserInterface
#endif