summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/playlist.c b/playlist.c
index d2f9e9af..c4808acb 100644
--- a/playlist.c
+++ b/playlist.c
@@ -573,3 +573,32 @@ ps_find_meta (playItem_t *it, const char *key) {
}
return "?";
}
+
+void
+ps_delete_selected (void) {
+ playItem_t *next = NULL;
+ for (playItem_t *it = playlist_head; it; it = next) {
+ next = it->next;
+ if (it->selected) {
+ if (it->prev) {
+ it->prev->next = it->next;
+ }
+ if (it->next) {
+ it->next->prev = it->prev;
+ }
+ if (playlist_head == it) {
+ playlist_head = it->next;
+ }
+ if (playlist_tail == it) {
+ playlist_tail = it->prev;
+ }
+ if (playlist_current_ptr == it) {
+ playlist_current_ptr = NULL;
+ }
+ ps_item_free (it);
+ free (it);
+ ps_count--;
+ }
+ }
+}
+