line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
package TV::Humax::Foxsat::epg_data; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
TV::Humax::Foxsat::hmt_data - Package representing Humax TV show metadata |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
version 0.06 |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6579
|
use namespace::autoclean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
15
|
1
|
|
|
1
|
|
96
|
use DateTime; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
16
|
1
|
|
|
1
|
|
753
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Moose::Util::TypeConstraints; |
18
|
|
|
|
|
|
|
use TV::Humax::Foxsat; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Trait::Attribute::Derived Unpack => { |
23
|
|
|
|
|
|
|
fields => { 'unpacker' => 'Str' }, |
24
|
|
|
|
|
|
|
processor => sub { |
25
|
|
|
|
|
|
|
my ($self, $value, $fields) = @_; |
26
|
|
|
|
|
|
|
return unpack( $fields->{'unpacker' }, $value) |
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# The raw data that all the fields are extracted from. |
31
|
|
|
|
|
|
|
has 'rawEPGBlock' => ( |
32
|
|
|
|
|
|
|
is => 'rw', |
33
|
|
|
|
|
|
|
isa => 'Str', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# In theory there are usefull fields here, but in practice we don't use them. |
37
|
|
|
|
|
|
|
has 'rawGuideBlock' => ( |
38
|
|
|
|
|
|
|
is => 'rw', |
39
|
|
|
|
|
|
|
isa => 'Str', |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has 'startTime' => ( |
43
|
|
|
|
|
|
|
is => 'rw', |
44
|
|
|
|
|
|
|
isa => 'DateTime', |
45
|
|
|
|
|
|
|
source => 'rawEPGBlock', |
46
|
|
|
|
|
|
|
traits => [ Unpack ], |
47
|
|
|
|
|
|
|
unpacker => '@4 N', |
48
|
|
|
|
|
|
|
postprocessor => sub { return DateTime->from_epoch( epoch => $_, time_zone => 'GMT' ) }, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has 'duration' => ( |
52
|
|
|
|
|
|
|
is => 'rw', |
53
|
|
|
|
|
|
|
isa => 'Int', |
54
|
|
|
|
|
|
|
source => 'rawEPGBlock', |
55
|
|
|
|
|
|
|
traits => [ Unpack ], |
56
|
|
|
|
|
|
|
unpacker => '@10 n', |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has 'progName' => ( |
60
|
|
|
|
|
|
|
is => 'rw', |
61
|
|
|
|
|
|
|
isa => 'Str', |
62
|
|
|
|
|
|
|
source => 'rawEPGBlock', |
63
|
|
|
|
|
|
|
traits => [ Unpack ], |
64
|
|
|
|
|
|
|
unpacker => '@21 A52', |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
has 'guideInfo' => ( |
68
|
|
|
|
|
|
|
is => 'rw', |
69
|
|
|
|
|
|
|
isa => 'Str', |
70
|
|
|
|
|
|
|
source => 'rawEPGBlock', |
71
|
|
|
|
|
|
|
traits => [ Unpack ], |
72
|
|
|
|
|
|
|
unpacker => '@277 A255', |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
has 'guideFlag' => ( |
76
|
|
|
|
|
|
|
is => 'rw', |
77
|
|
|
|
|
|
|
isa => 'Bool', |
78
|
|
|
|
|
|
|
source => 'rawEPGBlock', |
79
|
|
|
|
|
|
|
traits => [ Unpack ], |
80
|
|
|
|
|
|
|
unpacker => '@534 c', |
81
|
|
|
|
|
|
|
postprocessor => sub { return !!( $_ & 0x01 ) }, |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
has 'guideBlockLen' => ( |
85
|
|
|
|
|
|
|
is => 'rw', |
86
|
|
|
|
|
|
|
isa => 'Int', |
87
|
|
|
|
|
|
|
); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# All done |
90
|
|
|
|
|
|
|
1; |