=begin AUTHOR: Kesiev WHAT IT DOES: Adds Audio CD support. Press the refresh button to update the playlist once the disc is inserted. =end require "freedb" $lists << { :icon=>"drive-cdrom", :label=>"Audio CD", :device=>"/dev/cdrom", :onrefresh=>Proc.new { |l| open_cd(l) }, :file=>"#{$opt[:root]}/cdaudio", :protected=>true, :root=>"cdda://" } def open_cd(section) open(section[:file],"w") { |f| begin freedb = Freedb.new(section[:device]) freedb.fetch freedb.get_result(0) freedb.tracks.each_with_index { |t,i| f.puts([freedb.artist,freedb.title,i+1,t["title"],"",(i+1).to_s].join($opt[:separator])) } rescue => error puts "Error: #{error}" end } end