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