|
myMPD
Internal API documentation
|
Webradio functions. More...
#include "compile_time.h"#include "src/lib/webradio.h"#include "dist/mpack/mpack.h"#include "src/lib/filehandler.h"#include "src/lib/log.h"#include "src/lib/mem.h"#include "src/lib/mpack.h"#include "src/lib/sds_extras.h"#include "src/lib/utility.h"#include <pthread.h>
Functions | |
| struct t_webradio_data * | webradio_by_uri (struct t_webradios *webradio_favorites, struct t_webradios *webradiodb, const char *uri) |
| sds | webradio_get_extm3u (struct t_webradios *webradio_favorites, struct t_webradios *webradiodb, sds buffer, sds uri) |
| struct t_webradio_data * | webradio_data_new (enum webradio_type type) |
| void | webradio_data_free (struct t_webradio_data *data) |
| sds | webradio_get_cover_uri (struct t_webradio_data *webradio, sds buffer) |
| void | webradio_tags_search (struct t_webradio_tags *tags) |
| enum webradio_tag_type | webradio_tag_name_parse (const char *name) |
| const char * | webradio_type_name (enum webradio_type type) |
| const char * | webradio_get_tag (const struct t_webradio_data *webradio, enum webradio_tag_type tag_type, unsigned int idx) |
| sds | webradio_to_extm3u (const struct t_webradio_data *webradio, sds buffer, const char *uri) |
| struct t_webradios * | webradios_new (void) |
| void | webradios_clear (struct t_webradios *webradios, bool init_rax) |
| void | webradios_free (struct t_webradios *webradios) |
| void | webradios_free_void (void *webradios) |
| bool | webradios_get_read_lock (struct t_webradios *webradios) |
| bool | webradios_get_write_lock (struct t_webradios *webradios) |
| bool | webradios_release_lock (struct t_webradios *webradios) |
| bool | webradios_save_to_disk (struct t_config *config, struct t_webradios *webradios, const char *filename) |
| bool | webradios_read_from_disk (struct t_config *config, struct t_webradios *webradios, const char *filename, enum webradio_type type) |
Variables | |
| static const char * | webradio_tag_types_names [WEBRADIO_TAG_COUNT] |
Webradio functions.
| struct t_webradio_data * webradio_by_uri | ( | struct t_webradios * | webradio_favorites, |
| struct t_webradios * | webradiodb, | ||
| const char * | uri | ||
| ) |
Search webradio by uri in favorites and WebradioDB
| webradio_favorites | Pointer to webradio favorites |
| webradiodb | Pointer to WebradioDB |
| uri | Uri to search for |
| void webradio_data_free | ( | struct t_webradio_data * | data | ) |
Frees a webradios data struct
| data | struct to free |
| struct t_webradio_data * webradio_data_new | ( | enum webradio_type | type | ) |
Creates a new webradio data struct
| type | Webradio type |
| sds webradio_get_cover_uri | ( | struct t_webradio_data * | webradio, |
| sds | buffer | ||
| ) |
Returns the uri for the webradio image
| webradio | Webradio struct |
| buffer | buffer to append the uri |
| sds webradio_get_extm3u | ( | struct t_webradios * | webradio_favorites, |
| struct t_webradios * | webradiodb, | ||
| sds | buffer, | ||
| sds | uri | ||
| ) |
Returns an extm3u for a webradio
| webradio_favorites | Pointer to webradio favorites |
| webradiodb | Pointer to WebradioDB |
| buffer | Buffer to append the uri |
| uri | Webradio uri |
| const char * webradio_get_tag | ( | const struct t_webradio_data * | webradio, |
| enum webradio_tag_type | tag_type, | ||
| unsigned int | idx | ||
| ) |
Returns the value of a webradio tag
| webradio | Webdadio |
| tag_type | Webradio tag |
| idx | Index of tag |
| enum webradio_tag_type webradio_tag_name_parse | ( | const char * | name | ) |
Parses a string to a webradio tag type
| name | string to parse |
| void webradio_tags_search | ( | struct t_webradio_tags * | tags | ) |
Sets the webradio tags for search
| tags | Struct to set |
| sds webradio_to_extm3u | ( | const struct t_webradio_data * | webradio, |
| sds | buffer, | ||
| const char * | uri | ||
| ) |
Returns an extm3u for a webradio
| webradio | Pointer to webradio struct |
| buffer | Already allocated buffer to append the extm3u |
| uri | Optional uri. If NULL use the first uri from the webradio entry. |
| const char * webradio_type_name | ( | enum webradio_type | type | ) |
Returns the webradio type as string literal
| type | webradio type |
| void webradios_clear | ( | struct t_webradios * | webradios, |
| bool | init_rax | ||
| ) |
Clears the webradios struct
| webradios | struct to free |
| init_rax | re-init the rax trees? |
| void webradios_free | ( | struct t_webradios * | webradios | ) |
Frees the webradios struct
| webradios | struct to free |
| void webradios_free_void | ( | void * | webradios | ) |
Frees the webradios struct
| webradios | struct to free |
| bool webradios_get_read_lock | ( | struct t_webradios * | webradios | ) |
Acquires a read lock
| webradios | pointer to webradios struct |
| bool webradios_get_write_lock | ( | struct t_webradios * | webradios | ) |
Acquires a write lock
| webradios | pointer to webradios struct |
| struct t_webradios * webradios_new | ( | void | ) |
Initializes the webradios struct
| bool webradios_read_from_disk | ( | struct t_config * | config, |
| struct t_webradios * | webradios, | ||
| const char * | filename, | ||
| enum webradio_type | type | ||
| ) |
Reads the webradios file from disk
| config | pointer to config |
| webradios | webradios struct to populate |
| filename | file to read |
| type | Webradio type |
| bool webradios_release_lock | ( | struct t_webradios * | webradios | ) |
Frees the lock
| webradios | pointer to webradios struct |
| bool webradios_save_to_disk | ( | struct t_config * | config, |
| struct t_webradios * | webradios, | ||
| const char * | filename | ||
| ) |
Saves the webradios to disk
| config | pointer to config |
| webradios | webradios struct to write |
| filename | file to write |
|
static |
Mapping for webradio tags to strings