lib/Video/PlaybackMachine/FillProducer/StillFrame.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 71.8% 23 / 32 CC 2 SCAR 9.0
CC
2
Cov
75%
__ANON__
6.0
start
1.3
BEGIN
1.0
CRAP 2.5
« lib/Video/PlaybackMachine/ScheduleView.pm ↑ Summary lib/Video/PlaybackMachine/TimeManager.pm »
1 package Video::PlaybackMachine::FillProducer::StillFrame;
2  
3 3 our $VERSION = '0.09'; # VERSION
4  
5 ####
6 #### Video::PlaybackMachine::FillProducer::StillFrame
7 ####
8 #### $Revision$
9 ####
10 ####
11 ####
12  
13 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 with 'Video::PlaybackMachine::FillProducer::AbstractStill';
16  
17 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 3 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 ############################# Parameters #############################
22  
23 3 has 'image' => (
24 'is' => 'ro',
25 'required' => 1
26 );
27  
28 ############################# Object Methods ##############################
29  
30  
31  
32 ##
33 ## start()
34 ##
35 ## Displays the StillFrame for the appropriate time. Assumes that
36 ## it's being called within a POE session.
37 ##
38 1 ▶sub start {
Subroutine start: called CC=1 SCAR=2.6
Pod undocumented
39 1 my $self = shift;
40  
41 0 ▶ $poe_kernel->post('Player', 'play_still', $self->image(), sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
42 0 my ($rv) = @_;
43 0 ▶ if ( $rv == 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rv == 2) 0 0 0
44 0 $poe_kernel->delay('next_fill');
45 0 $poe_kernel->yield('next_fill');
46 }
47 1 });
48 1 $poe_kernel->delay('next_fill', $self->time_layout()->preferred_time());
49 }
50  
51 ##
52 ## is_available()
53 ##
54 ## Reports that the still is available if the image file is readable.
55 ##
56 19 ▶sub is_available {
Subroutine is_available: called CC=1 SCAR=0.0
Pod undocumented
57 19 my $self = shift;
58  
59 19 return -r $self->image();
60 }
61  
62 3 1;
« lib/Video/PlaybackMachine/ScheduleView.pm ↑ Summary lib/Video/PlaybackMachine/TimeManager.pm »