| 1 |
/* |
| 2 |
* Copyright (C) 2005-2021 Team Kodi (https://kodi.tv) |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
* See LICENSE.md for more information. |
| 6 |
*/ |
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include <map> |
| 11 |
#include <string> |
| 12 |
|
| 13 |
typedef struct genre { |
| 14 |
int type; |
| 15 |
int subtype; |
| 16 |
} genre_t; |
| 17 |
|
| 18 |
typedef std::map<std::string, genre_t> GenreMap; |
| 19 |
|
| 20 |
class CGenreTable |
| 21 |
{ |
| 22 |
public: |
| 23 |
CGenreTable(const std::string &filename) { LoadGenreXML(filename); }; |
| 24 |
bool LoadGenreXML(const std::string &filename); |
| 25 |
|
| 26 |
/** |
| 27 |
* \brief Convert a genre string into a type/subtype combination using the data in the GenreMap |
| 28 |
* \param strGenre (in) |
| 29 |
* \param genreType (out) |
| 30 |
* \param genreSubType (out) |
| 31 |
*/ |
| 32 |
void GenreToTypes(std::string& strGenre, int& genreType, int& genreSubType); |
| 33 |
private: |
| 34 |
GenreMap m_genremap; |
| 35 |
}; |