2014-11-09 10:18:09 -05:00
|
|
|
/**
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_CORE_TAGS_GENRE_H
|
|
|
|
#define OCARINA_CORE_TAGS_GENRE_H
|
|
|
|
|
2015-11-05 15:56:24 -05:00
|
|
|
extern "C" {
|
2015-10-23 09:04:23 -04:00
|
|
|
#include <core/database.h>
|
2015-11-05 15:56:24 -05:00
|
|
|
}
|
2015-11-05 14:19:33 -05:00
|
|
|
#include <string>
|
2014-11-09 10:18:09 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The Genre tag is used to store the name of genres added
|
|
|
|
* to the tag database.
|
|
|
|
*/
|
2015-11-11 11:57:54 -05:00
|
|
|
struct genre {
|
2015-11-11 12:05:02 -05:00
|
|
|
gchar *ge_name; /* This genre's name. */
|
|
|
|
gchar *ge_lower; /* This genre's name (lowercased). */
|
2015-11-11 11:57:54 -05:00
|
|
|
struct db_entry ge_dbe;
|
2014-11-09 10:18:09 -05:00
|
|
|
};
|
|
|
|
|
2015-11-11 11:57:54 -05:00
|
|
|
#define GENRE(dbe) ((struct genre *)DBE_DATA(dbe))
|
2015-11-04 12:23:00 -05:00
|
|
|
|
2014-11-16 15:15:32 -05:00
|
|
|
|
2015-09-28 08:18:39 -04:00
|
|
|
/* Called to initialize the genre database. */
|
|
|
|
void genre_db_init();
|
2014-11-16 15:15:32 -05:00
|
|
|
|
2015-09-28 08:18:39 -04:00
|
|
|
/* Called to clean up the genre database. */
|
|
|
|
void genre_db_deinit();
|
2015-09-28 08:25:15 -04:00
|
|
|
|
2015-09-28 08:22:51 -04:00
|
|
|
/* Called to find a genre tag by name. */
|
2015-11-11 12:05:02 -05:00
|
|
|
struct genre *genre_find(const gchar *);
|
2015-09-28 08:22:51 -04:00
|
|
|
|
2015-09-28 08:25:15 -04:00
|
|
|
/* Called to get a genre tag with a specific index. */
|
|
|
|
struct genre *genre_get(const unsigned int);
|
|
|
|
|
2015-10-23 09:04:23 -04:00
|
|
|
/* Called to compare two genre tags. */
|
|
|
|
int genre_compare(struct genre *, struct genre *);
|
|
|
|
|
2015-11-03 10:39:06 -05:00
|
|
|
#ifdef CONFIG_TESTING
|
|
|
|
const struct db_ops *test_genre_ops();
|
|
|
|
#endif /* CONFIG_TESTING */
|
2014-11-09 10:18:09 -05:00
|
|
|
#endif /* OCARINA_CORE_TAGS_GENRE_H */
|