66 lines
1.9 KiB
C
66 lines
1.9 KiB
C
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*
|
|
* The album tag is used to store the name and year of albums
|
|
* added to the tag database.
|
|
*
|
|
* When writing an album tag to disk, write out the album_year field
|
|
* followed by the album_name on the same line:
|
|
*
|
|
* ... 1998 Hyrule Symphony
|
|
* ... 2006 Twilight Princess
|
|
* ... 2011 Skyward Sword
|
|
*/
|
|
#ifndef OCARINA_CORE_TAGS_ALBUM_H
|
|
#define OCARINA_CORE_TAGS_ALBUM_H
|
|
|
|
#include <core/database.h>
|
|
#include <core/tags/artist.h>
|
|
|
|
struct album {
|
|
unsigned int al_year; /* This album's year. */
|
|
gchar *al_name; /* This album's name. */
|
|
gchar **al_tokens; /* This album's tokenized strings. */
|
|
gchar **al_alts; /* This album's alternate ascii tokens. */
|
|
struct artist *al_artist;
|
|
struct db_entry al_dbe;
|
|
};
|
|
|
|
#define ALBUM(dbe) ((struct album *)DBE_DATA(dbe))
|
|
|
|
|
|
/* Called to initialize the album database. */
|
|
void album_db_init();
|
|
|
|
/* Called to clean up the album database. */
|
|
void album_db_deinit();
|
|
|
|
/* Called to find an album tag by name and year. */
|
|
struct album *album_find(const gchar *, unsigned int);
|
|
|
|
/* Called to get an album tag with a specific index. */
|
|
struct album *album_get(const unsigned int);
|
|
|
|
/* Called to compare two album tags by name. */
|
|
int album_compare(struct album *, struct album *);
|
|
|
|
/* Called to compare two album tags by year. */
|
|
int album_compare_year(struct album *, struct album *);
|
|
|
|
/* Called to check if album artwork has been downloaded. */
|
|
bool album_artwork_exists(struct album *);
|
|
|
|
/*
|
|
* Called to find the path to an album's artwork.
|
|
* This function returns a new string that MUST be freed with g_free().
|
|
*/
|
|
gchar *album_artwork_path(struct album *);
|
|
|
|
/* Called to manually set artwork for a given album. */
|
|
bool album_artwork_import(struct album *, gchar *);
|
|
|
|
#ifdef CONFIG_TESTING
|
|
const struct db_ops *test_album_ops();
|
|
#endif /* CONFIG_TESTING */
|
|
#endif /* OCARINA_CORE_TAGS_ALBUM_H */
|