Types

Types — Types, Enums and Defines of libglyr

Stability Level

Stable, unless otherwise indicated

Synopsis

#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;

Description

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

Details

DL_callback ()

GLYR_ERROR          (*DL_callback)                      (GlyrMemCache *dl,
                                                         struct _GlyrQuery *s);

Typedef'd version of the callback option used by glyr_opt_download()

dl :

The current item you can investigate. Guaranteed to be not NULL.

s :

The GlyrQuery you initially passed to glyr_get()

Returns :

a GLYR_ERROR

enum GLYR_DATA_TYPE

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.

GLYR_TYPE_UNKNOWN

You shouldn't get this

GLYR_TYPE_LYRICS

Songtext

GLYR_TYPE_ALBUM_REVIEW

Albumreview

GLYR_TYPE_ARTIST_PHOTO

Pictures showing a certain band

GLYR_TYPE_COVERART

coverart

GLYR_TYPE_ARTIST_BIO

Artist bio

GLYR_TYPE_SIMILAR_ARTIST

Similiar artists

GLYR_TYPE_SIMILAR_SONG

Similar songs

GLYR_TYPE_ALBUMLIST

List of albums: each cache containing one name

GLYR_TYPE_TAG

List of (random) tags: each cache containing one name

GLYR_TYPE_TAG_ARTIST

Tag associated with the artist

GLYR_TYPE_TAG_ALBUM

Tag associated with the album

GLYR_TYPE_TAG_TITLE

Tag associated with the album

GLYR_TYPE_RELATION

Random relation: each cache containing one link

GLYR_TYPE_IMG_URL

URL pointing to an image

GLYR_TYPE_TXT_URL

URL pointing to some text content

GLYR_TYPE_TRACK

List of tracknames: each cache containing one name

GLYR_TYPE_GUITARTABS

Guitartabs

GLYR_TYPE_BACKDROPS

Wallpaper-like artist images

GLYR_DEFAULT_ALLOWED_FORMATS

#define GLYR_DEFAULT_ALLOWED_FORMATS "png;jpeg;tiff;jpg;"

GLYR_DEFAULT_CMAXSIZE

#define GLYR_DEFAULT_CMAXSIZE -1

GLYR_DEFAULT_CMINSIZE

#define GLYR_DEFAULT_CMINSIZE 130

GLYR_DEFAULT_DB_AUTOREAD

#define GLYR_DEFAULT_DB_AUTOREAD true

GLYR_DEFAULT_DB_AUTOWRITE

#define GLYR_DEFAULT_DB_AUTOWRITE true

GLYR_DEFAULT_DOWNLOAD

#define GLYR_DEFAULT_DOWNLOAD true

GLYR_DEFAULT_FORCE_UTF8

#define GLYR_DEFAULT_FORCE_UTF8 false

GLYR_DEFAULT_FROM

#define GLYR_DEFAULT_FROM "all"

GLYR_DEFAULT_FROM_ARGUMENT_DELIM

#define GLYR_DEFAULT_FROM_ARGUMENT_DELIM ";"

GLYR_DEFAULT_FUZZYNESS

#define GLYR_DEFAULT_FUZZYNESS 4

GLYR_DEFAULT_LANG

#define GLYR_DEFAULT_LANG "auto"

GLYR_DEFAULT_LANG_AWARE_ONLY

#define GLYR_DEFAULT_LANG_AWARE_ONLY false

GLYR_DEFAULT_MUISCTREE_PATH

#define GLYR_DEFAULT_MUISCTREE_PATH NULL

GLYR_DEFAULT_NORMALIZATION

#define GLYR_DEFAULT_NORMALIZATION GLYR_NORMALIZE_MODERATE

GLYR_DEFAULT_NUMBER

#define GLYR_DEFAULT_NUMBER 1

GLYR_DEFAULT_PARALLEL

#define GLYR_DEFAULT_PARALLEL 0L

GLYR_DEFAULT_PLUGMAX

#define GLYR_DEFAULT_PLUGMAX -1

GLYR_DEFAULT_PROXY

#define GLYR_DEFAULT_PROXY NULL

GLYR_DEFAULT_QSRATIO

