line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Growl::Any::Win32MSAgent; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
88
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
73
|
|
5
|
3
|
|
|
3
|
|
12
|
use parent qw(Growl::Any::Base); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
13
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
120
|
use Carp (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
47
|
|
8
|
3
|
|
|
3
|
|
863
|
use Win32::MSAgent (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
210
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
0
|
|
|
0
|
0
|
|
my ($self, $appname, $events) = @_; |
12
|
0
|
|
|
|
|
|
$self->SUPER::register($appname, $events); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my $character = 'Merlin'; |
15
|
0
|
|
|
|
|
|
my $agent = Win32::MSAgent->new($character); |
16
|
0
|
|
|
|
|
|
$agent->Language2LanguageID("English (United States)"); |
17
|
0
|
|
|
|
|
|
$self->{instance} = $agent->Characters($character); |
18
|
0
|
|
|
|
|
|
$self->{instance}->SoundEffectsOn(1); |
19
|
0
|
|
|
|
|
|
$self->{instance}->Show(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub notify { |
23
|
0
|
|
|
0
|
0
|
|
my ($self, $event, $title, $message, $icon) = @_; |
24
|
0
|
|
|
|
|
|
my $req = $self->{instance}->Speak("[$event]$title"."\n".$message); |
25
|
0
|
|
|
|
|
|
my $i = 0; |
26
|
0
|
|
0
|
|
|
|
while (($req->Status == 2) || ($req->Status == 4)) { |
27
|
0
|
0
|
|
|
|
|
$self->{instance}->Stop($req) if $i >10; |
28
|
0
|
|
|
|
|
|
sleep(1); |
29
|
0
|
|
|
|
|
|
$i++; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |