module Quiyo::Server
Public Instance Methods
list(type, arg = nil)
click to toggle source
# File lib/quiyo/server.rb, line 33 def list(type, arg = nil) case type when "artists" @mpd.artists.each { |s| p s } when "albums" @mpd.albums(arg.drop(1).join(" ")).each { |s| p s } end end
quit()
click to toggle source
# File lib/quiyo/server.rb, line 12 def quit @mpd.disconnect Process.exit end
search(action)
click to toggle source
# File lib/quiyo/server.rb, line 23 def search(action) @mpd.search(action[1], action.drop(2).join(" ")).each { |s| printf "%s : %s [%s]\n" % [ colorize(s.artist, 99), colorize(s.title, 202), colorize(s.album, 107) ] } end
vol(arg)
click to toggle source
# File lib/quiyo/server.rb, line 17 def vol(arg) @mpd.volume=(arg) rescue p "Usage: vol [0-100]" end