lib/Video/PlaybackMachine/TimeLayout/FixedTimeLayout.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 87.5% 21 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BUILDARGS
1.0
CRAP 1.0
« lib/Video/PlaybackMachine.pm ↑ Summary lib/Video/PlaybackMachine/FillProducer.pm »
1 package Video::PlaybackMachine::TimeLayout::FixedTimeLayout;
2  
3 4 our $VERSION = '0.09'; # VERSION
4  
5 ####
6 #### Video::PlaybackMachine::TimeLayout::FixedTimeLayout
7 ####
8 #### $Revision$
9 ####
10 #### A TimeLayout that indicates that a certain FillProducer only
11 #### wants to generate content for a fixed amount of time.
12 ####
13  
14 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 has 'time' => (
17 is => 'ro',
18 required => 1
19 );
20  
21 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 11 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=1 SCAR=0.0
Pod undocumented
24 11 my $type = shift;
25 11 my ($time) = @_;
26  
27 11 return { time => $time };
28 }
29  
30 ############################# Object Methods ##############################
31  
32 ##
33 ## min_time()
34 ##
35 ## Returns the minimum amount of time the fill can take. In this case,
36 ## returns the fixed time.
37 ##
38 20 ▶sub min_time {
Subroutine min_time: called CC=1 SCAR=0.0
Pod undocumented
39 20 my $self = shift;
40  
41 20 return $self->time();
42 }
43  
44 ##
45 ## preferred_time()
46 ##
47 ## Arguments:
48 ## TIME_LEFT
49 ##
50 ## Returns the fixed time.
51 ##
52 6 ▶sub preferred_time {
Subroutine preferred_time: called CC=1 SCAR=0.0
Pod undocumented
53 6 my $self = shift;
54  
55 6 return $self->time;
56 }
57  
58 4 1;
« lib/Video/PlaybackMachine.pm ↑ Summary lib/Video/PlaybackMachine/FillProducer.pm »