libsaria: Remove ids from a playlist
Note that this follows the broken implementation used by the queue. It will remove all ids with the given values rather than the ones at a specifix index. This will be fixed later when I update the UI to make it Playlist-aware. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
7aca058254
commit
95aa5802cd
|
@ -23,6 +23,7 @@ namespace libsaria
|
|||
|
||||
void load();
|
||||
void add_ids(list<sid_t> &);
|
||||
void rm_ids(list<sid_t> &);
|
||||
unsigned int size();
|
||||
|
||||
/* Iterator functions */
|
||||
|
|
|
@ -22,6 +22,12 @@ namespace libsaria
|
|||
plist.insert(plist.end(), ids.begin(), ids.end());
|
||||
}
|
||||
|
||||
void Playlist::rm_ids(list<sid_t> &ids)
|
||||
{
|
||||
for (it = ids.begin(); it != ids.end(); it++)
|
||||
plist.remove(*it);
|
||||
}
|
||||
|
||||
unsigned int Playlist::size()
|
||||
{
|
||||
return plist.size();
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace libsaria
|
|||
list<sid_t>::iterator it;
|
||||
for (it = ids.begin(); it != ids.end(); it++)
|
||||
playqueue.remove(*it);
|
||||
q_queue.rm_ids(ids);
|
||||
save_and_refresh();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue