File Coverage

blib/lib/SDL/CD.pm
Criterion Covered Total %
statement 18 29 62.0
branch n/a
condition n/a
subroutine 6 8 75.0
pod 0 2 0.0
total 24 39 61.5


line stmt bran cond sub pod time code
1             package SDL::CD;
2 2     2   8822 use strict;
  2         5  
  2         76  
3 2     2   11 use warnings;
  2         4  
  2         79  
4 2     2   12 use vars qw(@ISA @EXPORT @EXPORT_OK);
  2         4  
  2         251  
5             require Exporter;
6             require DynaLoader;
7 2     2   20 use SDL::Constants ':SDL::CDROM';
  2         4  
  2         512  
8             our @ISA = qw(Exporter DynaLoader);
9              
10 2     2   12 use SDL::Internal::Loader;
  2         4  
  2         148  
11             internal_load_dlls(__PACKAGE__);
12              
13             bootstrap SDL::CD;
14              
15 2     2   10 use base 'Exporter';
  2         3  
  2         1043  
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;