summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7dab37)
raw | patch | inline | side by side (parent: b7dab37)
author | Romain Bignon <romain@peerfuse.org> | |
Tue, 10 Feb 2009 13:09:32 +0000 (14:09 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 10 Feb 2009 14:21:12 +0000 (15:21 +0100) |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 665a986c3080dece6d2715046cd676bccfb10035..eb26893c1e5ace2e61fe1d26f2af1280fa381f86 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
center_playing_item(c);
playlist_repaint();
return false;
+ case CMD_SHUFFLE:
+ {
+ unsigned i = lw->selected_start + 1;
+ unsigned last_selected = lw->selected;
+ if(!lw->visual_selection)
+ /* No visual selection, shuffle all list. */
+ break;
+ for(; i <= lw->selected_end; ++i)
+ mpdclient_cmd_move(c, i, lw->selected_start + (rand() % ((i - lw->selected_start) + 1)));
+
+ lw->selected = last_selected;
+ screen_status_printf(_("Shuffled selection!"));
+
+ return true;
+ }
case CMD_LIST_MOVE_UP:
if(lw->selected_start == 0)
return false;