line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::FindEvent; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
14
|
use vars qw($VERSION @EXPORTER); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
146
|
|
4
|
|
|
|
|
|
|
$VERSION = 0.01; |
5
|
|
|
|
|
|
|
@EXPORTER = qw(new configure foundevent); |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
83
|
|
8
|
2
|
|
|
2
|
|
12
|
use Video::Event; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
73
|
|
9
|
2
|
|
|
2
|
|
10018
|
use Data::Dumper; |
|
2
|
|
|
|
|
38188
|
|
|
2
|
|
|
|
|
887
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
13
|
0
|
|
0
|
|
|
|
my $self = bless {}, ref($class) || $class; |
14
|
0
|
|
|
|
|
|
$self->{'events'} = (); |
15
|
0
|
|
|
|
|
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub configure { |
19
|
0
|
|
|
0
|
0
|
|
my ($self, $args) = @_; |
20
|
0
|
|
|
|
|
|
foreach my $arg (keys %$args) { |
21
|
0
|
|
|
|
|
|
$self->{$arg} = $$args{$arg}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub foundevent { |
26
|
|
|
|
|
|
|
#don't override |
27
|
0
|
|
|
0
|
0
|
|
my ($self, $time, $coolness, $probability, $boundary, $keepstate) = @_; |
28
|
0
|
0
|
|
|
|
|
if ($self->{'writefile '} ne '') { |
29
|
0
|
0
|
|
|
|
|
if ($$keepstate{'eventhandle'}) { |
30
|
0
|
|
|
|
|
|
my $FH = $$keepstate{'eventhandle'}; |
31
|
0
|
0
|
|
|
|
|
print $FH "$time\n" if $boundary; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
0
|
0
|
|
|
|
|
if ($boundary) { |
35
|
0
|
|
|
|
|
|
my $file = $self->{'writeto'}; |
36
|
0
|
|
|
|
|
|
open FH, ">>$file.bdy"; |
37
|
0
|
|
|
|
|
|
print FH "$time\n"; |
38
|
0
|
|
|
|
|
|
close FH; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
my $hash = { 'time' => $time, |
42
|
|
|
|
|
|
|
'probability' => $probability, |
43
|
|
|
|
|
|
|
'boundary' => $boundary, |
44
|
|
|
|
|
|
|
'coolness' => $coolness, |
45
|
|
|
|
|
|
|
'envelope' => { 0 => 1 }, |
46
|
|
|
|
|
|
|
}; |
47
|
0
|
|
|
|
|
|
my $event = Event->new($hash); |
48
|
0
|
0
|
|
|
|
|
if ($$keepstate{'eventarray'}) { |
49
|
0
|
|
|
|
|
|
push @{$$keepstate{'eventarray'}}, $event; |
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
0
|
|
|
|
|
|
my $file = $self->{'writefile'}; |
53
|
0
|
|
|
|
|
|
open GH, ">>$file.obj"; |
54
|
0
|
|
|
|
|
|
my $dump = Dumper($event); |
55
|
0
|
|
|
|
|
|
print GH "$dump\n"; |
56
|
0
|
|
|
|
|
|
close GH; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
return $keepstate; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |