line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finnigan::MethodFile; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
74
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings FATAL => qw( all ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
92
|
|
5
|
|
|
|
|
|
|
our $VERSION = 0.0206; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
11
|
use Finnigan; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
39
|
|
8
|
2
|
|
|
2
|
|
10
|
use base 'Finnigan::Decoder'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
848
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub decode { |
12
|
1
|
|
|
1
|
1
|
437
|
my ($class, $stream, $version) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
8
|
my @fields = ( |
15
|
|
|
|
|
|
|
"header" => ['object', 'Finnigan::FileHeader'], |
16
|
|
|
|
|
|
|
"file size" => ['V', 'UInt32'], |
17
|
|
|
|
|
|
|
"orig file name" => ['varstr', 'PascalStringWin32'], |
18
|
|
|
|
|
|
|
"n" => ['V', 'UInt32'], |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
6
|
my $self = Finnigan::Decoder->read($stream, \@fields, $version); |
22
|
1
|
|
|
|
|
4
|
bless $self, $class; |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
4
|
if ( $self->n ) { # this is a hack, because I don't have an iterate_hash() method |
25
|
|
|
|
|
|
|
# the tags come in pairs, so retreive them later with a method |
26
|
1
|
|
|
|
|
4
|
$self->iterate_scalar($stream, 2*$self->n, "name trans" => ['varstr', 'PascalStringWin32']); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
10
|
$self->SUPER::decode($stream, ["container" => ['object', 'Finnigan::OLE2File']]); |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
10
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub n { |
35
|
4
|
|
|
4
|
1
|
31
|
shift->{data}->{n}->{value}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub file_size { |
39
|
1
|
|
|
1
|
1
|
8
|
shift->{data}->{"file size"}->{value}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub container { |
43
|
11
|
|
|
11
|
1
|
82
|
shift->{data}->{"container"}->{value}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub header { |
47
|
0
|
|
|
0
|
1
|
0
|
shift->{data}->{"header"}->{value}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub translation_table { |
51
|
4
|
|
|
4
|
1
|
28
|
shift->{data}->{"name trans"}->{value}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub instrument_name { |
55
|
2
|
|
|
2
|
1
|
5
|
my ($self, $i) = @_; |
56
|
2
|
|
|
|
|
6
|
my $n = $self->n; |
57
|
2
|
50
|
|
|
|
8
|
die "instrument index cannot be 0" if $i == 0; |
58
|
2
|
50
|
|
|
|
6
|
die "instrument index cannot be greater than $n" if $i > $n; |
59
|
2
|
|
|
|
|
3
|
$i--; |
60
|
2
|
|
|
|
|
6
|
return @{$self->translation_table}[2*$i .. 2*$i + 1]; |
|
2
|
|
|
|
|
6
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |