my $self = {
data_dir => $args->{data_dir} || './sounds/',
+ muted => 1,
};
bless $self, $class;
sub _play {
my ($self, @names) = @_;
+ return if $self->{muted};
+
@names = map { $self->{data_dir} . '/' . $_ . '.wav' } @names;
system (join(' ', 'aplay', @names). ' &');
}
+sub mute { shift->{muted} = 1; }
+sub unmute { shift->{muted} = 0; }
+
sub start { shift->_play('start'); }
sub filled { shift->_play('filled'); }
if ($tty_reader) {
Glib::IO->add_watch(fileno($tty_reader->fh), 'in',
\&scx_read, $tty_reader);
+ $track->{sound}->unmute();
} elsif ($log_reader) {
Glib::Idle->add(\&log_read_start, [ $log_reader, $parser, $opt{f} ]);
} else {