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   4939 use strict;
  2         4  
  2         46  
3 2     2   8 use warnings;
  2         2  
  2         53  
4 2     2   12 use vars qw(@ISA @EXPORT @EXPORT_OK);
  2         6  
  2         146  
5             require Exporter;
6             require DynaLoader;
7 2     2   15 use SDL::Constants ':SDL::CDROM';
  2         4  
  2         266  
8             our @ISA = qw(Exporter DynaLoader);
9              
10 2     2   13 use SDL::Internal::Loader;
  2         3  
  2         124  
11             internal_load_dlls(__PACKAGE__);
12              
13             our $VERSION = 2.548;
14              
15             bootstrap SDL::CD;
16              
17 2     2   9 use base 'Exporter';
  2         3  
  2         487  
18             our @EXPORT = @{ $SDL::Constants::EXPORT_TAGS{'SDL::CDROM'} };
19             our %EXPORT_TAGS = (
20             all => \@EXPORT,
21             format => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/default'},
22             status => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/status'},
23             track_type => $SDL::Constants::EXPORT_TAGS{'SDL::CDROM/track_type'}
24             );
25              
26             # Conversion functions from frames to Minute/Second/Frames and vice versa
27             sub FRAMES_TO_MSF {
28 0     0 0   my $frames = shift;
29 0           my $F = $frames % CD_FPS;
30 0           $frames /= CD_FPS;
31 0           my $S = $frames % 60;
32 0           $frames /= 60;
33 0           my $M = $frames;
34              
35 0           return ( $M, $S, $F );
36             }
37              
38             sub MSF_TO_FRAMES {
39 0     0 0   my $M = shift;
40 0           my $S = shift;
41 0           my $F = shift;
42              
43 0           return ( $M * 60 * CD_FPS + $S * CD_FPS + $F );
44             }
45              
46             1;