2014-11-08 20:53:08 -05:00
|
|
|
/**
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_CORE_TAGS_ALBUM_H
|
|
|
|
#define OCARINA_CORE_TAGS_ALBUM_H
|
|
|
|
|
2015-11-05 15:56:24 -05:00
|
|
|
extern "C" {
|
2015-10-22 09:58:12 -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-08 20:53:08 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 _year field and
|
|
|
|
* then call GenericTag to write anything else.
|
|
|
|
*
|
|
|
|
* ... << year1 << GenericTag::write()
|
|
|
|
* ... << year2 << GenericTag::write()
|
|
|
|
* ... << year3 << GenericTag::write()
|
|
|
|
*/
|
2015-11-11 07:59:21 -05:00
|
|
|
struct album {
|
2015-10-22 09:58:12 -04:00
|
|
|
unsigned int al_year; /* This album's year. */
|
2015-11-11 08:11:54 -05:00
|
|
|
gchar *al_name; /* This album's name. */
|
|
|
|
gchar *al_lower; /* This album's name (lowercased). */
|
2015-11-11 07:59:21 -05:00
|
|
|
struct db_entry al_dbe;
|
2014-11-08 20:53:08 -05:00
|
|
|
};
|
|
|
|
|
2015-11-11 07:59:21 -05:00
|
|
|
#define ALBUM(dbe) ((struct album *)DBE_DATA(dbe))
|
2015-11-04 12:23:00 -05:00
|
|
|
|
2014-11-16 14:47:51 -05:00
|
|
|
|
2015-09-24 11:18:48 -04:00
|
|
|
/* Called to initialize the album database. */
|
|
|
|
void album_db_init();
|
2014-11-16 14:47:51 -05:00
|
|
|
|
2015-09-24 11:18:48 -04:00
|
|
|
/* Called to clean up the album database. */
|
|
|
|
void album_db_deinit();
|
2015-09-24 11:09:59 -04:00
|
|
|
|
2015-09-24 11:13:12 -04:00
|
|
|
/* Called to find an album tag by name and year. */
|
2015-11-11 08:11:54 -05:00
|
|
|
struct album *album_find(const gchar *, unsigned int);
|
2015-09-24 11:13:12 -04:00
|
|
|
|
2015-09-24 11:09:59 -04:00
|
|
|
/* Called to get an album tag with a specific index. */
|
|
|
|
struct album *album_get(const unsigned int);
|
|
|
|
|
2015-10-22 09:58:12 -04:00
|
|
|
/* Called to compare two album tags. */
|
|
|
|
int album_compare(struct album *, struct album *);
|
|
|
|
|
2015-11-03 10:39:06 -05:00
|
|
|
#ifdef CONFIG_TESTING
|
|
|
|
const struct db_ops *test_album_ops();
|
|
|
|
#endif /* CONFIG_TESTING */
|
2014-11-08 20:53:08 -05:00
|
|
|
#endif /* OCARINA_CORE_TAGS_ALBUM_H */
|