line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Audio::DSS; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26861
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
700
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1
|
|
|
1
|
0
|
12
|
my ($class, $file) = @_; |
11
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
12
|
1
|
|
|
|
|
8
|
$self->{file} = $file; |
13
|
1
|
50
|
|
|
|
4
|
if ($file) { |
14
|
1
|
|
|
|
|
5
|
$self->getDSSMetaData(); |
15
|
|
|
|
|
|
|
} |
16
|
1
|
|
|
|
|
6
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub getDSSMetaData { |
20
|
1
|
|
|
1
|
0
|
1
|
my $self = shift; |
21
|
1
|
|
|
|
|
2
|
my $d; |
22
|
|
|
|
|
|
|
my $buf; |
23
|
1
|
50
|
|
|
|
67
|
open IN, $self->{'file'} or die "Can't open $self->{file} because $!\n"; |
24
|
1
|
|
|
|
|
47
|
read IN, $buf, 1256; |
25
|
1
|
|
|
|
|
5
|
$self->{id} = substr($buf, 1,3); |
26
|
1
|
|
|
|
|
7
|
$self->{create_date} = fixDSSDate(substr($buf, 38, 12)); |
27
|
1
|
|
|
|
|
7
|
$self->{complete_date} = fixDSSDate(substr($buf, 50, 12)); |
28
|
1
|
|
|
|
|
4
|
$self->{length} = substr($buf, 62, 6); |
29
|
1
|
|
|
|
|
2
|
$self->{priority} = undef; |
30
|
1
|
|
|
|
|
4
|
$self->{comments} = substr($buf, 0x31e,100); |
31
|
1
|
|
|
|
|
4
|
$self->{comments} =~ s/\x00//g; |
32
|
1
|
|
|
|
|
17
|
close IN; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub fixDSSDate { |
36
|
2
|
|
|
2
|
0
|
6
|
my $raw = shift; |
37
|
|
|
|
|
|
|
# accept "040815193651" and return "2004-08-15 19:36:51" |
38
|
2
|
|
|
|
|
13
|
return "20" . substr($raw,0,2) . '-' . substr($raw,2,2) . '-' . substr($raw,4,2) . ' ' . substr($raw,6,2) . ':' . substr($raw,8,2) . ':' . substr($raw,10,2); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |