From 3e013d3f24f0f935dce985d4c6bd155889e05dbb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Dec 2015 03:51:33 +0000 Subject: tracklist: shuffle support 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. --- lib/dtas/player/client_handler.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/dtas/player') 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 -- cgit v1.2.3-24-ge0c7