line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::Delay::Array; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Pragmas. |
4
|
5
|
|
|
5
|
|
119640
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
113
|
|
5
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
147
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Modules. |
8
|
5
|
|
|
5
|
|
3444
|
use Class::Utils qw(set_params); |
|
5
|
|
|
|
|
117208
|
|
|
5
|
|
|
|
|
138
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Version. |
11
|
|
|
|
|
|
|
our $VERSION = 0.05; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Constructor. |
14
|
|
|
|
|
|
|
sub new { |
15
|
5
|
|
|
5
|
1
|
4744
|
my ($class, @params) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Create object. |
18
|
5
|
|
|
|
|
12
|
my $self = bless {}, $class; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Array. |
21
|
5
|
|
|
|
|
21
|
$self->{'array'} = [1000, 2000, 3000]; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Loop. |
24
|
5
|
|
|
|
|
12
|
$self->{'loop'} = 1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Process params. |
27
|
5
|
|
|
|
|
22
|
set_params($self, @params); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Index. |
30
|
3
|
|
|
|
|
35
|
$self->{'index'} = 0; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Object. |
33
|
3
|
|
|
|
|
11
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Get delay. |
37
|
|
|
|
|
|
|
sub delay { |
38
|
6
|
|
|
6
|
1
|
1520
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Return value. |
41
|
6
|
|
|
|
|
7
|
my $ret; |
42
|
6
|
100
|
|
|
|
8
|
if ($self->{'index'} <= @{$self->{'array'}} - 1) { |
|
6
|
|
|
|
|
20
|
|
43
|
5
|
|
|
|
|
9
|
$ret = $self->{'array'}->[$self->{'index'}]; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Increment. |
47
|
6
|
|
|
|
|
10
|
$self->{'index'}++; |
48
|
6
|
100
|
100
|
|
|
15
|
if ($self->{'loop'} && $self->{'index'} > @{$self->{'array'}} - 1) { |
|
3
|
|
|
|
|
16
|
|
49
|
1
|
|
|
|
|
1
|
$self->{'index'} = 0; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# Value. |
53
|
6
|
|
|
|
|
14
|
return $ret; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |