2016-05-09 15:57:26 +02:00
|
|
|
#ifndef ANALYSIS_H
|
|
|
|
#define ANALYSIS_H
|
|
|
|
|
|
|
|
#include <sqlite3.h>
|
|
|
|
|
|
|
|
/**
|
2016-05-10 19:32:45 +02:00
|
|
|
* Initialize the SQLite3 database used to store songs data and distances.
|
|
|
|
*
|
|
|
|
* @param[out] data_folder Folder in which the data will be
|
|
|
|
* stored.
|
|
|
|
* @param[out] db_path Full path to the database.
|
|
|
|
*
|
|
|
|
* @return 0 on success. Non-zero otherwise.
|
2016-05-09 15:57:26 +02:00
|
|
|
*/
|
|
|
|
int _init_db(char* data_folder, char* db_path);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2016-05-10 19:32:45 +02:00
|
|
|
* Analyze a song and store result in database.
|
|
|
|
*
|
|
|
|
* @param[in] dbh SQLite3 database handler.
|
|
|
|
* @param[in] base_path Base path of your music library.
|
|
|
|
* @param[in] song_uri Relative path of the song to
|
|
|
|
* analyze, from the base_path.
|
|
|
|
*
|
|
|
|
* @return 0 on success. Non-zero otherwise.
|
2016-05-09 15:57:26 +02:00
|
|
|
*/
|
|
|
|
int _parse_music_helper(
|
|
|
|
sqlite3* dbh,
|
|
|
|
const char *base_path,
|
|
|
|
const char *song_uri);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rescan errored files
|
|
|
|
*
|
2016-05-10 19:32:45 +02:00
|
|
|
* @param[in] db_path Path to the db file to use.
|
|
|
|
* @param[in] base_path Root directory of the MPD library.
|
|
|
|
*
|
2016-05-09 15:57:26 +02:00
|
|
|
* @return 0 on success. Non-zero otherwise.
|
|
|
|
*/
|
|
|
|
int _rescan_errored(const char *db_path, const char *base_path);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2016-05-10 19:32:45 +02:00
|
|
|
* Purge everything from the database.
|
|
|
|
*
|
|
|
|
* @param[in] db_path Path to the db file to use.
|
|
|
|
*
|
|
|
|
* @return 0 on success. Non-zero otherwise.
|
2016-05-09 15:57:26 +02:00
|
|
|
*/
|
|
|
|
int _purge_db(const char* db_path);
|
|
|
|
|
|
|
|
#endif // ANALYSIS_H
|