A feature-rich, modular AOL Instant Messenger client written chiefly by Bill Atkins and Dan Chokola in their high school days.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
968 B

package Sound;
use warnings;
use Milkbone;
eval "use Win32::Sound" if $^O =~ /Win32/;
register_hook("signed_in", sub { play_sound("signed_in"); });
register_hook("protocol_go_away", sub { play_sound("go_away"); });
register_hook("protocol_return", sub { play_sound("return"); });
register_hook("msg_in", sub { play_sound("msg_in"); });
register_hook("protocol_send_im", sub { play_sound("send_im"); });
register_hook("buddy_in", sub { play_sound("buddy_in"); });
register_hook("buddy_out", sub { play_sound("buddy_out"); });
register_hook("error", sub { play_sound("error"); });
register_hook("protocol_signoff", sub { play_sound("signoff"); });
sub play_sound
{
return if hook("protocol_away_status") and !option("SoundsWhileAway") and $_[0] ne "go_away";
my ($name) = @_;
my $path = "sounds/$name.wav";
return unless -e $path;
if($^O =~ m/Win32/)
{
Win32::Sound::Play($path, 0x0001 | 0x0010);
}
else
{
exec 'play', $path unless fork();
}
}