[CSCMail-Users] Re: Sound Problems
Brought to you by:
countzer0
|
From: Ben B. <be...@oc...> - 2000-10-17 18:30:01
|
Hey Ya'll,
I was poking around in cscget this morning trying to figure out
what my sound problems were. And I made a few adjustments to the script.
I found that the sound was being played before any duplicate checking
was happening, so I switched things around a little. Now it only plays
the sound if there are NEW messages on the server as opposed to ANY
messages. Below is the diff after the changes I made. I hope it's
useful to you. I'm still working on the XMMS conflict. Cscget still
hangs if I'm playing any wav audio but it does it at the end of the
process rather than interrupting the mail retrieval. I think this
problem has to do with linux or esd or my sound card or...
Later,
Ben
Running CSCMail 1.6.1
[ben@va01l]$ diff /usr/bin/cscget.orig /usr/bin/cscget
116a117,119
> # init a variable for counting any NEW messages
> my $new_mail_count = 0;
>
173c176,178
< if ($prefs{'PlaySound'} eq "y") {
system("$prefs{'SndCmd'} $prefs{'SndFl'}"); }
---
>
> # if ($prefs{'PlaySound'} eq "y") {
system("$prefs{'SndCmd'} $prefs{'SndFl'}"); }
>
219a225,228
>
> # I am not using a physical mail
spool for any of my accounts so I haven't tested
> # this part yet but I think this
is where it should go.
> $new_mail_count ++;
229c238
< }
---
> }
274c283
< if ($prefs{'PlaySound'} eq "y") {
system("$prefs{'SndCmd'} $prefs{'SndFl'}"); }
---
> # if ($prefs{'PlaySound'} eq "y") {
system("$prefs{'SndCmd'} $prefs{'SndFl'}"); }
315c324
< }
---
> }
346a356,360
>
> # I had some problems so I used
the following line for testing
> # print STDOUT "counting mail as
no dupe (pop3)\n";
> $new_mail_count ++;
>
390c404
< }# end getmessage
---
> }# end getmessage
406c420,425
<
---
> # if we have new mail let's play a sound. system call return value
check taken from perl cookbook p230 quick and dirty version
> if ($prefs{'PlaySound'} eq "y" && $new_mail_count > 0)
> {
> my $rc = 0xffff & system("$prefs{'SndCmd'} $prefs{'SndFl'}");
> warn "bad return code ($rc) from PlaySound system call: $!\n"
unless ($rc == 0);
> }
|