From 385563d1d99fda2735c78884ab135c8b77bc651a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 Sep 2013 08:33:05 +0000 Subject: player: s/echo/wall/ for broadcasting to all watchers "wall" is analogous to the wall(1) command, so we shall use that instead of echo. --- lib/dtas/player.rb | 12 ++++++------ lib/dtas/player/client_handler.rb | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb index 9ab45fc..6236be6 100644 --- a/lib/dtas/player.rb +++ b/lib/dtas/player.rb @@ -54,7 +54,7 @@ class DTAS::Player # :nodoc: @sources = @source_map.values.sort_by { |src| src.tryorder } end - def echo(msg) + def wall(msg) msg = xs(Array(msg)) @watchers.delete_if do |io, _| if io.closed? @@ -197,7 +197,7 @@ class DTAS::Player # :nodoc: do_seek(io, msg[0]) when "clear" @queue.clear - echo("clear") + wall("clear") io.emit("OK") when "rg" rg_handler(io, msg) @@ -372,13 +372,13 @@ class DTAS::Player # :nodoc: case source_spec when String pending = try_file(source_spec) or return - echo(%W(file #{pending.infile})) + wall(%W(file #{pending.infile})) when Array pending = try_file(*source_spec) or return - echo(%W(file #{pending.infile} #{pending.offset_samples}s)) + wall(%W(file #{pending.infile} #{pending.offset_samples}s)) else pending = DTAS::Source::Cmd.new(source_spec["command"]) - echo(%W(command #{pending.command_string})) + wall(%W(command #{pending.command_string})) end dst = @sink_buf @@ -394,7 +394,7 @@ class DTAS::Player # :nodoc: def player_idle @tl.reset - echo "idle" + wall("idle") end def drop_target(target) diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb index 9697f39..6070851 100644 --- a/lib/dtas/player/client_handler.rb +++ b/lib/dtas/player/client_handler.rb @@ -317,7 +317,7 @@ module DTAS::Player::ClientHandler # :nodoc: def skip_handler(io, msg) __current_drop - echo("skip") + wall("skip") io.emit("OK") end @@ -334,13 +334,13 @@ module DTAS::Player::ClientHandler # :nodoc: def do_pause return if @paused - echo("pause") + wall("pause") @paused = true __current_requeue end def do_play - # no echo, next_source will echo on new track + # no wall, next_source will wall on new track @paused = false return if @current next_source(_next) @@ -489,7 +489,7 @@ module DTAS::Player::ClientHandler # :nodoc: rescue => e return io.emit("ERR chdir: #{e.message}") end - # echo(%W(cd msg[0])) # should we broadcast this? + # wall(%W(cd msg[0])) # should we broadcast this? io.emit("OK") end -- cgit v1.2.3-24-ge0c7