core/tags/genre: Move genre_get() out of the tags namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-09-28 08:25:15 -04:00
parent 5e59166dab
commit c611eb306d
4 changed files with 8 additions and 12 deletions

View File

@ -26,7 +26,7 @@ struct genre *tags :: get_genre(const std::string &name)
return db_find(&genre_db, name.c_str());
}
struct genre *tags :: get_genre(const unsigned int index)
struct genre *genre_get(const unsigned int index)
{
return db_at(&genre_db, index);
}

View File

@ -123,7 +123,7 @@ void Track :: read(file &file)
_library = tags :: get_library(library_id);
_artist = artist_get(artist_id);
_album = album_get(album_id);
_genre = tags :: get_genre(genre_id);
_genre = genre_get(genre_id);
filter :: add(name(), index());
filter :: add(_artist->ar_name, index());

View File

@ -38,14 +38,10 @@ namespace tags
*/
struct genre *get_genre(const std::string &);
/**
* Called to look up a Genre tag by tag index.
*
* @param index The index of the Genre tag.
* @return A matching Genre tag or NULL.
*/
struct genre *get_genre(const unsigned int);
}
/* Called to get a genre tag with a specific index. */
struct genre *genre_get(const unsigned int);
#endif /* OCARINA_CORE_TAGS_GENRE_H */

View File

@ -72,8 +72,8 @@ static void test_genere_db()
test_verify_vg(genre);
test_equal(tags :: get_genre("Video Game Music"), genre);
test_equal(tags :: get_genre(0), genre);
test_equal(tags :: get_genre(1), (struct genre *)NULL);
test_equal(genre_get(0), genre);
test_equal(genre_get(1), (struct genre *)NULL);
db_init(&genre_db, "genre.db", false);
db_load(&genre_db);