core/tags/track: Move track_db_init() out of the tags namespace
And add the functions track_db_deinit() and tags :: db_deinit(). Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
d0ec3e2cac
commit
d3bdcf2edc
|
@ -14,5 +14,14 @@ void tags :: init()
|
||||||
artist_db_init();
|
artist_db_init();
|
||||||
genre_db_init();
|
genre_db_init();
|
||||||
library_db_init();
|
library_db_init();
|
||||||
tags :: init_track_db();
|
track_db_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void tags :: deinit()
|
||||||
|
{
|
||||||
|
track_db_deinit();
|
||||||
|
library_db_deinit();
|
||||||
|
genre_db_deinit();
|
||||||
|
artist_db_deinit();
|
||||||
|
album_db_deinit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,12 +146,17 @@ void track :: write(file &file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void tags :: init_track_db()
|
void track_db_init()
|
||||||
{
|
{
|
||||||
db_init(&track_db, "track.db", false);
|
db_init(&track_db, "track.db", false);
|
||||||
db_load(&track_db);
|
db_load(&track_db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void track_db_deinit()
|
||||||
|
{
|
||||||
|
db_deinit(&track_db);
|
||||||
|
}
|
||||||
|
|
||||||
struct track *track_add(struct album *album, struct artist *artist,
|
struct track *track_add(struct album *album, struct artist *artist,
|
||||||
struct genre *genre, struct library *library,
|
struct genre *genre, struct library *library,
|
||||||
const std::string &filepath, const std::string &name,
|
const std::string &filepath, const std::string &name,
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace tags
|
||||||
|
|
||||||
/** Called to read all databases from disk. */
|
/** Called to read all databases from disk. */
|
||||||
void init();
|
void init();
|
||||||
|
void deinit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,9 +117,6 @@ struct track : public GenericTag {
|
||||||
|
|
||||||
namespace tags
|
namespace tags
|
||||||
{
|
{
|
||||||
/** Called to read the track_db from disk. */
|
|
||||||
void init_track_db();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to find the number of rows in the track_db,
|
* Called to find the number of rows in the track_db,
|
||||||
* including NULL rows.
|
* including NULL rows.
|
||||||
|
@ -133,6 +130,12 @@ namespace tags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Called to initialize the track database. */
|
||||||
|
void track_db_init();
|
||||||
|
|
||||||
|
/* Called to clean up the track database. */
|
||||||
|
void track_db_deinit();
|
||||||
|
|
||||||
/* Called to add a track tag to the database. */
|
/* Called to add a track tag to the database. */
|
||||||
struct track *track_add(struct album *, struct artist *, struct genre *,
|
struct track *track_add(struct album *, struct artist *, struct genre *,
|
||||||
struct library *, const std::string &,
|
struct library *, const std::string &,
|
||||||
|
|
Loading…
Reference in New Issue