Back to index

eyed3  0.6.18
Public Member Functions | Public Attributes | Static Public Attributes
tag.GenreMap Class Reference

List of all members.

Public Member Functions

def __getitem__
def __init__

Public Attributes

 data
 reverseDict

Static Public Attributes

int GENRE_MIN = 0
 GENRE_MAX = None;
int ID3_GENRE_MIN = 0
int ID3_GENRE_MAX = 79
int WINAMP_GENRE_MIN = 80
int WINAMP_GENRE_MAX = 147
int ITUNES_GENRE_MAX = 125
 EYED3_GENRE_MIN = None;
 EYED3_GENRE_MAX = None;

Detailed Description

Definition at line 1739 of file tag.py.


Constructor & Destructor Documentation

def tag.GenreMap.__init__ (   self)

Definition at line 1770 of file tag.py.

01770 
01771    def __init__(self):
01772       self.data = []
01773       self.reverseDict = {}
01774       # ID3 genres as defined by the v1.1 spec with WinAmp extensions.
01775       self.append('Blues');
01776       self.append('Classic Rock');
01777       self.append('Country');
01778       self.append('Dance');
01779       self.append('Disco');
01780       self.append('Funk');
01781       self.append('Grunge');
01782       self.append('Hip-Hop');
01783       self.append('Jazz');
01784       self.append('Metal');
01785       self.append('New Age');
01786       self.append('Oldies');
01787       self.append('Other');
01788       self.append('Pop');
01789       self.append('R&B');
01790       self.append('Rap');
01791       self.append('Reggae');
01792       self.append('Rock');
01793       self.append('Techno');
01794       self.append('Industrial');
01795       self.append('Alternative');
01796       self.append('Ska');
01797       self.append('Death Metal');
01798       self.append('Pranks');
01799       self.append('Soundtrack');
01800       self.append('Euro-Techno');
01801       self.append('Ambient');
01802       self.append('Trip-Hop');
01803       self.append('Vocal');
01804       self.append('Jazz+Funk');
01805       self.append('Fusion');
01806       self.append('Trance');
01807       self.append('Classical');
01808       self.append('Instrumental');
01809       self.append('Acid');
01810       self.append('House');
01811       self.append('Game');
01812       self.append('Sound Clip');
01813       self.append('Gospel');
01814       self.append('Noise');
01815       self.append('AlternRock');
01816       self.append('Bass');
01817       self.append('Soul');
01818       self.append('Punk');
01819       self.append('Space');
01820       self.append('Meditative');
01821       self.append('Instrumental Pop');
01822       self.append('Instrumental Rock');
01823       self.append('Ethnic');
01824       self.append('Gothic');
01825       self.append('Darkwave');
01826       self.append('Techno-Industrial');
01827       self.append('Electronic');
01828       self.append('Pop-Folk');
01829       self.append('Eurodance');
01830       self.append('Dream');
01831       self.append('Southern Rock');
01832       self.append('Comedy');
01833       self.append('Cult');
01834       self.append('Gangsta Rap');
01835       self.append('Top 40');
01836       self.append('Christian Rap');
01837       self.append('Pop / Funk');
01838       self.append('Jungle');
01839       self.append('Native American');
01840       self.append('Cabaret');
01841       self.append('New Wave');
01842       self.append('Psychedelic');
01843       self.append('Rave');
01844       self.append('Showtunes');
01845       self.append('Trailer');
01846       self.append('Lo-Fi');
01847       self.append('Tribal');
01848       self.append('Acid Punk');
01849       self.append('Acid Jazz');
01850       self.append('Polka');
01851       self.append('Retro');
01852       self.append('Musical');
01853       self.append('Rock & Roll');
01854       self.append('Hard Rock');
01855       self.append('Folk');
01856       self.append('Folk-Rock');
01857       self.append('National Folk');
01858       self.append('Swing');
01859       self.append('Fast  Fusion');
01860       self.append('Bebob');
01861       self.append('Latin');
01862       self.append('Revival');
01863       self.append('Celtic');
01864       self.append('Bluegrass');
01865       self.append('Avantgarde');
01866       self.append('Gothic Rock');
01867       self.append('Progressive Rock');
01868       self.append('Psychedelic Rock');
01869       self.append('Symphonic Rock');
01870       self.append('Slow Rock');
01871       self.append('Big Band');
01872       self.append('Chorus');
01873       self.append('Easy Listening');
01874       self.append('Acoustic');
01875       self.append('Humour');
01876       self.append('Speech');
01877       self.append('Chanson');
01878       self.append('Opera');
01879       self.append('Chamber Music');
01880       self.append('Sonata');
01881       self.append('Symphony');
01882       self.append('Booty Bass');
01883       self.append('Primus');
01884       self.append('Porn Groove');
01885       self.append('Satire');
01886       self.append('Slow Jam');
01887       self.append('Club');
01888       self.append('Tango');
01889       self.append('Samba');
01890       self.append('Folklore');
01891       self.append('Ballad');
01892       self.append('Power Ballad');
01893       self.append('Rhythmic Soul');
01894       self.append('Freestyle');
01895       self.append('Duet');
01896       self.append('Punk Rock');
01897       self.append('Drum Solo');
01898       self.append('A Cappella');
01899       self.append('Euro-House');
01900       self.append('Dance Hall');
01901       self.append('Goa');
01902       self.append('Drum & Bass');
01903       self.append('Club-House');
01904       self.append('Hardcore');
01905       self.append('Terror');
01906       self.append('Indie');
01907       self.append('BritPop');
01908       self.append('Negerpunk');
01909       self.append('Polsk Punk');
01910       self.append('Beat');
01911       self.append('Christian Gangsta Rap');
01912       self.append('Heavy Metal');
01913       self.append('Black Metal');
01914       self.append('Crossover');
01915       self.append('Contemporary Christian');
01916       self.append('Christian Rock');
01917       self.append('Merengue');
01918       self.append('Salsa');
01919       self.append('Thrash Metal');
01920       self.append('Anime');
01921       self.append('JPop');
01922       self.append('Synthpop');
01923       # The follow genres I've encountered in the wild.
01924       self.append('Rock/Pop');
01925       self.EYED3_GENRE_MIN = len(self) - 1;
01926       # New genres go here
01927 
01928       self.EYED3_GENRE_MAX = len(self) - 1;
01929       self.GENRE_MAX = len(self) - 1;
01930 
01931       # Pad up to 255 with "Unknown"
01932       count = len(self);
01933       while count < 256:
01934          self.append("Unknown");
01935          count += 1;
01936 
01937       for index in range(len(self)):
01938          if self[index]:
            self.reverseDict[string.lower(self[index])] = index

