class Anyplayer::Xmms2
Public Instance Methods
album()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 45 def album xmms2 "current -f '${album}'" end
artist()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 41 def artist xmms2 "current -f '${artist}'" end
host()
click to toggle source
Calls superclass method
# File lib/anyplayer/players/xmms2.rb, line 63 def host ENV["XMMS_PATH"] || super end
launched?()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 57 def launched? # xmms2 autolaunches the daemon, so this should always be true %x(xmms2 current 2> /dev/null) $? == 0 end
next()
click to toggle source
Calls superclass method
Anyplayer::Player#next
# File lib/anyplayer/players/xmms2.rb, line 19 def next xmms2 "next" super end
pause()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 10 def pause xmms2 "pause" end
paused?()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 53 def paused? xmms2("current -f '${playback_status}'") == "Paused" end
platforms()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 67 def platforms [:unix, :linux] end
play()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 6 def play xmms2 "play" end
playing?()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 49 def playing? xmms2("current -f '${playback_status}'") == "Playing" end
playpause()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 2 def playpause xmms2 "toggle" end
prev()
click to toggle source
Calls superclass method
Anyplayer::Player#prev
# File lib/anyplayer/players/xmms2.rb, line 14 def prev xmms2 "prev" super end
track()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 37 def track xmms2 "current -f '${title}'" end
voldown()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 24 def voldown set_volume volume - 10 end
volume()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 32 def volume # currently just the first (left?) channel xmms2("server volume").split("\n").first.sub(/([^0-9]*)/, "").to_i end
volup()
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 28 def volup set_volume volume + 10 end
Private Instance Methods
set_volume(num)
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 78 def set_volume(num) num = if num < 0 0 elsif num > 100 100 end xmms2 "server volume #{num}" end
xmms2(command)
click to toggle source
# File lib/anyplayer/players/xmms2.rb, line 73 def xmms2(command) ret = %x(xmms2 #{command}).split("\n").first ret ? ret.strip : "" end