playlist: Give PlaylistQueues a clear() function

This is used to clear the queue before populating it with a different
playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-02-06 14:11:58 -05:00
parent 5026e80eab
commit d0fb9b2155
1 changed files with 7 additions and 3 deletions

View File

@ -17,13 +17,17 @@ public:
set_flag(Q_NO_SORT); set_flag(Q_NO_SORT);
} }
void clear()
{
while (size() > 0)
del((unsigned)0);
}
void fill(IndexEntry *ent) void fill(IndexEntry *ent)
{ {
std::set<unsigned int>::iterator it; std::set<unsigned int>::iterator it;
while (size() > 0) clear();
del((unsigned)0);
for (it = ent->begin(); it != ent->end(); it++) for (it = ent->begin(); it != ent->end(); it++)
add(tags :: get_track(*it)); add(tags :: get_track(*it));
} }