| libglyr Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <glyr/types.h> GLYR_ERROR (*DL_callback) (GlyrMemCache *dl,struct _GlyrQuery *s); enum GLYR_DATA_TYPE; #define GLYR_DEFAULT_ALLOWED_FORMATS #define GLYR_DEFAULT_CMAXSIZE #define GLYR_DEFAULT_CMINSIZE #define GLYR_DEFAULT_DB_AUTOREAD #define GLYR_DEFAULT_DB_AUTOWRITE #define GLYR_DEFAULT_DOWNLOAD #define GLYR_DEFAULT_FORCE_UTF8 #define GLYR_DEFAULT_FROM #define GLYR_DEFAULT_FROM_ARGUMENT_DELIM #define GLYR_DEFAULT_FUZZYNESS #define GLYR_DEFAULT_LANG #define GLYR_DEFAULT_LANG_AWARE_ONLY #define GLYR_DEFAULT_MUISCTREE_PATH #define GLYR_DEFAULT_NORMALIZATION #define GLYR_DEFAULT_NUMBER #define GLYR_DEFAULT_PARALLEL #define GLYR_DEFAULT_PLUGMAX #define GLYR_DEFAULT_PROXY #define GLYR_DEFAULT_QSRATIO #define GLYR_DEFAULT_REDIRECTS #define GLYR_DEFAULT_SUPPORTED_LANGS #define GLYR_DEFAULT_TIMEOUT #define GLYR_DEFAULT_USERAGENT #define GLYR_DEFAULT_VERBOSITY enum GLYR_ERROR; enum GLYR_FIELD_REQUIREMENT; enum GLYR_GET_TYPE; enum GLYR_NORMALIZATION;
All structs / enums / defines of the libglyr API can be found here. You do not need to include this header directly, use glyr/glyr.h
GLYR_ERROR (*DL_callback) (GlyrMemCache *dl,struct _GlyrQuery *s);
Typedef'd version of the callback option used by glyr_opt_download()
|
The current item you can investigate. Guaranteed to be not NULL. |
|
The GlyrQuery you initially passed to glyr_get()
|
Returns : |
a GLYR_ERROR |
typedef enum {
GLYR_TYPE_UNKNOWN,
GLYR_TYPE_LYRICS,
GLYR_TYPE_ALBUM_REVIEW,
GLYR_TYPE_ARTIST_PHOTO,
GLYR_TYPE_COVERART,
GLYR_TYPE_ARTIST_BIO,
GLYR_TYPE_SIMILAR_ARTIST,
GLYR_TYPE_SIMILAR_SONG,
GLYR_TYPE_ALBUMLIST,
GLYR_TYPE_TAG,
GLYR_TYPE_TAG_ARTIST,
GLYR_TYPE_TAG_ALBUM,
GLYR_TYPE_TAG_TITLE,
GLYR_TYPE_RELATION,
GLYR_TYPE_IMG_URL,
GLYR_TYPE_TXT_URL,
GLYR_TYPE_TRACK,
GLYR_TYPE_GUITARTABS,
GLYR_TYPE_BACKDROPS
} GLYR_DATA_TYPE;
Mainly used in the 'type' field of GlyrMemCache. It describes what kind of data the cache holds. As a user of the API you will need this very seldom. libglyr makes internally use of it.
| You shouldn't get this | |
| Songtext | |
| Albumreview | |
| Pictures showing a certain band | |
| coverart | |
| Artist bio | |
| Similiar artists | |
| Similar songs | |
| List of albums: each cache containing one name | |
| List of (random) tags: each cache containing one name | |
| Tag associated with the artist | |
| Tag associated with the album | |
| Tag associated with the album | |
| Random relation: each cache containing one link | |
| URL pointing to an image | |
| URL pointing to some text content | |
| List of tracknames: each cache containing one name | |
| Guitartabs | |
| Wallpaper-like artist images |
#define GLYR_DEFAULT_SUPPORTED_LANGS "en;de;fr;es;it;jp;pl;pt;ru;sv;tr;zh"
#define GLYR_DEFAULT_USERAGENT "libglyr/"GLYR_VERSION_MAJOR"."GLYR_VERSION_MINOR"-"GLYR_VERSION_MICRO" ("GLYR_VERSION_NAME") +https://www.github.com/sahib/glyr"
typedef enum {
GLYRE_UNKNOWN = 0,
GLYRE_OK,
GLYRE_BAD_OPTION,
GLYRE_BAD_VALUE,
GLYRE_EMPTY_STRUCT,
GLYRE_NO_PROVIDER,
GLYRE_UNKNOWN_GET,
GLYRE_INSUFF_DATA,
GLYRE_SKIP,
GLYRE_STOP_POST,
GLYRE_STOP_PRE,
GLYRE_NO_INIT,
GLYRE_WAS_STOPPED
} GLYR_ERROR;
All errors you can get, via glyr_get() and the glyr_opt_* calls.
Use glyr_strerror() to convert them to meaningful strings.
| Unknown error | |
| everything is fine | |
| you passed a bad option to glyr_opt_* | |
| Invalid value in glyr_opt_* | |
| you passed an empty struct to glyr_opt_ | |
No valid provider specified in glyr_opt_from()
|
|
| settings->type is not valid | |
| Insufficient data supplied; (artist/album/title) missing | |
| If returned by callback, cache wont be added to results | |
| Will stop searching, but still add the current item | |
| Will stop searching, but won't add the current item | |
Library has not been initialized with glyr_init() yet
|
|
Library was stopped by glyr_signal_exit()
|
typedef enum {
GLYR_REQUIRES_ARTIST = 1 << 0,
GLYR_REQUIRES_ALBUM = 1 << 1,
GLYR_REQUIRES_TITLE = 1 << 2,
GLYR_OPTIONAL_ARTIST = 1 << 3,
GLYR_OPTIONAL_ALBUM = 1 << 4,
GLYR_OPTIONAL_TITLE = 1 << 5
} GLYR_FIELD_REQUIREMENT;
Bitmasks you can use to determine what fields a certain getter needs.
You can obtain it in the 'reqs' field of GlyrFetcherInfo (retrieved via glyr_info_get())
| This getter needs the artist field | |
| This getter needs the album field | |
| This getter needs the title field | |
| Artist is optional for this getter | |
| Album is optional for this getter | |
| Title is optional for this getter |
typedef enum {
GLYR_GET_UNKNOWN,
GLYR_GET_COVERART,
GLYR_GET_LYRICS,
GLYR_GET_ARTIST_PHOTOS,
GLYR_GET_ARTIST_BIO,
GLYR_GET_SIMILAR_ARTISTS,
GLYR_GET_SIMILAR_SONGS,
GLYR_GET_ALBUM_REVIEW,
GLYR_GET_TRACKLIST,
GLYR_GET_TAGS,
GLYR_GET_RELATIONS,
GLYR_GET_ALBUMLIST,
GLYR_GET_GUITARTABS,
GLYR_GET_BACKDROPS,
GLYR_GET_ANY
} GLYR_GET_TYPE;
You tell libglyr what metadata you want by choosing one of the below
and set it via glyr_opt_type()
| The default value after initializing a query. | |
| Get Coverart. | |
| Get Songtext | |
| Get Live/Promotion/Fanartwork | |
| Get information about this artist | |
| get similar artists | |
| get similar songs | |
| get album reviews | |
| get a tracklist for a specified album | |
| get tags for a certain item | |
| get relations for a certain item | |
| get a list of albums from a certain artist | |
| get guitar tabs for a specified artist/title | |
| get large backdrops (backgrounds) from a certain artist. | |
| Delievers everything (like the 'locale' provider), do not use this. |
typedef enum {
GLYR_NORMALIZE_NONE = 1 << 0,
GLYR_NORMALIZE_MODERATE = 1 << 1,
GLYR_NORMALIZE_AGGRESSIVE = 1 << 2,
GLYR_NORMALIZE_ARTIST = 1 << 3,
GLYR_NORMALIZE_ALBUM = 1 << 4,
GLYR_NORMALIZE_TITLE = 1 << 5,
GLYR_NORMALIZE_ALL = GLYR_NORMALIZE_ARTIST | GLYR_NORMALIZE_ALBUM | GLYR_NORMALIZE_TITLE
} GLYR_NORMALIZATION;
The normalization levels, that may be applied to artist/album/title.
Default is: GLYR_NORMALIZE_AGGRESSIVE | GLYR_NORMALIZE_ALL
| Do no normalization to input artist/album/title. | |
| Do quite some normalization, but don't break stuff. | |
Do everything under MODERATE, but also remove everythin in() [] and <>.
|
|
| Normalize artist field, when set. | |
| Normalize album field, when set. | |
| Normalize title field, when set. | |
| Normalize all fields, when set. |