class Mpg123Remote::Player
Public Class Methods
new(path='/tmp/mpg123in')
click to toggle source
# File lib/mpg123_remote.rb, line 4 def initialize path='/tmp/mpg123in' @path = path end
Public Instance Methods
execute(*args)
click to toggle source
# File lib/mpg123_remote.rb, line 17 def execute *args File.open(@path, 'w') do |f| f.puts args.join ' ' end end
play(path)
click to toggle source
# File lib/mpg123_remote.rb, line 13 def play path execute "LOAD #{Dir.pwd}/#{path}" end
somafm(station)
click to toggle source
# File lib/mpg123_remote.rb, line 8 def somafm station station ||= 'secretagent' execute 'loadlist', 0, "http://somafm.com/startstream=#{station}.pls" end