File Coverage

blib/lib/Mplayer/NowPlaying/Genres.pm
Criterion Covered Total %
statement 15 20 75.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 5 6 83.3
pod 1 1 100.0
total 21 32 65.6


line stmt bran cond sub pod time code
1             package Mplayer::NowPlaying::Genres;
2 1     1   6 use strict;
  1         2  
  1         42  
3              
4             BEGIN {
5 1     1   6 use Exporter;
  1         1  
  1         53  
6 1     1   5 use vars qw(@ISA @EXPORT $VERSION);
  1         2  
  1         91  
7 1     1   2 $VERSION = '0.010';
8 1         15 @ISA = 'Exporter';
9 1         22 @EXPORT = qw(get_genre);
10             }
11              
12 1     1   6 use Carp qw(croak);
  1         2  
  1         522  
13              
14             sub get_genre {
15 0     0 1   my $genre = shift;
16 0 0 0       if( ($genre < 0) or ($genre > 255) ) {
17 0           croak("An integer between 0 and 255, inclusive, is required\n");
18             }
19              
20             # Stolen from the mplayer source
21 0           my %genres = (
22             0 => "Blues",
23             1 => "Classic Rock",
24             10 => "New Age",
25             100 => "Humour",
26             101 => "Speech",
27             102 => "Chanson",
28             103 => "Opera",
29             104 => "Chamber Music",
30             105 => "Sonata",
31             106 => "Symphony",
32             107 => "Booty Bass",
33             108 => "Primus",
34             109 => "Porn Groove",
35             11 => "Oldies",
36             110 => "Satire",
37             111 => "Slow Jam",
38             112 => "Club",
39             113 => "Tango",
40             114 => "Samba",
41             115 => "Folklore",
42             116 => "Ballad",
43             117 => "Power Ballad",
44             118 => "Rhytmic Soul",
45             119 => "Freestyle",
46             12 => "Other",
47             120 => "Duet",
48             121 => "Punk Rock",
49             122 => "Drum Solo",
50             123 => "Acapella",
51             124 => "Euro-House",
52             125 => "Dance Hall",
53             126 => "Goa",
54             127 => "Drum & Bass",
55             128 => "Club-House",
56             129 => "Hardcore",
57             13 => "Pop",
58             130 => "Terror",
59             131 => "Indie",
60             132 => "BritPop",
61             133 => "Negerpunk",
62             134 => "Polsk Punk",
63             135 => "Beat",
64             136 => "Christian Gangsta Rap",
65             137 => "Heavy Metal",
66             138 => "Black Metal",
67             139 => "Crossover",
68             14 => "R&B",
69             140 => "Contemporary Christian",
70             141 => "Christian Rock",
71             142 => "Merengue",
72             143 => "Salsa",
73             144 => "Thrash Metal",
74             145 => "Anime",
75             146 => "Jpop",
76             147 => "Synthpop",
77             15 => "Rap",
78             16 => "Reggae",
79             17 => "Rock",
80             18 => "Techno",
81             19 => "Industrial",
82             2 => "Country",
83             20 => "Alternative",
84             21 => "Ska",
85             22 => "Death Metal",
86             23 => "Pranks",
87             24 => "Soundtrack",
88             25 => "Eurotechno",
89             255 => "Unknown",
90             26 => "Ambient",
91             27 => "Trip-Hop",
92             28 => "Vocal",
93             29 => "Jazz+Funk",
94             3 => "Dance",
95             30 => "Fusion",
96             31 => "Trance",
97             32 => "Classical",
98             33 => "Instrumental",
99             34 => "Acid",
100             35 => "House",
101             36 => "Game",
102             37 => "Sound Clip",
103             38 => "Gospel",
104             39 => "Noise",
105             4 => "Disco",
106             40 => "Alternative Rock",
107             41 => "Bass",
108             42 => "Soul",
109             43 => "Punk",
110             44 => "Space",
111             45 => "Meditative",
112             46 => "Instrumental Pop",
113             47 => "Instrumental Rock",
114             48 => "Ethnic",
115             49 => "Gothic",
116             5 => "Funk",
117             50 => "Darkwave",
118             51 => "Techno-Industrial",
119             52 => "Electronic",
120             53 => "Pop-Folk",
121             54 => "Eurodance",
122             55 => "Dream",
123             56 => "Southern Rock",
124             57 => "Comedy",
125             58 => "Cult",
126             59 => "Gangsta",
127             6 => "Grunge",
128             60 => "Top 40",
129             61 => "Christian Rap",
130             62 => "Pop/Funk",
131             63 => "Jungle",
132             64 => "Native American",
133             65 => "Cabaret",
134             66 => "New Wave",
135             67 => "Psychadelic",
136             68 => "Rave",
137             69 => "Show Tunes",
138             7 => "Hip-Hop",
139             70 => "Trailer",
140             71 => "Lo-Fi",
141             72 => "Tribal",
142             73 => "Acid Punk",
143             74 => "Acid Jazz",
144             75 => "Polka",
145             76 => "Retro",
146             77 => "Musical",
147             78 => "Rock & Roll",
148             79 => "Hard Rock",
149             8 => "Jazz",
150             80 => "Folk",
151             81 => "Folk/Rock",
152             82 => "National Folk",
153             83 => "Swing",
154             84 => "Fast-Fusion",
155             85 => "Bebop",
156             86 => "Latin",
157             87 => "Revival",
158             88 => "Celtic",
159             89 => "Bluegrass",
160             9 => "Metal",
161             90 => "Avantgarde",
162             91 => "Gothic Rock",
163             92 => "Progressive Rock",
164             93 => "Psychedelic Rock",
165             94 => "Symphonic Rock",
166             95 => "Slow Rock",
167             96 => "Big Band",
168             97 => "Chorus",
169             98 => "Easy Listening",
170             99 => "Acoustic"
171             );
172              
173 0           return $genres{$genre};
174             }
175              
176              
177              
178             1;
179              
180              
181             __END__