myMPD
Internal API documentation
Loading...
Searching...
No Matches
sticker.c File Reference

MPD sticker helpers. More...

#include "compile_time.h"
#include "src/lib/sticker.h"
#include <string.h>
Include dependency graph for sticker.c:

Functions

const char * mympd_sticker_type_name_lookup (enum mympd_sticker_type sticker_type)
 
enum mympd_sticker_type mympd_sticker_type_name_parse (const char *name)
 
const char * sticker_name_lookup (enum mympd_sticker_names sticker)
 
enum mympd_sticker_names sticker_name_parse (const char *name)
 
void sticker_struct_init (struct t_sticker *sticker)
 
void sticker_struct_clear (struct t_sticker *sticker)
 
enum mpd_sticker_operator sticker_oper_parse (const char *str)
 
enum mpd_sticker_sort sticker_sort_parse (const char *str)
 

Variables

static const char *const mpd_sticker_types_names [STICKER_TYPE_COUNT]
 
static const char *const mympd_sticker_names [STICKER_COUNT]
 

Detailed Description

MPD sticker helpers.

Function Documentation

◆ mympd_sticker_type_name_lookup()

const char * mympd_sticker_type_name_lookup ( enum mympd_sticker_type  sticker_type)

Returns the sticker name as string

Parameters
sticker_typeenum mpd_sticker_type
Returns
const char* the sticker name

◆ mympd_sticker_type_name_parse()

enum mympd_sticker_type mympd_sticker_type_name_parse ( const char *  name)

Parses the mpd sticker type string

Parameters
namesticker type string
Returns
enum mpd_tag_type the sticker enum

◆ sticker_name_lookup()

const char * sticker_name_lookup ( enum mympd_sticker_names  sticker)

Returns the sticker name as string

Parameters
stickerenum mympd_sticker_types
Returns
const char* the sticker name

◆ sticker_name_parse()

enum mympd_sticker_names sticker_name_parse ( const char *  name)

Parses the sticker name

Parameters
namesticker name
Returns
enum mpd_tag_type the sticker enum

◆ sticker_oper_parse()

enum mpd_sticker_operator sticker_oper_parse ( const char *  str)

Converts a string to a mpd sticker operator

Parameters
strstring to parse
Returns
mpd sticker operator

◆ sticker_sort_parse()

enum mpd_sticker_sort sticker_sort_parse ( const char *  str)

Converts a string to a mpd sticker sort enum

Parameters
strstring to parse
Returns
mpd sticker sort type

◆ sticker_struct_clear()

void sticker_struct_clear ( struct t_sticker sticker)

Clears the sticker struct

Parameters
sticker

◆ sticker_struct_init()

void sticker_struct_init ( struct t_sticker sticker)

Initializes the sticker struct

Parameters
stickerstruct to init

Variable Documentation

◆ mpd_sticker_types_names

const char* const mpd_sticker_types_names[STICKER_TYPE_COUNT]
static
Initial value:
= {
[STICKER_TYPE_SONG] = "song",
[STICKER_TYPE_PLAYLIST] = "playlist",
[STICKER_TYPE_FILTER] = "filter",
[STICKER_TYPE_MYMPD_ALBUM] = "mympd_album",
[STICKER_TYPE_TAG_TITLE] = "Title",
[STICKER_TYPE_TAG_ALBUM] = "Album",
[STICKER_TYPE_TAG_ARTIST] = "Artist",
[STICKER_TYPE_TAG_ALBUM_ARTIST] = "AlbumArtist",
[STICKER_TYPE_TAG_GENRE] = "Genre",
[STICKER_TYPE_TAG_COMPOSER] = "Composer",
[STICKER_TYPE_TAG_PERFORMER] = "Performer",
[STICKER_TYPE_TAG_CONDUCTOR] = "Conductor",
[STICKER_TYPE_TAG_WORK] = "Work",
[STICKER_TYPE_TAG_ENSEMBLE] = "Ensemble",
[STICKER_TYPE_TAG_LOCATION] = "Location",
[STICKER_TYPE_TAG_LABEL] = "Label"
}

MPD sticker types names

◆ mympd_sticker_names

const char* const mympd_sticker_names[STICKER_COUNT]
static
Initial value:
= {
[STICKER_PLAY_COUNT] = "playCount",
[STICKER_SKIP_COUNT] = "skipCount",
[STICKER_LIKE] = "like",
[STICKER_LAST_PLAYED] = "lastPlayed",
[STICKER_LAST_SKIPPED] = "lastSkipped",
[STICKER_ELAPSED] = "elapsed",
[STICKER_RATING] = "rating"
}

myMPD sticker names