WIP. PlayQueue
This commit is contained in:
+6
-5
@@ -12,14 +12,14 @@ lms_SOURCES = \
|
|||||||
$(srcdir)/cover/CoverArt.cpp \
|
$(srcdir)/cover/CoverArt.cpp \
|
||||||
$(srcdir)/cover/CoverArtGrabber.cpp \
|
$(srcdir)/cover/CoverArtGrabber.cpp \
|
||||||
$(srcdir)/database/Artist.cpp \
|
$(srcdir)/database/Artist.cpp \
|
||||||
$(srcdir)/database/Genre.cpp \
|
|
||||||
$(srcdir)/database/Release.cpp \
|
|
||||||
$(srcdir)/database/MediaDirectory.cpp \
|
|
||||||
$(srcdir)/database/Track.cpp \
|
|
||||||
$(srcdir)/database/DatabaseHandler.cpp \
|
$(srcdir)/database/DatabaseHandler.cpp \
|
||||||
|
$(srcdir)/database/Genre.cpp \
|
||||||
|
$(srcdir)/database/MediaDirectory.cpp \
|
||||||
|
$(srcdir)/database/Release.cpp \
|
||||||
$(srcdir)/database/SqlQuery.cpp \
|
$(srcdir)/database/SqlQuery.cpp \
|
||||||
$(srcdir)/database/Video.cpp \
|
$(srcdir)/database/Track.cpp \
|
||||||
$(srcdir)/database/User.cpp \
|
$(srcdir)/database/User.cpp \
|
||||||
|
$(srcdir)/database/Video.cpp \
|
||||||
$(srcdir)/database-updater/DatabaseUpdater.cpp \
|
$(srcdir)/database-updater/DatabaseUpdater.cpp \
|
||||||
$(srcdir)/database-updater/Checksum.cpp \
|
$(srcdir)/database-updater/Checksum.cpp \
|
||||||
$(srcdir)/logger/Logger.cpp \
|
$(srcdir)/logger/Logger.cpp \
|
||||||
@@ -46,6 +46,7 @@ lms_SOURCES = \
|
|||||||
$(srcdir)/ui/audio/AudioMediaPlayer.cpp \
|
$(srcdir)/ui/audio/AudioMediaPlayer.cpp \
|
||||||
$(srcdir)/ui/audio/FilterChain.cpp \
|
$(srcdir)/ui/audio/FilterChain.cpp \
|
||||||
$(srcdir)/ui/audio/KeywordSearchFilter.cpp \
|
$(srcdir)/ui/audio/KeywordSearchFilter.cpp \
|
||||||
|
$(srcdir)/ui/audio/PlayQueue.cpp \
|
||||||
$(srcdir)/ui/audio/TableFilter.cpp \
|
$(srcdir)/ui/audio/TableFilter.cpp \
|
||||||
$(srcdir)/ui/audio/TrackView.cpp \
|
$(srcdir)/ui/audio/TrackView.cpp \
|
||||||
$(srcdir)/ui/common/DirectoryValidator.cpp \
|
$(srcdir)/ui/common/DirectoryValidator.cpp \
|
||||||
|
|||||||
+73
-22
@@ -30,6 +30,7 @@
|
|||||||
#include "TableFilter.hpp"
|
#include "TableFilter.hpp"
|
||||||
#include "KeywordSearchFilter.hpp"
|
#include "KeywordSearchFilter.hpp"
|
||||||
#include "TrackView.hpp"
|
#include "TrackView.hpp"
|
||||||
|
#include "PlayQueue.hpp"
|
||||||
|
|
||||||
#include "Audio.hpp"
|
#include "Audio.hpp"
|
||||||
|
|
||||||
@@ -66,33 +67,49 @@ _mediaPlayer(nullptr)
|
|||||||
mainLayout->addLayout(filterLayout, 0, 0);
|
mainLayout->addLayout(filterLayout, 0, 0);
|
||||||
// ENDOF(Filters)
|
// ENDOF(Filters)
|
||||||
|
|
||||||
|
// TODO ADD controls (Play, add)
|
||||||
|
// TODO ADD some stats (nb files, total duration, etc.)
|
||||||
|
|
||||||
|
Wt::WVBoxLayout* trackLayout = new Wt::WVBoxLayout();
|
||||||
|
|
||||||
TrackView* trackView = new TrackView(_db);
|
TrackView* trackView = new TrackView(_db);
|
||||||
mainLayout->addWidget( trackView, 1, 0);
|
trackLayout->addWidget(trackView, 1);
|
||||||
|
|
||||||
|
Wt::WHBoxLayout* trackControls = new Wt::WHBoxLayout();
|
||||||
|
|
||||||
|
Wt::WPushButton* playBtn = new Wt::WPushButton("Play");
|
||||||
|
trackControls->addWidget(playBtn);
|
||||||
|
|
||||||
|
Wt::WPushButton* addBtn = new Wt::WPushButton("Add");
|
||||||
|
trackControls->addWidget(addBtn);
|
||||||
|
trackControls->addWidget(new Wt::WText("Total duration: "), 1);
|
||||||
|
|
||||||
|
|
||||||
|
trackLayout->addLayout(trackControls);
|
||||||
|
|
||||||
|
mainLayout->addLayout(trackLayout, 1, 0);
|
||||||
|
|
||||||
_filterChain.addFilter(trackView);
|
_filterChain.addFilter(trackView);
|
||||||
|
|
||||||
// TODO Playlist here
|
PlayQueue *playQueue = new PlayQueue(_db);
|
||||||
|
|
||||||
|
// Playlist/PlayQueue
|
||||||
{
|
{
|
||||||
Wt::WVBoxLayout* playlist = new Wt::WVBoxLayout();
|
Wt::Dbo::Transaction transaction(_db.getSession());
|
||||||
|
Database::User::pointer user = _db.getCurrentUser();
|
||||||
|
|
||||||
|
Wt::WVBoxLayout* playQueueLayout = new Wt::WVBoxLayout();
|
||||||
|
|
||||||
Wt::WHBoxLayout* playlistControls = new Wt::WHBoxLayout();
|
Wt::WHBoxLayout* playlistControls = new Wt::WHBoxLayout();
|
||||||
|
|
||||||
Wt::WComboBox *cb = new Wt::WComboBox();
|
playlistControls->addWidget(new Wt::WPushButton("Playlist"));
|
||||||
cb->addItem("metal");
|
playlistControls->addWidget(new Wt::WText("Duration:"));
|
||||||
cb->addItem("rock");
|
|
||||||
cb->addItem("top50");
|
|
||||||
cb->setWidth(75);
|
|
||||||
|
|
||||||
playlistControls->addWidget(cb, 1);
|
playQueueLayout->addLayout(playlistControls);
|
||||||
playlistControls->addWidget(new Wt::WPushButton("Rename"));
|
|
||||||
playlistControls->addWidget(new Wt::WPushButton("+"));
|
|
||||||
playlistControls->addWidget(new Wt::WPushButton("-"));
|
|
||||||
|
|
||||||
playlist->addLayout(playlistControls);
|
playQueueLayout->addWidget( playQueue, 1);
|
||||||
|
|
||||||
// TODO
|
mainLayout->addLayout(playQueueLayout, 0, 1, 2, 1);
|
||||||
playlist->addWidget( new Wt::WTableView(), 1);
|
|
||||||
|
|
||||||
mainLayout->addLayout(playlist, 0, 1, 2, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_mediaPlayer = new AudioMediaPlayer();
|
_mediaPlayer = new AudioMediaPlayer();
|
||||||
@@ -102,13 +119,46 @@ _mediaPlayer(nullptr)
|
|||||||
mainLayout->setRowResizable(0, true, Wt::WLength(200, Wt::WLength::Pixel));
|
mainLayout->setRowResizable(0, true, Wt::WLength(200, Wt::WLength::Pixel));
|
||||||
mainLayout->setColumnResizable(0, true);
|
mainLayout->setColumnResizable(0, true);
|
||||||
|
|
||||||
trackView->trackSelected().connect(boost::bind(&Audio::playTrack, this, _1));
|
// Double click on track
|
||||||
|
// Set the selected tracks to the play queue
|
||||||
_mediaPlayer->playbackEnded().connect(std::bind([=] ()
|
trackView->trackDoubleClicked().connect(std::bind([=] ()
|
||||||
{
|
{
|
||||||
// TODO link to playlist
|
std::vector<Database::Track::id_type> trackIds;
|
||||||
trackView->selectNextTrack();
|
trackView->getSelectedTracks(trackIds);
|
||||||
|
|
||||||
|
playQueue->clear();
|
||||||
|
playQueue->addTracks(trackIds);
|
||||||
|
|
||||||
|
playQueue->play();
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// Play button
|
||||||
|
// Set the selected tracks to the play queue
|
||||||
|
playBtn->clicked().connect(std::bind([=] ()
|
||||||
|
{
|
||||||
|
std::vector<Database::Track::id_type> trackIds;
|
||||||
|
trackView->getSelectedTracks(trackIds);
|
||||||
|
|
||||||
|
playQueue->clear();
|
||||||
|
playQueue->addTracks(trackIds);
|
||||||
|
|
||||||
|
playQueue->play();
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Add Button
|
||||||
|
// Add the selected tracks at the end of the play queue
|
||||||
|
addBtn->clicked().connect(std::bind([=] ()
|
||||||
|
{
|
||||||
|
std::vector<Database::Track::id_type> trackIds;
|
||||||
|
trackView->getSelectedTracks(trackIds);
|
||||||
|
|
||||||
|
playQueue->addTracks(trackIds);
|
||||||
|
}));
|
||||||
|
|
||||||
|
playQueue->playTrack().connect(this, &Audio::playTrack);
|
||||||
|
|
||||||
|
_mediaPlayer->playbackEnded().connect(playQueue, &PlayQueue::handlePlaybackComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -152,5 +202,6 @@ Audio::playTrack(boost::filesystem::path p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ class Audio : public Wt::WContainerWidget
|
|||||||
|
|
||||||
void playTrack(boost::filesystem::path p);
|
void playTrack(boost::filesystem::path p);
|
||||||
|
|
||||||
|
void handlePlaylistSelected(Wt::WString name);
|
||||||
|
|
||||||
Database::Handler& _db;
|
Database::Handler& _db;
|
||||||
|
|
||||||
AudioMediaPlayer* _mediaPlayer;
|
AudioMediaPlayer* _mediaPlayer;
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PlayQueue.hpp"
|
||||||
|
|
||||||
|
namespace UserInterface {
|
||||||
|
|
||||||
|
|
||||||
|
PlayQueue::PlayQueue(Database::Handler& db, Wt::WContainerWidget* parent)
|
||||||
|
: Wt::WTableView(parent),
|
||||||
|
_db(db),
|
||||||
|
_playingTrackId(0)
|
||||||
|
{
|
||||||
|
_model = new Wt::WStandardItemModel(0, 4, this);
|
||||||
|
|
||||||
|
// 0 Column is hidden (track id)
|
||||||
|
_model->setHeaderData(0, Wt::WString("#"));
|
||||||
|
_model->setHeaderData(1, Wt::WString("#"));
|
||||||
|
_model->setHeaderData(2, Wt::WString("Track"));
|
||||||
|
_model->setHeaderData(3, Wt::WString("Duration"));
|
||||||
|
|
||||||
|
this->setModel(_model);
|
||||||
|
this->setSelectionMode(Wt::ExtendedSelection);
|
||||||
|
this->setSortingEnabled(false);
|
||||||
|
this->setAlternatingRowColors(true);
|
||||||
|
|
||||||
|
this->setColumnWidth(0, 50);
|
||||||
|
this->setColumnWidth(1, 50);
|
||||||
|
|
||||||
|
this->setColumnHidden(0, true);
|
||||||
|
|
||||||
|
this->doubleClicked().connect( std::bind([=] (Wt::WModelIndex idx, Wt::WMouseEvent evt)
|
||||||
|
{
|
||||||
|
if (!idx.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Update selection
|
||||||
|
Wt::WModelIndexSet indexSet;
|
||||||
|
indexSet.insert(idx);
|
||||||
|
|
||||||
|
this->setSelectedIndexes( indexSet );
|
||||||
|
|
||||||
|
// Read the requested track
|
||||||
|
readTrack(idx.row());
|
||||||
|
|
||||||
|
}, std::placeholders::_1, std::placeholders::_2));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayQueue::play(void)
|
||||||
|
{
|
||||||
|
readTrack(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayQueue::addTracks(const std::vector<Database::Track::id_type>& trackIds)
|
||||||
|
{
|
||||||
|
// Add tracks to model
|
||||||
|
Wt::Dbo::Transaction transaction(_db.getSession());
|
||||||
|
|
||||||
|
BOOST_FOREACH(Database::Track::id_type trackId, trackIds)
|
||||||
|
{
|
||||||
|
Database::Track::pointer track (Database::Track::getById(_db.getSession(), trackId));
|
||||||
|
|
||||||
|
if (track)
|
||||||
|
{
|
||||||
|
int dataRow = _model->rowCount();
|
||||||
|
|
||||||
|
_model->insertRows(dataRow, 1);
|
||||||
|
|
||||||
|
_model->setData(dataRow, 0, track.id());
|
||||||
|
_model->setData(dataRow, 1, dataRow + 1);
|
||||||
|
_model->setData(dataRow, 2, track->getName());
|
||||||
|
_model->setData(dataRow, 3, track->getDuration());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayQueue::clear(void)
|
||||||
|
{
|
||||||
|
_model->removeRows(0, _model->rowCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayQueue::handlePlaybackComplete(void)
|
||||||
|
{
|
||||||
|
// Play the next track
|
||||||
|
readTrack(_playingTrackId + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayQueue::readTrack(int rowId)
|
||||||
|
{
|
||||||
|
Wt::Dbo::Transaction transaction(_db.getSession());
|
||||||
|
|
||||||
|
while (rowId < _model->rowCount())
|
||||||
|
{
|
||||||
|
Database::Track::id_type trackId = boost::any_cast<Database::Track::id_type>(_model->data(rowId, 0));
|
||||||
|
|
||||||
|
Database::Track::pointer track = Database::Track::getById(_db.getSession(), trackId);
|
||||||
|
if (track)
|
||||||
|
{
|
||||||
|
_playingTrackId = rowId;
|
||||||
|
_sigTrackPlay.emit(track->getPath());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
++rowId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace UserInterface
|
||||||
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PLAY_QUEUE_HPP
|
||||||
|
#define PLAY_QUEUE_HPP
|
||||||
|
|
||||||
|
#include <Wt/WTableView>
|
||||||
|
#include <Wt/WStandardItemModel>
|
||||||
|
|
||||||
|
#include "database/DatabaseHandler.hpp"
|
||||||
|
#include "database/AudioTypes.hpp"
|
||||||
|
|
||||||
|
namespace UserInterface {
|
||||||
|
|
||||||
|
class PlayQueue : public Wt::WTableView
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PlayQueue(Database::Handler& db, Wt::WContainerWidget* parent = 0);
|
||||||
|
|
||||||
|
void addTracks(const std::vector<Database::Track::id_type>& trackIds);
|
||||||
|
|
||||||
|
void clear(void);
|
||||||
|
|
||||||
|
void play(void);
|
||||||
|
|
||||||
|
// Signals
|
||||||
|
Wt::Signal< boost::filesystem::path >& playTrack() { return _sigTrackPlay; }
|
||||||
|
|
||||||
|
// Slots
|
||||||
|
void saveToPlaylist(std::string& playListName);
|
||||||
|
void loadFromPlaylist(std::string& playListName);
|
||||||
|
void handlePlaybackComplete(void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void readTrack(int rowId);
|
||||||
|
|
||||||
|
Wt::Signal< boost::filesystem::path > _sigTrackPlay;
|
||||||
|
|
||||||
|
Database::Handler& _db;
|
||||||
|
|
||||||
|
Wt::WStandardItemModel* _model;
|
||||||
|
|
||||||
|
int _playingTrackId;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace UserInterface
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -105,7 +105,7 @@ TableFilter::getConstraint(Constraint& constraint)
|
|||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ResultType result = _queryModel.resultRow( index.row() );
|
const ResultType& result = _queryModel.resultRow( index.row() );
|
||||||
|
|
||||||
// Get the track part
|
// Get the track part
|
||||||
std::string name( result.get<0>() );
|
std::string name( result.get<0>() );
|
||||||
|
|||||||
+33
-17
@@ -44,10 +44,10 @@ _db(db)
|
|||||||
_queryModel.addColumn( "track.original_date", "Original Date" );
|
_queryModel.addColumn( "track.original_date", "Original Date" );
|
||||||
_queryModel.addColumn( "track.genre_list", "Genres" );
|
_queryModel.addColumn( "track.genre_list", "Genres" );
|
||||||
|
|
||||||
_queryModel.setBatchSize(250);
|
_queryModel.setBatchSize(500);
|
||||||
|
|
||||||
this->setSortingEnabled(true);
|
this->setSortingEnabled(true);
|
||||||
this->setSelectionMode(Wt::SingleSelection);
|
this->setSelectionMode(Wt::ExtendedSelection);
|
||||||
this->setAlternatingRowColors(true);
|
this->setAlternatingRowColors(true);
|
||||||
this->setModel(&_queryModel);
|
this->setModel(&_queryModel);
|
||||||
|
|
||||||
@@ -83,8 +83,21 @@ _db(db)
|
|||||||
this->setItemDelegateForColumn(7, delegate);
|
this->setItemDelegateForColumn(7, delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO other event!
|
// If an item is double clicked, select the track and emit signal
|
||||||
this->selectionChanged().connect(this, &TrackView::handleTrackSelected);
|
this->doubleClicked().connect( std::bind([=] (Wt::WModelIndex idx, Wt::WMouseEvent evt)
|
||||||
|
{
|
||||||
|
if (!idx.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Wt::WModelIndexSet indexSet;
|
||||||
|
indexSet.insert(idx);
|
||||||
|
|
||||||
|
this->setSelectedIndexes( indexSet );
|
||||||
|
|
||||||
|
_sigTrackDoubleClicked.emit( );
|
||||||
|
|
||||||
|
}, std::placeholders::_1, std::placeholders::_2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set constraints created by parent filters
|
// Set constraints created by parent filters
|
||||||
@@ -113,6 +126,7 @@ TrackView::refresh(const Constraint& constraint)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void
|
void
|
||||||
TrackView::handleTrackSelected(void)
|
TrackView::handleTrackSelected(void)
|
||||||
{
|
{
|
||||||
@@ -133,26 +147,28 @@ TrackView::handleTrackSelected(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
TrackView::selectNextTrack(void)
|
TrackView::getSelectedTracks(std::vector<Database::Track::id_type>& track_ids)
|
||||||
{
|
{
|
||||||
|
LMS_LOG(MOD_UI, SEV_DEBUG) << "Getting selected tracks...";
|
||||||
|
|
||||||
Wt::WModelIndexSet indexSet = this->selectedIndexes();
|
Wt::WModelIndexSet indexSet = this->selectedIndexes();
|
||||||
if (!indexSet.empty()) {
|
|
||||||
Wt::WModelIndex currentIndex( *indexSet.begin() );
|
|
||||||
// Check there are remainin tracks!
|
|
||||||
if (currentIndex.isValid() && this->model()->rowCount() > currentIndex.row() + 1)
|
|
||||||
{
|
|
||||||
this->select( this->model()->index( currentIndex.row() + 1, currentIndex.column()));
|
|
||||||
|
|
||||||
ResultType result = _queryModel.resultRow( currentIndex.row() + 1 );
|
BOOST_FOREACH(Wt::WModelIndex index, indexSet)
|
||||||
|
{
|
||||||
|
if (!index.isValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
// Get the track part
|
const ResultType& result = _queryModel.resultRow( index.row() );
|
||||||
Wt::Dbo::ptr<Database::Track> track ( result.get<0>() );
|
|
||||||
|
|
||||||
_trackSelected.emit( track->getPath() );
|
// Get the track part
|
||||||
}
|
Wt::Dbo::ptr<Database::Track> track ( result.get<0>() );
|
||||||
|
|
||||||
|
track_ids.push_back(track.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LMS_LOG(MOD_UI, SEV_DEBUG) << "Getting all selected tracks DONE...";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|||||||
@@ -36,22 +36,24 @@ class TrackView : public Wt::WTableView, public Filter
|
|||||||
|
|
||||||
TrackView( Database::Handler& db, Wt::WContainerWidget* parent = 0);
|
TrackView( Database::Handler& db, Wt::WContainerWidget* parent = 0);
|
||||||
|
|
||||||
|
// Filter interface
|
||||||
// Set constraints created by parent filters
|
// Set constraints created by parent filters
|
||||||
void refresh(const Constraint& constraint);
|
void refresh(const Constraint& constraint);
|
||||||
|
|
||||||
// Create constraints for child filters (N/A)
|
// Create constraints for child filters (N/A)
|
||||||
void getConstraint(Constraint& constraint) {}
|
void getConstraint(Constraint& constraint) {}
|
||||||
|
|
||||||
void selectNextTrack(void); // Emit a trackSelected() if success
|
|
||||||
|
|
||||||
// Signals
|
// Get all the tracks that are currently displayed
|
||||||
Wt::Signal< boost::filesystem::path >& trackSelected() { return _trackSelected; }
|
void getSelectedTracks(std::vector<Database::Track::id_type>& track_ids);
|
||||||
|
|
||||||
|
typedef Wt::Signal<void> SigTrackDoubleClicked;
|
||||||
|
|
||||||
|
SigTrackDoubleClicked& trackDoubleClicked() { return _sigTrackDoubleClicked; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void handleTrackSelected();
|
SigTrackDoubleClicked _sigTrackDoubleClicked;
|
||||||
|
|
||||||
Wt::Signal< boost::filesystem::path > _trackSelected;
|
|
||||||
|
|
||||||
Database::Handler& _db;
|
Database::Handler& _db;
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ AvConvTranscodeStreamResource::handleRequest(const Wt::Http::Request& request,
|
|||||||
if (!transcoder->isComplete() && response.out()) {
|
if (!transcoder->isComplete() && response.out()) {
|
||||||
continuation = response.createContinuation();
|
continuation = response.createContinuation();
|
||||||
continuation->setData(transcoder);
|
continuation->setData(transcoder);
|
||||||
LMS_LOG(MOD_UI, SEV_DEBUG) << "Continuation set!";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LMS_LOG(MOD_UI, SEV_DEBUG) << "No more data!";
|
LMS_LOG(MOD_UI, SEV_DEBUG) << "No more data!";
|
||||||
|
|||||||
Reference in New Issue
Block a user