lib/Video/PlaybackMachine/FillProducer/UpNext.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
add_text
2.0
is_available
2.0
BEGIN
2.0
CRAP 2.0
1 package Video::PlaybackMachine::FillProducer::UpNext;
2  
3 our $VERSION = '0.09'; # VERSION
4  
5 ####
6 #### Video::PlaybackMachine::FillProducer::UpNext
7 ####
8 #### $Revision$
9 ####
10  
11 use Moo;
12  
13 use Carp;
14  
15 extends 'Video::PlaybackMachine::FillProducer::TextFrame';
16  
17 use POE;
18  
19 use POSIX qw(strftime);
20  
21 ############################# Class Constants #############################
22  
23 ############################## Class Methods ##############################
24  
25 ############################# Object Methods ##############################
26  
27 ##
28 ## add_text()
29 ##
30 sub add_text {
31 my $self = shift;
32 my ($image) = @_;
33  
34 my $entry = $poe_kernel->call('Scheduler', 'query_next_scheduled')
35 or return;
36 my $next_time = strftime '%l:%M', localtime ($entry->start_time());
37  
38 $self->write_centered($image, "Up Next:\n\n" . $entry->movie_info()->title() ."\n\n$next_time");
39  
40  
41 }
42  
43 ##
44 ## is_available
45 ##
46 ## We are available if there is something "next"
47 ##
48 sub is_available {
49 my $self = shift;
50  
51 my $entry = $poe_kernel->call('Scheduler', 'query_next_scheduled')
52 or return;
53
54 $entry->movie_info() or return;
55
56 1;
57 }
58  
59 1;