about summary refs log tree commit homepage
path: root/lib/dtas/player.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-09 07:43:24 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-09 07:43:24 +0000
commit137e36e346a4641850183684ab136fe781af121a (patch)
tree83a90222af83170991ef6860b0f20e345dbf0112 /lib/dtas/player.rb
parente71bbefa44135f6e84912cd9ab824397dfb72286 (diff)
downloaddtas-137e36e346a4641850183684ab136fe781af121a.tar.gz
We should return to the starting position of the tracklist if we
are idle.
Diffstat (limited to 'lib/dtas/player.rb')
-rw-r--r--lib/dtas/player.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index a8c7fe0..8926e0b 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -359,7 +359,7 @@ class DTAS::Player # :nodoc:
       end
     end
 
-    echo "idle"
+    player_idle
     nil
   end
 
@@ -388,10 +388,15 @@ class DTAS::Player # :nodoc:
       @srv.wait_ctl(dst, :wait_readable)
     else
       stop_sinks if @sink_buf.inflight == 0
-      echo "idle"
+      player_idle
     end
   end
 
+  def player_idle
+    @tl.reset
+    echo "idle"
+  end
+
   def drop_target(target)
     @srv.wait_ctl(target, :delete)
     target.close