Member Function Documentation

def tag.GenreMap.__getitem__ (   self,
  key 
)

Definition at line 1752 of file tag.py.

01752 
01753    def __getitem__(self, key):
01754       if isinstance(key, int):
01755          if key >= 0 and key < len(self):
01756             v = list.__getitem__(self, key);
01757             if v:
01758                return v;
01759             else:
01760                return None;
01761          else:
01762             raise IndexError("genre index out of range");
01763       elif isinstance(key, str):
01764          if self.reverseDict.has_key(key.lower()):
01765             return self.reverseDict[key.lower()];
01766          else:
01767             raise IndexError(key + " genre not found");
01768       else:
01769          raise TypeError("genre key must be type int or string");


Member Data Documentation

Definition at line 1771 of file tag.py.

tag.GenreMap.EYED3_GENRE_MAX = None; [static]

Definition at line 1749 of file tag.py.

tag.GenreMap.EYED3_GENRE_MIN = None; [static]

Definition at line 1748 of file tag.py.

tag.GenreMap.GENRE_MAX = None; [static]

Definition at line 1742 of file tag.py.

int tag.GenreMap.GENRE_MIN = 0 [static]

Definition at line 1741 of file tag.py.

int tag.GenreMap.ID3_GENRE_MAX = 79 [static]

Definition at line 1744 of file tag.py.

int tag.GenreMap.ID3_GENRE_MIN = 0 [static]

Definition at line 1743 of file tag.py.

int tag.GenreMap.ITUNES_GENRE_MAX = 125 [static]

Definition at line 1747 of file tag.py.

Definition at line 1772 of file tag.py.

int tag.GenreMap.WINAMP_GENRE_MAX = 147 [static]

Definition at line 1746 of file tag.py.

int tag.GenreMap.WINAMP_GENRE_MIN = 80 [static]

Definition at line 1745 of file tag.py.


The documentation for this class was generated from the following file: