summaryrefslogtreecommitdiffstats
path: root/libkcddb/categories.cpp
blob: c334a3324d12fed859702f1963123f3bb22a6b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2005 by Shaheed Haque ([email protected]). All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//

#include <categories.h>
#include <tdelocale.h>

KCDDB::Categories::Categories()
{
    // These are only 11 Category values defined by CDDB. See
    //
    // http://www.freedb.org/modules.php?name=Sections&sop=viewarticle&artid=26
    //
    m_cddb << "blues" << "classical" << "country" <<
            "data" << "folk" << "jazz" << "misc" <<
            "newage" << "reggae" << "rock" << "soundtrack";
    m_i18n << i18n("Blues") << i18n("Classical") << i18n("music genre", "Country") <<
            i18n("Data") << i18n("Folk") << i18n("Jazz") << i18n("Miscellaneous") <<
            i18n("New Age") << i18n("Reggae") << i18n("Rock") << i18n("Soundtrack");
}

const TQString KCDDB::Categories::cddb2i18n(const TQString &category) const
{
    int index = m_cddb.findIndex(category.stripWhiteSpace());
    if (index != -1)
    {
        return m_i18n[index];
    }
    else
    {
        return cddb2i18n("misc");
    }
}

const TQString KCDDB::Categories::i18n2cddb(const TQString &category) const
{
    int index = m_i18n.findIndex(category.stripWhiteSpace());
    if (index != -1)
    {
        return m_cddb[index];
    }
    else
    {
        return "misc";
    }
}