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