#!/usr/bin/perl

IRC::register("Bob's qxmms X-Chat-end","1.0","","qxmms.pl");
IRC::print("Loaded has Bob's qxmms X-Chat-end.");
IRC::add_command_handler("mp3","spam");

sub spam() {
	$qxmms = `qxmms -ptbslLQ`;
	if($qxmms =~ /\"(.*)\" \"(.*)\" \"(.*)\" \"(.*)\" \"(.*)\"/) {
		$playno = $1;
		$title = $2;
		$br = $3;
		$sr = $4;
		$length = $5;
	}
	IRC::command("/say " . sprintf("[XMMS]%s. %s[%s][%s %s]",$playno,$title,$length,$br,$sr));
}

# printf("[XMMS]%s. %s[%s][%s %s]\n",$playno,$title,$length,$br,$sr);
