line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::CPL::Story; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
12
|
|
5
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
53
|
|
6
|
1
|
|
|
1
|
|
4
|
use XML::Writer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
543
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Video::CPL::Story - Video::CPL::Story object. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Version 0.09 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
19
|
|
|
|
|
|
|
our @FIELDS = qw(alpha balloonText forever picLoc picOverLoc); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This is mostly an internal package for CPL.pm. You can use it directly, but it is recommended to use the cue point creation routines in CPL.pm. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use Video::CPL::Story; |
26
|
|
|
|
|
|
|
my $foo = Video::CPL::Story->new(); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 METHODS/METHODS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 new(balloonText=>$string,forever=>"false",picLoc=$url,picOverLoc=>$url) |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Create a new Video::CPL::Story object. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new { |
39
|
3
|
|
|
3
|
1
|
12
|
my $pkg = shift; |
40
|
3
|
|
|
|
|
19
|
my %p = @_; |
41
|
3
|
|
|
|
|
6
|
my $ret = {}; |
42
|
3
|
|
|
|
|
4
|
bless $ret,$pkg; |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
5
|
foreach my $x (@FIELDS){ |
45
|
15
|
100
|
|
|
|
30
|
$ret->{$x} = $p{$x} if defined $p{$x}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
8
|
foreach my $x (keys %p){ |
49
|
9
|
50
|
33
|
|
|
31
|
confess("Parameter ('$x') value ($p{$x}) given to Video::CPL::Story::new, but not understood\n") if defined($p{$x}) && !defined($ret->{$x}); |
50
|
|
|
|
|
|
|
} |
51
|
3
|
|
|
|
|
13
|
return $ret; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 xmlo |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Given an XML::Writer object, add the xml information for this Layout. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub xmlo { |
61
|
1
|
|
|
1
|
1
|
6
|
my $obj = shift; |
62
|
1
|
|
|
|
|
1
|
my $xo = shift; |
63
|
1
|
|
|
|
|
1
|
my %p; |
64
|
1
|
|
|
|
|
3
|
foreach my $x (@FIELDS){ |
65
|
5
|
100
|
|
|
|
13
|
$p{$x} = $obj->{$x} if defined $obj->{$x}; |
66
|
|
|
|
|
|
|
} |
67
|
1
|
|
|
|
|
4
|
$xo->emptyTag("story",%p); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 xml() |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Return the xml format of a Video::CPL::Story object. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub xml { |
77
|
0
|
|
|
0
|
1
|
0
|
my $obj = shift; |
78
|
0
|
|
|
|
|
0
|
my $a; |
79
|
0
|
|
|
|
|
0
|
my $xo = new XML::Writer(OUTPUT=>\$a); |
80
|
0
|
|
|
|
|
0
|
$obj->xmlo($xo); |
81
|
0
|
|
|
|
|
0
|
$xo->end(); |
82
|
0
|
|
|
|
|
0
|
return $a; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 fromxml(\%hash) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Return a Video::CPL::Story object given that part of the parse tree from XML::Simple::XMLin. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub fromxml { |
92
|
1
|
|
|
1
|
1
|
1
|
my $s = shift; |
93
|
1
|
|
|
|
|
2
|
my %s = %{$s}; |
|
1
|
|
|
|
|
4
|
|
94
|
1
|
|
|
|
|
2
|
my %p; |
95
|
1
|
|
|
|
|
2
|
foreach my $q (@FIELDS){ |
96
|
5
|
100
|
|
|
|
12
|
$p{$q} = $s{$q} if defined $s{$q}; |
97
|
|
|
|
|
|
|
} |
98
|
1
|
|
|
|
|
3
|
foreach my $q (keys %s){ |
99
|
4
|
50
|
|
|
|
9
|
confess "Video::CPL::Story::fromxml confused by key ($q)\n" if !defined($p{$q}); |
100
|
|
|
|
|
|
|
} |
101
|
1
|
|
|
|
|
10
|
return new Video::CPL::Story(%p); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 alpha([$string]) |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Accessor function to set or return C. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
|
110
|
0
|
0
|
|
0
|
1
|
0
|
sub alpha { my $obj = shift; $obj->{alpha} = shift if @_; return $obj->{alpha}; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 balloonText([$string]) |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Accessor function to set or return C. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
2
|
50
|
|
2
|
1
|
3
|
sub balloonText { my $obj = shift; $obj->{balloonText} = shift if @_; return $obj->{balloonText}; } |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 forever([$string]) |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Accessor function to set or return the boolean B. Values are in text, "true" or "false". |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |
125
|
|
|
|
|
|
|
|
126
|
2
|
50
|
|
2
|
1
|
3
|
sub forever { my $obj = shift; $obj->{forever} = shift if @_; return $obj->{forever}; } |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 picLoc([$url]) |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Accessor function to set or return the B. This should be a local or remote URL, e.g. |
131
|
|
|
|
|
|
|
C or C |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
2
|
50
|
|
2
|
1
|
3
|
sub picLoc { my $obj = shift; $obj->{picLoc} = shift if @_; return $obj->{picLoc}; } |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 picOverLoc([$url]) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Accessor function to set or return the B, the image to be displayed when the mouse is over the image.. This should be a local or remote URL, e.g. |
140
|
|
|
|
|
|
|
C or C |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |
143
|
|
|
|
|
|
|
|
144
|
2
|
50
|
|
2
|
1
|
2
|
sub picOverLoc { my $obj = shift; $obj->{picOverLoc} = shift if @_; return $obj->{picOverLoc}; } |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7
|
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 AUTHOR |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Carl Rosenberg, C<< >> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 BUGS |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Please report any bugs or feature requests to Coincident TV. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 SUPPORT |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
perldoc Video::CPL::Story |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Copyright 2010 Coincident TV |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
165
|
|
|
|
|
|
|
you may not use this file except in compliance with the License. |
166
|
|
|
|
|
|
|
You may obtain a copy of the License at |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software |
171
|
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
172
|
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
173
|
|
|
|
|
|
|
See the License for the specific language governing permissions and |
174
|
|
|
|
|
|
|
limitations under the License. |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=cut |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
1; # End of Video::CPL::Story |