Skip to content

Commit

Permalink
run mplayer for playing mp3 files
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubujka committed Jan 22, 2012
1 parent 02ca67a commit 980e04e
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions commands/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,6 @@ def move_to file, ddir
end

file_cmd :play_sound_file do |file|
IO.popen("mplayer #{file.esc} -loop 0 2> /dev/null ", "r+") do |io|
clear
puts "Playing #{file}"
puts "Commands: "
puts " space: pause"
puts " r: restart"
puts " q: abort"
while t = get_char
if t == "q"
io.close
goto_file_mode file
end
if t == " "
io.print " " # pause
end
if t == "r"
io.print(27.chr + 91.chr + 54.chr + 126.chr) # restart
end
end
end
clear
system "mplayer #{file.esc} -loop 0 2> /dev/null "
end

0 comments on commit 980e04e

Please sign in to comment.