about summary refs log tree commit homepage
path: root/lib/dtas/player
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-07 03:51:33 +0000
committerEric Wong <e@80x24.org>2015-12-07 05:22:20 +0000
commit3e013d3f24f0f935dce985d4c6bd155889e05dbb (patch)
tree7c9dfae4dc7939265ff4abe2b906ef91a884cb19 /lib/dtas/player
parente5668a47f20a6593ab47847083bc704e1abeb1e6 (diff)
downloaddtas-3e013d3f24f0f935dce985d4c6bd155889e05dbb.tar.gz
This is in the MPRIS 2.0 TrackList spec and also in mpd (as "repeat"
mode), so we can probably support it directly in player to ease
implementations of future wrappers.
Diffstat (limited to 'lib/dtas/player')
-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