• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdemultimedia API Reference
  • KDE Home
  • Contact Us
 

libkcddb

  • sources
  • kde-4.14
  • kdemultimedia
  • libkcddb
  • libkcddb
categories.cpp
Go to the documentation of this file.
1 // Copyright (C) 2005 by Shaheed Haque (srhaque@iee.org). All rights reserved.
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 
9 #include "categories.h"
10 
11 #include <klocale.h>
12 
13 KCDDB::Categories::Categories()
14 {
15  // These are only 11 Category values defined by CDDB. See
16  //
17  // http://www.freedb.org/modules.php?name=Sections&sop=viewarticle&artid=26
18  //
19  m_cddb << QLatin1String( "blues" ) << QLatin1String( "classical" ) << QLatin1String( "country" ) <<
20  QLatin1String( "data" ) << QLatin1String( "folk" ) << QLatin1String( "jazz" ) << QLatin1String( "misc" ) <<
21  QLatin1String( "newage" ) << QLatin1String( "reggae" ) << QLatin1String( "rock" ) << QLatin1String( "soundtrack" );
22  m_i18n << i18n("Blues") << i18n("Classical") << i18nc("music genre", "Country") <<
23  i18n("Data") << i18n("Folk") << i18n("Jazz") << i18n("Miscellaneous") <<
24  i18n("New Age") << i18n("Reggae") << i18n("Rock") << i18n("Soundtrack");
25 }
26 
27 const QString KCDDB::Categories::cddb2i18n(const QString &category) const
28 {
29  int index = m_cddb.indexOf(category.trimmed());
30  if (index != -1)
31  {
32  return m_i18n[index];
33  }
34  else
35  {
36  return cddb2i18n(QLatin1String( "misc" ));
37  }
38 }
39 
40 const QString KCDDB::Categories::i18n2cddb(const QString &category) const
41 {
42  int index = m_i18n.indexOf(category.trimmed());
43  if (index != -1)
44  {
45  return m_cddb[index];
46  }
47  else
48  {
49  return QLatin1String( "misc" );
50  }
51 }
QString::indexOf
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
categories.h
KCDDB::Categories::cddb2i18n
const QString cddb2i18n(const QString &category) const
Lookup the CDDB category, and return the i18n'd version.
Definition: categories.cpp:27
KCDDB::Categories::i18n2cddb
const QString i18n2cddb(const QString &category) const
Lookup the i18n category, and return the CDDB version.
Definition: categories.cpp:40
KCDDB::Categories::Categories
Categories()
Definition: categories.cpp:13
QString::trimmed
QString trimmed() const
QString
QLatin1String
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkcddb

Skip menu "libkcddb"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdemultimedia API Reference

Skip menu "kdemultimedia API Reference"
  • libkcddb
  • libkcompactdisc

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal