about summary refs log tree commit homepage
path: root/lib/dtas/player/client_handler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dtas/player/client_handler.rb')
-rw-r--r--lib/dtas/player/client_handler.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 0aa264f..500704a 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -584,6 +584,15 @@ module DTAS::Player::ClientHandler # :nodoc:
         return io.emit("repeat #{@tl.repeat.to_s}")
       end
       io.emit("OK")
+    when 'shuffle'
+      v = msg.shift
+      case v
+      when nil then io.emit("shuffle #{(!!@tl.shuffle).to_s}")
+      when 'debug' then io.emit(@tl.shuffle.to_yaml) # TODO: remove
+      else
+        set_bool(io, 'tl shuffle', v) { |b| @tl.shuffle = b }
+        io.emit('OK')
+      end
     when "remove"
       track_id = msg.shift or return io.emit("ERR track_id not specified")
       track_id = track_id.to_i