3
* Alphabetical list of genres.
9
* Copyright (C) 2003-2007 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
32
/** Alphabetically sorted list of genres, conversion to/from genre numbers */
36
* Get name assigned to genre number.
38
* @param num genre number
40
* @return name, empty string for unknown number.
42
static const char* getName(int num);
45
* Get the index in the alphabethically sorted list from the genre number.
47
* @param num genre number
49
* @return index, 0 for unknown number.
51
static int getIndex(int num);
54
* Get the genre number from a string containing a genre text.
56
* @param str string with genre
58
* @return genre number, 255 for unknown index.
60
static int getNumber(const QString& str);
63
* Get a name string from a string with a number or a name.
64
* ID3v2 genres can be stored as "9", "(9)", "(9)Metal" or "Metal".
66
* @param str genre string.
68
static QString getNameString(const QString& str);
71
* Get a number representation of a genre name if possible.
73
* @param str string with genre name
74
* @param parentheses true to put the number in parentheses
76
* @return genre string.
78
static QString getNumberString(const QString& str, bool parentheses);
80
/** Number of genres */
81
#if defined _WIN32 || defined WIN32
84
static const int count = 148;
87
* Pointer to alphabetic list of genres.
88
* NULL terminated, to be used in combo box.
90
static const char** s_strList;
94
* Alphabetic list of genres, starts with unknown (empty) entry.
96
* 125: Last ID3v1, 142: WinAmp 1.91, 145: WinAmp 1.92, 255: unknown
98
static const char* s_genre[Genres::count + 3];
100
* s_genreNum[n] gives the number of the n-th genre
101
* in the alphabetically sorted list.
103
static const unsigned char s_genreNum[Genres::count + 1];
106
#endif /* GENRES_H */