2019-10-21 03:11:54 +02:00
|
|
|
#ifndef SONIC_H
|
|
|
|
#define SONIC_H
|
2019-10-21 04:28:57 +02:00
|
|
|
/**
|
|
|
|
* \file sonic.h
|
2019-10-23 22:36:08 +02:00
|
|
|
* \brief Sonic related function
|
2019-10-21 04:28:57 +02:00
|
|
|
*/
|
2019-10-21 03:11:54 +02:00
|
|
|
|
2021-09-01 22:29:13 +02:00
|
|
|
typedef struct {
|
|
|
|
/**
|
|
|
|
* \brief Sonic id field
|
|
|
|
* \details This is used to store the followings:
|
|
|
|
* - Arist ID
|
|
|
|
* - Album ID
|
|
|
|
* - Song ID
|
|
|
|
* - Sub-directory ID (in the XML response, this is the ID on the "child"
|
|
|
|
* element)
|
|
|
|
*/
|
|
|
|
char *id;
|
|
|
|
/**
|
|
|
|
* \brief Sonic directory depth
|
|
|
|
* \details This is used exclusively in ID3 mode to store the depth of the
|
|
|
|
* current directory.
|
|
|
|
*/
|
|
|
|
int depth;
|
|
|
|
} Sonic;
|
|
|
|
|
2019-10-21 04:28:57 +02:00
|
|
|
#include "link.h"
|
|
|
|
|
|
|
|
/**
|
2019-10-23 22:36:08 +02:00
|
|
|
* \brief Initialise Sonic configuration.
|
2019-10-21 04:28:57 +02:00
|
|
|
*/
|
|
|
|
void sonic_config_init(const char *server, const char *username,
|
|
|
|
const char *password);
|
2019-10-23 22:36:08 +02:00
|
|
|
|
|
|
|
/**
|
2019-10-27 12:08:23 +01:00
|
|
|
* \brief Create a new Sonic LinkTable in index mode
|
2019-10-23 22:36:08 +02:00
|
|
|
*/
|
2019-10-28 02:09:55 +01:00
|
|
|
LinkTable *sonic_LinkTable_new_index(const char *id);
|
2019-10-25 19:52:53 +02:00
|
|
|
|
|
|
|
/**
|
2019-10-27 12:08:23 +01:00
|
|
|
* \brief Create a new Sonic LinkTable in ID3 mode
|
2019-10-27 22:21:30 +01:00
|
|
|
* \details In this mode, the filesystem effectively has 5 levels of which are:
|
|
|
|
* 0. Root table
|
|
|
|
* 1. Index table
|
|
|
|
* 2. Artist table
|
|
|
|
* 3. Album table
|
|
|
|
* 4. Song table
|
2019-10-28 13:50:33 +01:00
|
|
|
* 5. Individual song (not a table)
|
2019-10-27 22:21:30 +01:00
|
|
|
* \param[in] depth the level of the requested table
|
|
|
|
* \param[in] id the id of the requested table
|
2019-10-25 19:52:53 +02:00
|
|
|
*/
|
2019-10-28 02:09:55 +01:00
|
|
|
LinkTable *sonic_LinkTable_new_id3(int depth, const char *id);
|
2019-10-25 19:52:53 +02:00
|
|
|
|
2019-10-21 03:11:54 +02:00
|
|
|
#endif
|