line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::CPL::TargetList; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
5
|
1
|
|
|
1
|
|
3
|
use Video::CPL::Target; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
6
|
1
|
|
|
1
|
|
4
|
use XML::Writer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
12
|
|
7
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
8
|
1
|
|
|
1
|
|
4
|
use Data::Dumper; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
445
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Video::CPL::TargetList - The great new Video::CPL::TargetList! |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Version 0.08 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Quick summary of what the module does. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Perhaps a little code snippet. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use Video::CPL::TargetList; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $foo = Video::CPL::TargetList->new(); |
33
|
|
|
|
|
|
|
... |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 EXPORT |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
38
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our @FIELDS = qw(backgroundPicLoc headerText operation target); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#dynamic INIT-block creation of these routines has too many problems. spell it out. |
47
|
0
|
0
|
|
0
|
0
|
0
|
sub backgroundPicLoc { my $obj = shift; $obj->{backgroundPicLoc} = shift if @_; return $obj->{backgroundPicLoc};}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
48
|
0
|
0
|
|
0
|
0
|
0
|
sub headerText { my $obj = shift; $obj->{headerText} = shift if @_; return $obj->{headerText};}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
49
|
0
|
0
|
|
0
|
0
|
0
|
sub operation { my $obj = shift; $obj->{operation} = shift if @_; return $obj->{operation};}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
50
|
0
|
0
|
|
0
|
0
|
0
|
sub target { my $obj = shift; $obj->{target} = shift if @_; return $obj->{target};}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 new() |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Create a new TargetList object. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub new { |
59
|
2
|
|
|
2
|
1
|
3
|
my $pkg = shift; |
60
|
2
|
|
|
|
|
4
|
my %parms = @_; |
61
|
2
|
|
|
|
|
5
|
my $ret = {}; |
62
|
2
|
|
|
|
|
4
|
bless $ret,$pkg; |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
4
|
foreach my $x (@FIELDS){ |
65
|
8
|
100
|
|
|
|
15
|
$ret->{$x} = $parms{$x} if defined $parms{$x}; |
66
|
|
|
|
|
|
|
} |
67
|
2
|
|
|
|
|
6
|
foreach my $x (keys %parms){ |
68
|
2
|
50
|
|
|
|
6
|
confess("Parameter ('$x') given to Video::CPL::TargetList::new, but not understood\n") if !defined $ret->{$x}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
2
|
|
|
|
|
6
|
return $ret; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 xmlo |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Given an XML::Writer object, add the xml information for this TargetList. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub xmlo { |
81
|
1
|
|
|
1
|
1
|
1
|
my $obj = shift; |
82
|
1
|
|
|
|
|
2
|
my $xo = shift; |
83
|
1
|
|
|
|
|
1
|
my %p; |
84
|
1
|
|
|
|
|
3
|
foreach my $x (@FIELDS){ |
85
|
4
|
100
|
|
|
|
8
|
next if $x eq "target"; |
86
|
3
|
50
|
|
|
|
6
|
$p{$x} = $obj->{$x} if defined $obj->{$x}; |
87
|
|
|
|
|
|
|
} |
88
|
1
|
|
|
|
|
3
|
$xo->startTag("targetList",%p); |
89
|
1
|
|
|
|
|
26
|
foreach my $c (@{$obj->{target}}){ #if we are a targetList we must have target |
|
1
|
|
|
|
|
2
|
|
90
|
|
|
|
|
|
|
#print "Video::CPL::TargetList::xmlo in loop\n".Dumper($xo); |
91
|
1
|
|
|
|
|
5
|
$c->xmlo($xo); |
92
|
|
|
|
|
|
|
} |
93
|
1
|
|
|
|
|
32
|
$xo->endTag("targetList"); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 xml() |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Return the xml format of a TargetList object. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub xml { |
103
|
0
|
|
|
0
|
1
|
0
|
my $obj = shift; |
104
|
0
|
|
|
|
|
0
|
my $a; |
105
|
0
|
|
|
|
|
0
|
my $xo = new XML::Writer(OUTPUT=>\$a); |
106
|
0
|
|
|
|
|
0
|
$obj->xmlo($xo); |
107
|
0
|
|
|
|
|
0
|
$xo->end(); |
108
|
0
|
|
|
|
|
0
|
return $a; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub fromxml { |
112
|
1
|
|
|
1
|
0
|
2
|
my $s = shift; |
113
|
1
|
|
|
|
|
2
|
my %s = %{$s}; |
|
1
|
|
|
|
|
2
|
|
114
|
1
|
|
|
|
|
2
|
my %parms; |
115
|
1
|
|
|
|
|
3
|
foreach my $q (@FIELDS){ |
116
|
4
|
100
|
|
|
|
6
|
next if $q eq "target"; |
117
|
3
|
50
|
|
|
|
7
|
$parms{$q} = $s{$q} if defined($s{$q}); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
#process targets |
120
|
1
|
|
|
|
|
3
|
my @t; |
121
|
1
|
|
|
|
|
1
|
foreach my $x (@{$s{target}}){ |
|
1
|
|
|
|
|
3
|
|
122
|
1
|
|
|
|
|
4
|
push @t,Video::CPL::Target::fromxml($x); |
123
|
|
|
|
|
|
|
} |
124
|
1
|
|
|
|
|
3
|
$parms{target} = \@t; |
125
|
1
|
|
|
|
|
6
|
return new Video::CPL::TargetList(%parms); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 AUTHOR |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Carl Rosenberg, C<< >> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 BUGS |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Please report any bugs or feature requests to Coincident TV. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 SUPPORT |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Copyright 2010 Coincident TV, Inc. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |