2014-09-13 10:38:54 -04:00
|
|
|
/**
|
|
|
|
* @file
|
2013-10-27 17:25:26 -04:00
|
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
|
|
*/
|
2014-06-21 09:37:47 -04:00
|
|
|
#ifndef OCARINA_CORE_LIBRARY_H
|
|
|
|
#define OCARINA_CORE_LIBRARY_H
|
2013-10-27 17:25:26 -04:00
|
|
|
|
2014-06-05 10:19:22 -04:00
|
|
|
#include <core/queue.h>
|
2013-10-27 17:25:26 -04:00
|
|
|
#include <string>
|
|
|
|
|
2014-09-13 10:38:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Namespace for library access.
|
|
|
|
*/
|
2013-10-27 17:25:26 -04:00
|
|
|
namespace library
|
|
|
|
{
|
|
|
|
|
2014-09-13 10:38:54 -04:00
|
|
|
/**
|
|
|
|
* Initialize the library queue with all the tracks in the tagdb.
|
|
|
|
*/
|
2013-11-03 16:03:01 -05:00
|
|
|
void init();
|
2014-05-24 12:47:33 -04:00
|
|
|
|
2014-09-13 10:38:54 -04:00
|
|
|
/**
|
|
|
|
* Add a new directory to the library.
|
|
|
|
*
|
|
|
|
* @param dir The directory that should be scanned.
|
|
|
|
* @return The newly created library object.
|
|
|
|
*/
|
2014-05-24 12:47:33 -04:00
|
|
|
Library *add(const std::string &);
|
2014-09-13 10:38:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a library from the database.
|
|
|
|
*
|
|
|
|
* @param library The library path that should be removed.
|
|
|
|
*/
|
2014-05-24 12:47:33 -04:00
|
|
|
void remove(Library *);
|
2014-09-13 10:38:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Update a specific library path.
|
|
|
|
*
|
|
|
|
* @param library The library path that should be updated.
|
|
|
|
*/
|
2014-05-24 12:47:33 -04:00
|
|
|
void update(Library *);
|
2014-09-13 10:38:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Rescan and update all library paths.
|
|
|
|
*/
|
2014-01-01 13:34:25 -05:00
|
|
|
void update_all();
|
2014-05-24 12:47:33 -04:00
|
|
|
|
2014-09-13 10:38:54 -04:00
|
|
|
/**
|
|
|
|
* Use to enable or disable a library path.
|
|
|
|
*
|
|
|
|
* @param library The library to be enabled or disabled.
|
|
|
|
* @param enabled Set to true if the library should be enabled,
|
|
|
|
* and false to disable it.
|
|
|
|
*/
|
2014-05-24 12:47:33 -04:00
|
|
|
void set_enabled(Library *, bool);
|
2014-09-13 10:38:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use to access the library queue.
|
|
|
|
*
|
|
|
|
* @return The queue of tracks currently in the library.
|
|
|
|
*/
|
2014-05-24 12:47:33 -04:00
|
|
|
Queue *get_queue();
|
|
|
|
|
2013-10-27 17:25:26 -04:00
|
|
|
};
|
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_CORE_LIBRARY_H */
|