#define GLYR_DEFAULT_QSRATIO 0.85

GLYR_DEFAULT_REDIRECTS

#define GLYR_DEFAULT_REDIRECTS 3L

GLYR_DEFAULT_SUPPORTED_LANGS

#define GLYR_DEFAULT_SUPPORTED_LANGS "en;de;fr;es;it;jp;pl;pt;ru;sv;tr;zh"

GLYR_DEFAULT_TIMEOUT

#define GLYR_DEFAULT_TIMEOUT  20L

GLYR_DEFAULT_USERAGENT

#define GLYR_DEFAULT_USERAGENT "libglyr/"GLYR_VERSION_MAJOR"."GLYR_VERSION_MINOR"-"GLYR_VERSION_MICRO" ("GLYR_VERSION_NAME") +https://www.github.com/sahib/glyr"

GLYR_DEFAULT_VERBOSITY

#define GLYR_DEFAULT_VERBOSITY 0

enum GLYR_ERROR

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.

GLYRE_UNKNOWN

Unknown error

GLYRE_OK

everything is fine

GLYRE_BAD_OPTION

you passed a bad option to glyr_opt_*

GLYRE_BAD_VALUE

Invalid value in glyr_opt_*

GLYRE_EMPTY_STRUCT

you passed an empty struct to glyr_opt_

GLYRE_NO_PROVIDER

No valid provider specified in glyr_opt_from()

GLYRE_UNKNOWN_GET

settings->type is not valid

GLYRE_INSUFF_DATA

Insufficient data supplied; (artist/album/title) missing

GLYRE_SKIP

If returned by callback, cache wont be added to results

GLYRE_STOP_POST

Will stop searching, but still add the current item

GLYRE_STOP_PRE

Will stop searching, but won't add the current item

GLYRE_NO_INIT

Library has not been initialized with glyr_init() yet

GLYRE_WAS_STOPPED

Library was stopped by glyr_signal_exit()

enum GLYR_FIELD_REQUIREMENT

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())

GLYR_REQUIRES_ARTIST

This getter needs the artist field

GLYR_REQUIRES_ALBUM

This getter needs the album field

GLYR_REQUIRES_TITLE

This getter needs the title field

GLYR_OPTIONAL_ARTIST

Artist is optional for this getter

GLYR_OPTIONAL_ALBUM

Album is optional for this getter

GLYR_OPTIONAL_TITLE

Title is optional for this getter

enum GLYR_GET_TYPE

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()

GLYR_GET_UNKNOWN

The default value after initializing a query.

GLYR_GET_COVERART

Get Coverart.

GLYR_GET_LYRICS

Get Songtext

GLYR_GET_ARTIST_PHOTOS

Get Live/Promotion/Fanartwork

GLYR_GET_ARTIST_BIO

Get information about this artist

GLYR_GET_SIMILAR_ARTISTS

get similar artists

GLYR_GET_SIMILAR_SONGS

get similar songs

GLYR_GET_ALBUM_REVIEW

get album reviews

GLYR_GET_TRACKLIST

get a tracklist for a specified album

GLYR_GET_TAGS

get tags for a certain item

GLYR_GET_RELATIONS

get relations for a certain item

GLYR_GET_ALBUMLIST

get a list of albums from a certain artist

GLYR_GET_GUITARTABS

get guitar tabs for a specified artist/title

GLYR_GET_BACKDROPS

get large backdrops (backgrounds) from a certain artist.

GLYR_GET_ANY

Delievers everything (like the 'locale' provider), do not use this.

enum GLYR_NORMALIZATION

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

GLYR_NORMALIZE_NONE

Do no normalization to input artist/album/title.

GLYR_NORMALIZE_MODERATE

Do quite some normalization, but don't break stuff.

GLYR_NORMALIZE_AGGRESSIVE

Do everything under MODERATE, but also remove everythin in() [] and <>.

GLYR_NORMALIZE_ARTIST

Normalize artist field, when set.

GLYR_NORMALIZE_ALBUM

Normalize album field, when set.

GLYR_NORMALIZE_TITLE

Normalize title field, when set.

GLYR_NORMALIZE_ALL

Normalize all fields, when set.