diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-07-31 22:56:59 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-07-31 22:56:59 +0200 |
commit | 12e2421e2bf9f8565fee5f3ff40e208408a333d4 (patch) | |
tree | 5bdc04278510429bf9d32110640b8658de65ab68 /playlist.c | |
parent | 79d0a9187928ccb832eefff59c609dfe03bb79fb (diff) |
implemented "delete selection"
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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--; + } + } +} + |