10fd3292fd
I don't build up a complete set of databases yet, but I do create the Artist name database to use later. Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
64 lines
1.0 KiB
C++
64 lines
1.0 KiB
C++
/*
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_LIBRARY_H
|
|
#define OCARINA_LIBRARY_H
|
|
|
|
#include <database.h>
|
|
#include <string>
|
|
|
|
namespace library
|
|
{
|
|
|
|
enum DB_Type {
|
|
DB_ALBUM,
|
|
DB_ARTIST,
|
|
DB_GENRE,
|
|
DB_LIBRARY,
|
|
DB_TRACK,
|
|
};
|
|
|
|
|
|
class Artist : public DatabaseEntry {
|
|
public:
|
|
std:: string name;
|
|
|
|
Artist();
|
|
Artist(const std :: string &);
|
|
void read(File &);
|
|
void write(File &);
|
|
#ifdef CONFIG_DEBUG
|
|
void print();
|
|
#endif /* CONFIG_DEBUG */
|
|
bool operator==(const Artist &);
|
|
};
|
|
|
|
|
|
class Library : public DatabaseEntry {
|
|
public:
|
|
std::string root_path;
|
|
bool enabled;
|
|
|
|
Library();
|
|
Library(const std::string &, bool);
|
|
void read(File &);
|
|
void write(File &);
|
|
#ifdef CONFIG_DEBUG
|
|
void print();
|
|
#endif /* CONFIG_DEBUG */
|
|
bool operator==(Library &);
|
|
};
|
|
|
|
|
|
void init();
|
|
bool add_path(const std::string &);
|
|
void del_path(unsigned int);
|
|
void update_path(unsigned int);
|
|
#ifdef CONFIG_DEBUG
|
|
void print_db(DB_Type);
|
|
void reset();
|
|
#endif /* CONFIG_DEBUG */
|
|
};
|
|
|
|
#endif /* OCARINA_LIBRARY_H */
|