summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58d0563)
raw | patch | inline | side by side (parent: 58d0563)
author | Max Kellermann <max@duempel.org> | |
Sun, 18 Oct 2009 00:21:13 +0000 (02:21 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 18 Oct 2009 00:21:13 +0000 (02:21 +0200) |
Instead of swapping every single song in the selected range, send one
single "move" command which moves the neighbor song to the other end
of the range.
single "move" command which moves the neighbor song to the other end
of the range.
NEWS | patch | blob | history | |
src/screen_queue.c | patch | blob | history |
index 7b12cbec5f0cd462cf66e0bc2d8beca5f0737c2f..4e7906d3acef0a5d26044e9cd978580f1950987d 100644 (file)
--- a/NEWS
+++ b/NEWS
* strfsong: support multiple values for a tag
* screen_browser: different colors for directories and playlists
* screen_browser: display song duration
+* screen_queue: move ranges with one single "move" command
ncmpc 0.15 - 2009-09-24
diff --git a/src/screen_queue.c b/src/screen_queue.c
index 7d915ebf9b242496175727962c2794f1503631f2..02978eab5fd291b890b770fc77ef19cc0059c5ef 100644 (file)
--- a/src/screen_queue.c
+++ b/src/screen_queue.c
if (range.start == 0 || range.end <= range.start)
return false;
- for (unsigned i = range.start; i < range.end; ++i)
- mpdclient_cmd_swap(c, i, i - 1);
+ if (!mpdclient_cmd_move(c, range.end - 1, range.start - 1))
+ return true;
lw->selected--;
lw->range_base--;
if (range.end >= playlist_length(&c->playlist))
return false;
- for (int i = range.end - 1; i >= (int)range.start; --i)
- mpdclient_cmd_swap(c, i, i + 1);
+ if (!mpdclient_cmd_move(c, range.start, range.end))
+ return true;
lw->selected++;
lw->range_base++;