| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- ;;; -*- Mode: Lisp; show-trailing-whitespace: t; Base: 10; indent-tabs: nil; Syntax: ANSI-Common-Lisp; Package: TAG; -*-
- ;;; Copyright (c) 2013, Mark VandenBrink. All rights reserved.
- (in-package #:tag)
- ;;;
- ;;; From Practical Common Lisp be Peter Seibel
- ;;;
- (defparameter *id3-v1-genres*
- #(
- ;; These are the official ID3v1 genres.
- "Blues" "Classic Rock" "Country" "Dance" "Disco" "Funk" "Grunge"
- "Hip-Hop" "Jazz" "Metal" "New Age" "Oldies" "Other" "Pop" "R&B" "Rap"
- "Reggae" "Rock" "Techno" "Industrial" "Alternative" "Ska"
- "Death Metal" "Pranks" "Soundtrack" "Euro-Techno" "Ambient"
- "Trip-Hop" "Vocal" "Jazz+Funk" "Fusion" "Trance" "Classical"
- "Instrumental" "Acid" "House" "Game" "Sound Clip" "Gospel" "Noise"
- "AlternRock" "Bass" "Soul" "Punk" "Space" "Meditative"
- "Instrumental Pop" "Instrumental Rock" "Ethnic" "Gothic" "Darkwave"
- "Techno-Industrial" "Electronic" "Pop-Folk" "Eurodance" "Dream"
- "Southern Rock" "Comedy" "Cult" "Gangsta" "Top 40" "Christian Rap"
- "Pop/Funk" "Jungle" "Native American" "Cabaret" "New Wave"
- "Psychadelic" "Rave" "Showtunes" "Trailer" "Lo-Fi" "Tribal"
- "Acid Punk" "Acid Jazz" "Polka" "Retro" "Musical" "Rock & Roll"
- "Hard Rock"
- ;; These were made up by the authors of Winamp but backported into
- ;; the ID3 spec.
- "Folk" "Folk-Rock" "National Folk" "Swing" "Fast Fusion"
- "Bebob" "Latin" "Revival" "Celtic" "Bluegrass" "Avantgarde"
- "Gothic Rock" "Progressive Rock" "Psychedelic Rock" "Symphonic Rock"
- "Slow Rock" "Big Band" "Chorus" "Easy Listening" "Acoustic" "Humour"
- "Speech" "Chanson" "Opera" "Chamber Music" "Sonata" "Symphony"
- "Booty Bass" "Primus" "Porn Groove" "Satire" "Slow Jam" "Club"
- "Tango" "Samba" "Folklore" "Ballad" "Power Ballad" "Rhythmic Soul"
- "Freestyle" "Duet" "Punk Rock" "Drum Solo" "A capella" "Euro-House"
- "Dance Hall"
- ;; These were also invented by the Winamp folks but ignored by the
- ;; ID3 authors.
- "Goa" "Drum & Bass" "Club-House" "Hardcore" "Terror" "Indie"
- "BritPop" "Negerpunk" "Polsk Punk" "Beat" "Christian Gangsta Rap"
- "Heavy Metal" "Black Metal" "Crossover" "Contemporary Christian"
- "Christian Rock" "Merengue" "Salsa" "Thrash Metal" "Anime" "Jpop"
- "Synthpop"))
- (defmacro safe-aref (arry index)
- `(handler-case (aref ,arry ,index)
- (condition (c)
- (declare (ignore c))
- "N/A")))
- (defmethod get-genre-text ((genre string))
- (safe-aref *id3-v1-genres* (parse-integer genre :start 1 :junk-allowed t)))
- (defmethod get-genre-text ((genre integer))
- (safe-aref *id3-v1-genres* (- genre 1)))
|