2014-11-10 08:27:31 -05:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_CORE_TAGS_LIBRARY_H
|
|
|
|
#define OCARINA_CORE_TAGS_LIBRARY_H
|
|
|
|
|
|
|
|
#include <core/database.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Library tag
|
|
|
|
*/
|
|
|
|
class Library : public DatabaseEntry {
|
2014-11-12 08:31:09 -05:00
|
|
|
private:
|
2014-11-13 08:14:29 -05:00
|
|
|
std::string _path; /**< Path to the root directory of this library. */
|
|
|
|
bool _enabled; /**< Is this library path enabled? */
|
2014-11-12 08:31:09 -05:00
|
|
|
|
2014-11-10 08:27:31 -05:00
|
|
|
public:
|
|
|
|
/** Number of tracks in this library */
|
|
|
|
unsigned int count;
|
|
|
|
|
|
|
|
/** Library constructor */
|
|
|
|
Library();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Library constructor
|
|
|
|
* @param path Path to the library on disk.
|
|
|
|
*/
|
|
|
|
Library(const std::string &);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to access the library tag's primary key.
|
|
|
|
* @return Library::root_path
|
|
|
|
*/
|
|
|
|
const std::string primary_key() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read library information from file.
|
|
|
|
* @param file The file to read from.
|
|
|
|
*/
|
|
|
|
void read(File &);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write library information to file.
|
|
|
|
* @param file The file to write to.
|
|
|
|
*/
|
|
|
|
void write(File &);
|
2014-11-13 08:14:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to check if this library path is currently enabled.
|
|
|
|
*
|
|
|
|
* @return Library::_enabled.
|
|
|
|
*/
|
|
|
|
const bool enabled();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to set if this library path is enabled.
|
|
|
|
*
|
|
|
|
* @param enabled True if this path should be enabled, false otherwise.
|
|
|
|
*/
|
|
|
|
void set_enabled(bool);
|
2014-11-10 08:27:31 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* OCARINA_CORE_TAGS_LIBRARY_H */
|