Added some logic in the playqueue (play next / play previous handling)
This commit is contained in:
@@ -109,6 +109,19 @@ Playlist::getEntries(int offset, int size, bool& moreResults) const
|
||||
return res;
|
||||
}
|
||||
|
||||
Wt::Dbo::ptr<PlaylistEntry>
|
||||
Playlist::getEntry(std::size_t pos) const
|
||||
{
|
||||
Wt::Dbo::ptr<PlaylistEntry> res;
|
||||
|
||||
bool moreResults;
|
||||
auto entries = getEntries(pos, 1, moreResults);
|
||||
if (!entries.empty())
|
||||
res = entries.front();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
Playlist::getCount() const
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ class Playlist : public Wt::Dbo::Dbo<Playlist>
|
||||
|
||||
// Get tracks, ordered by position
|
||||
std::size_t getCount() const;
|
||||
Wt::Dbo::ptr<PlaylistEntry> getEntry(std::size_t pos) const;
|
||||
std::vector<Wt::Dbo::ptr<PlaylistEntry>> getEntries(int offset, int size, bool& moreResults) const;
|
||||
|
||||
template<class Action>
|
||||
|
||||
Reference in New Issue
Block a user