line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SDL::CD; |
2
|
2
|
|
|
2
|
|
3111
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
58
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
41
|
|
4
|
2
|
|
|
2
|
|
6
|
use vars qw(@ISA @EXPORT @EXPORT_OK); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
88
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
|
|
|
|
|
|
require DynaLoader; |
7
|
2
|
|
|
2
|
|
7
|
use SDL::Constants ':SDL::CDROM'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
211
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Exporter DynaLoader); |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
8
|
use SDL::Internal::Loader; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
98
|
|
11
|
|
|
|
|
|
|
internal_load_dlls(__PACKAGE__); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
bootstrap SDL::CD; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
7
|
use base 'Exporter'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
339
|
|
16
|
|
|
|
|
|
|
our @EXPORT = @{ $SDL::Constants::EXPORT_TAGS{'SDL::CDROM'} }; |
17
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
18
|
|
|
|
|
|
|
all => \@EXPORT, |
19
|
|
|
|
|
|
|
format => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/default'}, |
20
|
|
|
|
|
|
|
status => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/status'}, |
21
|
|
|
|
|
|
|
track_type => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/track_type'} |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Conversion functions from frames to Minute/Second/Frames and vice versa |
25
|
|
|
|
|
|
|
sub FRAMES_TO_MSF { |
26
|
0
|
|
|
0
|
0
|
|
my $frames = shift; |
27
|
0
|
|
|
|
|
|
my $F = $frames % CD_FPS; |
28
|
0
|
|
|
|
|
|
$frames /= CD_FPS; |
29
|
0
|
|
|
|
|
|
my $S = $frames % 60; |
30
|
0
|
|
|
|
|
|
$frames /= 60; |
31
|
0
|
|
|
|
|
|
my $M = $frames; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return ( $M, $S, $F ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub MSF_TO_FRAMES { |
37
|
0
|
|
|
0
|
0
|
|
my $M = shift; |
38
|
0
|
|
|
|
|
|
my $S = shift; |
39
|
0
|
|
|
|
|
|
my $F = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return ( $M * 60 * CD_FPS + $S * CD_FPS + $F ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |