diff options
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 6 | ||||
-rw-r--r-- | src/cue/cue_tag.c | 94 | ||||
-rw-r--r-- | src/decoder/_flac_common.c | 6 | ||||
-rw-r--r-- | src/decoder/ffmpeg_plugin.c | 31 | ||||
-rw-r--r-- | src/decoder/flac_plugin.c | 7 | ||||
-rw-r--r-- | src/decoder/mikmod_plugin.c | 2 | ||||
-rw-r--r-- | src/decoder/modplug_plugin.c | 2 | ||||
-rw-r--r-- | src/decoder/mp4ff_plugin.c | 16 | ||||
-rw-r--r-- | src/decoder/sidplay_plugin.cxx | 8 | ||||
-rw-r--r-- | src/decoder/sndfile_decoder_plugin.c | 6 | ||||
-rwxr-xr-x | src/decoder/vorbis_plugin.c | 6 | ||||
-rw-r--r-- | src/decoder/wavpack_plugin.c | 22 | ||||
-rw-r--r-- | src/icy_metadata.c | 2 | ||||
-rw-r--r-- | src/input/curl_input_plugin.c | 6 | ||||
-rw-r--r-- | src/input/lastfm_input_plugin.c | 6 | ||||
-rw-r--r-- | src/output/httpd_output_plugin.c | 5 | ||||
-rw-r--r-- | src/output/shout_plugin.c | 4 | ||||
-rw-r--r-- | src/songvec.c | 4 | ||||
-rw-r--r-- | src/stats.c | 4 | ||||
-rw-r--r-- | src/tag.c | 26 | ||||
-rw-r--r-- | src/tag.h | 24 | ||||
-rw-r--r-- | src/tag_ape.c | 14 | ||||
-rw-r--r-- | src/tag_id3.c | 26 |
23 files changed, 161 insertions, 166 deletions
diff --git a/src/command.c b/src/command.c index 3866d039c..cbc77edc1 100644 --- a/src/command.c +++ b/src/command.c @@ -1236,17 +1236,17 @@ handle_list(struct client *client, int argc, char *argv[]) /* for compatibility with < 0.12.0 */ if (argc == 3) { - if (tagType != TAG_ITEM_ALBUM) { + if (tagType != TAG_ALBUM) { command_error(client, ACK_ERROR_ARG, "should be \"%s\" for 3 arguments", - tag_item_names[TAG_ITEM_ALBUM]); + tag_item_names[TAG_ALBUM]); return COMMAND_RETURN_ERROR; } locate_item_list_parse(argv + 1, argc - 1); conditionals = locate_item_list_new(1); - conditionals->items[0].tag = TAG_ITEM_ARTIST; + conditionals->items[0].tag = TAG_ARTIST; conditionals->items[0].needle = g_strdup(argv[2]); } else { conditionals = diff --git a/src/cue/cue_tag.c b/src/cue/cue_tag.c index ce8202a81..e45b26a7e 100644 --- a/src/cue/cue_tag.c +++ b/src/cue/cue_tag.c @@ -13,64 +13,64 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem) tag_begin_add(tag); - { /* TAG_ITEM_ALBUM_ARTIST */ + { /* TAG_ALBUM_ARTIST */ if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp); + tag_add_item(tag, TAG_ALBUM_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp); + tag_add_item(tag, TAG_ALBUM_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp); + tag_add_item(tag, TAG_ALBUM_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp); - /* TAG_ITEM_ALBUM_ARTIST */ } + tag_add_item(tag, TAG_ALBUM_ARTIST, tmp); + /* TAG_ALBUM_ARTIST */ } - { /* TAG_ITEM_ARTIST */ + { /* TAG_ARTIST */ if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); - /* TAG_ITEM_ARTIST */ } + tag_add_item(tag, TAG_ARTIST, tmp); + /* TAG_ARTIST */ } - /* TAG_ITEM_PERFORMER */ + /* TAG_PERFORMER */ if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_PERFORMER, tmp); + tag_add_item(tag, TAG_PERFORMER, tmp); - /* TAG_ITEM_COMPOSER */ + /* TAG_COMPOSER */ if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_COMPOSER, tmp); + tag_add_item(tag, TAG_COMPOSER, tmp); - /* TAG_ITEM_ALBUM */ + /* TAG_ALBUM */ if ((tmp = cdtext_get(PTI_TITLE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ALBUM, tmp); + tag_add_item(tag, TAG_ALBUM, tmp); - /* TAG_ITEM_GENRE */ + /* TAG_GENRE */ if ((tmp = cdtext_get(PTI_GENRE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_GENRE, tmp); + tag_add_item(tag, TAG_GENRE, tmp); - /* TAG_ITEM_DATE */ + /* TAG_DATE */ if ((tmp = rem_get(REM_DATE, rem)) != NULL) - tag_add_item(tag, TAG_ITEM_DATE, tmp); + tag_add_item(tag, TAG_DATE, tmp); - /* TAG_ITEM_COMMENT */ + /* TAG_COMMENT */ if ((tmp = cdtext_get(PTI_MESSAGE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_COMMENT, tmp); + tag_add_item(tag, TAG_COMMENT, tmp); - /* TAG_ITEM_DISC */ + /* TAG_DISC */ if ((tmp = cdtext_get(PTI_DISC_ID, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_DISC, tmp); + tag_add_item(tag, TAG_DISC, tmp); /* stream name, usually empty - * tag_add_item(tag, TAG_ITEM_NAME,); + * tag_add_item(tag, TAG_NAME,); */ /* REM MUSICBRAINZ entry? @@ -109,47 +109,47 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem) tag_begin_add(tag); - { /* TAG_ITEM_ARTIST */ + { /* TAG_ARTIST */ if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); + tag_add_item(tag, TAG_ARTIST, tmp); else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, tmp); - /* TAG_ITEM_ARTIST */ } + tag_add_item(tag, TAG_ARTIST, tmp); + /* TAG_ARTIST */ } - /* TAG_ITEM_TITLE */ + /* TAG_TITLE */ if ((tmp = cdtext_get(PTI_TITLE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_TITLE, tmp); + tag_add_item(tag, TAG_TITLE, tmp); - /* TAG_ITEM_GENRE */ + /* TAG_GENRE */ if ((tmp = cdtext_get(PTI_GENRE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_GENRE, tmp); + tag_add_item(tag, TAG_GENRE, tmp); - /* TAG_ITEM_DATE */ + /* TAG_DATE */ if ((tmp = rem_get(REM_DATE, rem)) != NULL) - tag_add_item(tag, TAG_ITEM_DATE, tmp); + tag_add_item(tag, TAG_DATE, tmp); - /* TAG_ITEM_COMPOSER */ + /* TAG_COMPOSER */ if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_COMPOSER, tmp); + tag_add_item(tag, TAG_COMPOSER, tmp); - /* TAG_ITEM_PERFORMER */ + /* TAG_PERFORMER */ if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_PERFORMER, tmp); + tag_add_item(tag, TAG_PERFORMER, tmp); - /* TAG_ITEM_COMMENT */ + /* TAG_COMMENT */ if ((tmp = cdtext_get(PTI_MESSAGE, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_COMMENT, tmp); + tag_add_item(tag, TAG_COMMENT, tmp); - /* TAG_ITEM_DISC */ + /* TAG_DISC */ if ((tmp = cdtext_get(PTI_DISC_ID, cdtext)) != NULL) - tag_add_item(tag, TAG_ITEM_DISC, tmp); + tag_add_item(tag, TAG_DISC, tmp); tag_end_add(tag); diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c index 09f7269bd..d8802a6a3 100644 --- a/src/decoder/_flac_common.c +++ b/src/decoder/_flac_common.c @@ -170,11 +170,11 @@ flac_parse_comment(struct tag *tag, const char *char_tnum, assert(tag != NULL); if (flac_copy_comment(tag, entry, VORBIS_COMMENT_TRACK_KEY, - TAG_ITEM_TRACK, char_tnum) || + TAG_TRACK, char_tnum) || flac_copy_comment(tag, entry, VORBIS_COMMENT_DISC_KEY, - TAG_ITEM_DISC, char_tnum) || + TAG_DISC, char_tnum) || flac_copy_comment(tag, entry, "album artist", - TAG_ITEM_ALBUM_ARTIST, char_tnum)) + TAG_ALBUM_ARTIST, char_tnum)) return; for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i) diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index 6bead85fd..be9de3bf2 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -363,37 +363,36 @@ static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx) #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) av_metadata_conv(f, NULL, f->iformat->metadata_conv); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title"); - if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author")) - ffmpeg_copy_metadata(tag, f->metadata, - TAG_ITEM_ARTIST, "artist"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TRACK, "track"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_DATE, "year"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_TITLE, "title"); + if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ARTIST, "author")) + ffmpeg_copy_metadata(tag, f->metadata, TAG_ARTIST, "artist"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_ALBUM, "album"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_COMMENT, "comment"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_GENRE, "genre"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_TRACK, "track"); + ffmpeg_copy_metadata(tag, f->metadata, TAG_DATE, "year"); #else if (f->author[0]) - tag_add_item(tag, TAG_ITEM_ARTIST, f->author); + tag_add_item(tag, TAG_ARTIST, f->author); if (f->title[0]) - tag_add_item(tag, TAG_ITEM_TITLE, f->title); + tag_add_item(tag, TAG_TITLE, f->title); if (f->album[0]) - tag_add_item(tag, TAG_ITEM_ALBUM, f->album); + tag_add_item(tag, TAG_ALBUM, f->album); if (f->track > 0) { char buffer[16]; snprintf(buffer, sizeof(buffer), "%d", f->track); - tag_add_item(tag, TAG_ITEM_TRACK, buffer); + tag_add_item(tag, TAG_TRACK, buffer); } if (f->comment[0]) - tag_add_item(tag, TAG_ITEM_COMMENT, f->comment); + tag_add_item(tag, TAG_COMMENT, f->comment); if (f->genre[0]) - tag_add_item(tag, TAG_ITEM_GENRE, f->genre); + tag_add_item(tag, TAG_GENRE, f->genre); if (f->year > 0) { char buffer[16]; snprintf(buffer, sizeof(buffer), "%d", f->year); - tag_add_item(tag, TAG_ITEM_DATE, buffer); + tag_add_item(tag, TAG_DATE, buffer); } #endif diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index 89a812f52..bf0c76633 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -347,11 +347,8 @@ flac_cue_tag_load(const char *file) if (tag == NULL) tag = flac_tag_load(file, char_tnum); - if (char_tnum != NULL) - { - tag_add_item( tag, - TAG_ITEM_TRACK, - char_tnum); + if (char_tnum != NULL) { + tag_add_item(tag, TAG_TRACK, char_tnum); g_free(char_tnum); } diff --git a/src/decoder/mikmod_plugin.c b/src/decoder/mikmod_plugin.c index e7b7bfb03..850232f34 100644 --- a/src/decoder/mikmod_plugin.c +++ b/src/decoder/mikmod_plugin.c @@ -220,7 +220,7 @@ static struct tag *modTagDup(const char *file) title = g_strdup(Player_LoadTitle(path2)); g_free(path2); if (title) - tag_add_item(ret, TAG_ITEM_TITLE, title); + tag_add_item(ret, TAG_TITLE, title); return ret; } diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c index 6c375e6a0..301c80674 100644 --- a/src/decoder/modplug_plugin.c +++ b/src/decoder/modplug_plugin.c @@ -188,7 +188,7 @@ static struct tag *mod_tagdup(const char *file) title = g_strdup(ModPlug_GetName(f)); if (title) - tag_add_item(ret, TAG_ITEM_TITLE, title); + tag_add_item(ret, TAG_TITLE, title); g_free(title); ModPlug_Unload(f); diff --git a/src/decoder/mp4ff_plugin.c b/src/decoder/mp4ff_plugin.c index d2c63f983..745d1e619 100644 --- a/src/decoder/mp4ff_plugin.c +++ b/src/decoder/mp4ff_plugin.c @@ -391,22 +391,22 @@ mp4_tag_dup(const char *file) mp4ff_meta_get_by_index(mp4fh, i, &item, &value); if (0 == g_ascii_strcasecmp("artist", item)) { - tag_add_item(ret, TAG_ITEM_ARTIST, value); + tag_add_item(ret, TAG_ARTIST, value); } else if (0 == g_ascii_strcasecmp("title", item)) { - tag_add_item(ret, TAG_ITEM_TITLE, value); + tag_add_item(ret, TAG_TITLE, value); } else if (0 == g_ascii_strcasecmp("album", item)) { - tag_add_item(ret, TAG_ITEM_ALBUM, value); + tag_add_item(ret, TAG_ALBUM, value); } else if (0 == g_ascii_strcasecmp("track", item)) { - tag_add_item(ret, TAG_ITEM_TRACK, value); + tag_add_item(ret, TAG_TRACK, value); } else if (0 == g_ascii_strcasecmp("disc", item)) { /* Is that the correct id? */ - tag_add_item(ret, TAG_ITEM_DISC, value); + tag_add_item(ret, TAG_DISC, value); } else if (0 == g_ascii_strcasecmp("genre", item)) { - tag_add_item(ret, TAG_ITEM_GENRE, value); + tag_add_item(ret, TAG_GENRE, value); } else if (0 == g_ascii_strcasecmp("date", item)) { - tag_add_item(ret, TAG_ITEM_DATE, value); + tag_add_item(ret, TAG_DATE, value); } else if (0 == g_ascii_strcasecmp("writer", item)) { - tag_add_item(ret, TAG_ITEM_COMPOSER, value); + tag_add_item(ret, TAG_COMPOSER, value); } free(item); diff --git a/src/decoder/sidplay_plugin.cxx b/src/decoder/sidplay_plugin.cxx index d97abd656..079b178fb 100644 --- a/src/decoder/sidplay_plugin.cxx +++ b/src/decoder/sidplay_plugin.cxx @@ -347,18 +347,18 @@ sidplay_tag_dup(const char *path_fs) if(info.songs>1) { char *tag_title=g_strdup_printf("%s (%d/%d)", title, song_num, info.songs); - tag_add_item(tag, TAG_ITEM_TITLE, tag_title); + tag_add_item(tag, TAG_TITLE, tag_title); g_free(tag_title); } else - tag_add_item(tag, TAG_ITEM_TITLE, title); + tag_add_item(tag, TAG_TITLE, title); /* artist */ if (info.numberOfInfoStrings > 1 && info.infoString[1] != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, info.infoString[1]); + tag_add_item(tag, TAG_ARTIST, info.infoString[1]); /* track */ char *track=g_strdup_printf("%d", song_num); - tag_add_item(tag, TAG_ITEM_TRACK, track); + tag_add_item(tag, TAG_TRACK, track); g_free(track); /* time */ diff --git a/src/decoder/sndfile_decoder_plugin.c b/src/decoder/sndfile_decoder_plugin.c index 4cc64459f..59993ef89 100644 --- a/src/decoder/sndfile_decoder_plugin.c +++ b/src/decoder/sndfile_decoder_plugin.c @@ -190,15 +190,15 @@ sndfile_tag_dup(const char *path_fs) p = sf_get_string(sf, SF_STR_TITLE); if (p != NULL) - tag_add_item(tag, TAG_ITEM_TITLE, p); + tag_add_item(tag, TAG_TITLE, p); p = sf_get_string(sf, SF_STR_ARTIST); if (p != NULL) - tag_add_item(tag, TAG_ITEM_ARTIST, p); + tag_add_item(tag, TAG_ARTIST, p); p = sf_get_string(sf, SF_STR_DATE); if (p != NULL) - tag_add_item(tag, TAG_ITEM_DATE, p); + tag_add_item(tag, TAG_DATE, p); sf_close(sf); diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c index 39a075176..95f2de07a 100755 --- a/src/decoder/vorbis_plugin.c +++ b/src/decoder/vorbis_plugin.c @@ -176,11 +176,11 @@ vorbis_parse_comment(struct tag *tag, const char *comment) assert(tag != NULL); if (vorbis_copy_comment(tag, comment, VORBIS_COMMENT_TRACK_KEY, - TAG_ITEM_TRACK) || + TAG_TRACK) || vorbis_copy_comment(tag, comment, VORBIS_COMMENT_DISC_KEY, - TAG_ITEM_DISC) || + TAG_DISC) || vorbis_copy_comment(tag, comment, "album artist", - TAG_ITEM_ALBUM_ARTIST)) + TAG_ALBUM_ARTIST)) return; for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i) diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index f3d701144..3e7c0cef7 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -41,17 +41,17 @@ static struct { const char *name; enum tag_type type; } tagtypes[] = { - { "artist", TAG_ITEM_ARTIST }, - { "album", TAG_ITEM_ALBUM }, - { "title", TAG_ITEM_TITLE }, - { "track", TAG_ITEM_TRACK }, - { "name", TAG_ITEM_NAME }, - { "genre", TAG_ITEM_GENRE }, - { "date", TAG_ITEM_DATE }, - { "composer", TAG_ITEM_COMPOSER }, - { "performer", TAG_ITEM_PERFORMER }, - { "comment", TAG_ITEM_COMMENT }, - { "disc", TAG_ITEM_DISC }, + { "artist", TAG_ARTIST }, + { "album", TAG_ALBUM }, + { "title", TAG_TITLE }, + { "track", TAG_TRACK }, + { "name", TAG_NAME }, + { "genre", TAG_GENRE }, + { "date", TAG_DATE }, + { "composer", TAG_COMPOSER }, + { "performer", TAG_PERFORMER }, + { "comment", TAG_COMMENT }, + { "disc", TAG_DISC }, }; /** A pointer type for format converter function. */ diff --git a/src/icy_metadata.c b/src/icy_metadata.c index 69aa89092..4089e9c6f 100644 --- a/src/icy_metadata.c +++ b/src/icy_metadata.c @@ -95,7 +95,7 @@ icy_parse_tag_item(struct tag *tag, const char *item) if (p[0] != NULL && p[1] != NULL) { if (strcmp(p[0], "StreamTitle") == 0) - icy_add_item(tag, TAG_ITEM_TITLE, p[1]); + icy_add_item(tag, TAG_TITLE, p[1]); else g_debug("unknown icy-tag: '%s'", p[0]); } diff --git a/src/input/curl_input_plugin.c b/src/input/curl_input_plugin.c index a75245d06..6cd2bc917 100644 --- a/src/input/curl_input_plugin.c +++ b/src/input/curl_input_plugin.c @@ -402,8 +402,8 @@ copy_icy_tag(struct input_curl *c) if (c->tag != NULL) tag_free(c->tag); - if (c->meta_name != NULL && !tag_has_type(tag, TAG_ITEM_NAME)) - tag_add_item(tag, TAG_ITEM_NAME, c->meta_name); + if (c->meta_name != NULL && !tag_has_type(tag, TAG_NAME)) + tag_add_item(tag, TAG_NAME, c->meta_name); c->tag = tag; } @@ -609,7 +609,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream) tag_free(c->tag); c->tag = tag_new(); - tag_add_item(c->tag, TAG_ITEM_NAME, c->meta_name); + tag_add_item(c->tag, TAG_NAME, c->meta_name); } else if (g_ascii_strcasecmp(name, "icy-metaint") == 0) { char buffer[64]; size_t icy_metaint; diff --git a/src/input/lastfm_input_plugin.c b/src/input/lastfm_input_plugin.c index fc541ca28..71e4b1ad4 100644 --- a/src/input/lastfm_input_plugin.c +++ b/src/input/lastfm_input_plugin.c @@ -223,9 +223,9 @@ lastfm_read_tag(const char *response) enum tag_type type; const char *xmltag; } aliases[] = { - {TAG_ITEM_ARTIST, "creator"}, - {TAG_ITEM_TITLE, "title"}, - {TAG_ITEM_ALBUM, "album"} + {TAG_ARTIST, "creator"}, + {TAG_TITLE, "title"}, + {TAG_ALBUM, "album"} }; struct tag *tag = tag_new(); unsigned int i; diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index 9fdf46456..d1296abc2 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -433,9 +433,8 @@ httpd_output_tag(void *data, const struct tag *tag) page_unref (httpd->metadata); httpd->metadata = - icy_server_metadata_page(tag, TAG_ITEM_ALBUM, - TAG_ITEM_ARTIST, - TAG_ITEM_TITLE, + icy_server_metadata_page(tag, TAG_ALBUM, + TAG_ARTIST, TAG_TITLE, TAG_NUM_OF_ITEM_TYPES); if (httpd->metadata != NULL) { g_mutex_lock(httpd->mutex); diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c index 4412d26ff..f1b21bb36 100644 --- a/src/output/shout_plugin.c +++ b/src/output/shout_plugin.c @@ -471,10 +471,10 @@ shout_tag_to_metadata(const struct tag *tag, char *dest, size_t size) for (unsigned i = 0; i < tag->num_items; i++) { switch (tag->items[i]->type) { - case TAG_ITEM_ARTIST: + case TAG_ARTIST: strncpy(artist, tag->items[i]->value, size); break; - case TAG_ITEM_TITLE: + case TAG_TITLE: strncpy(title, tag->items[i]->value, size); break; diff --git a/src/songvec.c b/src/songvec.c index efef02216..d78c44ca0 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -69,12 +69,12 @@ static int songvec_cmp(const void *s1, const void *s2) int ret; /* first sort by disc */ - ret = compare_tag_item(a->tag, b->tag, TAG_ITEM_DISC); + ret = compare_tag_item(a->tag, b->tag, TAG_DISC); if (ret != 0) return ret; /* then by track number */ - ret = compare_tag_item(a->tag, b->tag, TAG_ITEM_TRACK); + ret = compare_tag_item(a->tag, b->tag, TAG_TRACK); if (ret != 0) return ret; diff --git a/src/stats.c b/src/stats.c index 70e790b83..303d23c8e 100644 --- a/src/stats.c +++ b/src/stats.c @@ -52,11 +52,11 @@ visit_tag(struct visit_data *data, const struct tag *tag) const struct tag_item *item = tag->items[i]; switch (item->type) { - case TAG_ITEM_ARTIST: + case TAG_ARTIST: strset_add(data->artists, item->value); break; - case TAG_ITEM_ALBUM: + case TAG_ALBUM: strset_add(data->albums, item->value); break; @@ -42,20 +42,20 @@ static struct { } bulk; const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = { - "Artist", + [TAG_ARTIST] = "Artist", [TAG_ARTIST_SORT] = "ArtistSort", - "Album", - "AlbumArtist", + [TAG_ALBUM] = "Album", + [TAG_ALBUM_ARTIST] = "AlbumArtist", [TAG_ALBUM_ARTIST_SORT] = "AlbumArtistSort", - "Title", - "Track", - "Name", - "Genre", - "Date", - "Composer", - "Performer", - "Comment", - "Disc", + [TAG_TITLE] = "Title", + [TAG_TRACK] = "Track", + [TAG_NAME] = "Name", + [TAG_GENRE] = "Genre", + [TAG_DATE] = "Date", + [TAG_COMPOSER] = "Composer", + [TAG_PERFORMER] = "Performer", + [TAG_COMMENT] = "Comment", + [TAG_DISC] = "Disc", /* MusicBrainz tags from http://musicbrainz.org/doc/MusicBrainzTag */ [TAG_MUSICBRAINZ_ARTISTID] = "MUSICBRAINZ_ARTISTID", @@ -83,7 +83,7 @@ void tag_lib_init(void) /* parse the "metadata_to_use" config parameter below */ /* ignore comments by default */ - ignore_tag_items[TAG_ITEM_COMMENT] = true; + ignore_tag_items[TAG_COMMENT] = true; value = config_get_string(CONF_METADATA_TO_USE, NULL); if (value == NULL) @@ -31,20 +31,20 @@ * Codes for the type of a tag item. */ enum tag_type { - TAG_ITEM_ARTIST, + TAG_ARTIST, TAG_ARTIST_SORT, - TAG_ITEM_ALBUM, - TAG_ITEM_ALBUM_ARTIST, + TAG_ALBUM, + TAG_ALBUM_ARTIST, TAG_ALBUM_ARTIST_SORT, - TAG_ITEM_TITLE, - TAG_ITEM_TRACK, - TAG_ITEM_NAME, - TAG_ITEM_GENRE, - TAG_ITEM_DATE, - TAG_ITEM_COMPOSER, - TAG_ITEM_PERFORMER, - TAG_ITEM_COMMENT, - TAG_ITEM_DISC, + TAG_TITLE, + TAG_TRACK, + TAG_NAME, + TAG_GENRE, + TAG_DATE, + TAG_COMPOSER, + TAG_PERFORMER, + TAG_COMMENT, + TAG_DISC, TAG_MUSICBRAINZ_ARTISTID, TAG_MUSICBRAINZ_ALBUMID, diff --git a/src/tag_ape.c b/src/tag_ape.c index e3b848bfc..fb210ca46 100644 --- a/src/tag_ape.c +++ b/src/tag_ape.c @@ -26,13 +26,13 @@ #include <stdio.h> static const char *const ape_tag_names[] = { - [TAG_ITEM_TITLE] = "title", - [TAG_ITEM_ARTIST] = "artist", - [TAG_ITEM_ALBUM] = "album", - [TAG_ITEM_COMMENT] = "comment", - [TAG_ITEM_GENRE] = "genre", - [TAG_ITEM_TRACK] = "track", - [TAG_ITEM_DATE] = "year" + [TAG_TITLE] = "title", + [TAG_ARTIST] = "artist", + [TAG_ALBUM] = "album", + [TAG_COMMENT] = "comment", + [TAG_GENRE] = "genre", + [TAG_TRACK] = "track", + [TAG_DATE] = "year" }; static struct tag * diff --git a/src/tag_id3.c b/src/tag_id3.c index c78983615..ad19062bf 100644 --- a/src/tag_id3.c +++ b/src/tag_id3.c @@ -157,7 +157,7 @@ tag_id3_import_text(struct tag *dest, struct id3_tag *tag, const char *id, if (ucs4 == NULL) continue; - if (type == TAG_ITEM_GENRE) + if (type == TAG_GENRE) ucs4 = id3_genre_name(ucs4); utf8 = import_id3_string(tag_is_id3v1(tag), ucs4); @@ -311,23 +311,23 @@ struct tag *tag_id3_import(struct id3_tag * tag) { struct tag *ret = tag_new(); - tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST, TAG_ITEM_ARTIST); + tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST, TAG_ARTIST); tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM_ARTIST, - TAG_ITEM_ALBUM_ARTIST); + TAG_ALBUM_ARTIST); tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST_SORT, TAG_ARTIST_SORT); tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM_ARTIST_SORT, TAG_ALBUM_ARTIST_SORT); - tag_id3_import_text(ret, tag, ID3_FRAME_TITLE, TAG_ITEM_TITLE); - tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM, TAG_ITEM_ALBUM); - tag_id3_import_text(ret, tag, ID3_FRAME_TRACK, TAG_ITEM_TRACK); - tag_id3_import_text(ret, tag, ID3_FRAME_YEAR, TAG_ITEM_DATE); - tag_id3_import_text(ret, tag, ID3_FRAME_GENRE, TAG_ITEM_GENRE); - tag_id3_import_text(ret, tag, ID3_FRAME_COMPOSER, TAG_ITEM_COMPOSER); - tag_id3_import_text(ret, tag, "TPE3", TAG_ITEM_PERFORMER); - tag_id3_import_text(ret, tag, "TPE4", TAG_ITEM_PERFORMER); - tag_id3_import_comment(ret, tag, ID3_FRAME_COMMENT, TAG_ITEM_COMMENT); - tag_id3_import_text(ret, tag, ID3_FRAME_DISC, TAG_ITEM_DISC); + tag_id3_import_text(ret, tag, ID3_FRAME_TITLE, TAG_TITLE); + tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM, TAG_ALBUM); + tag_id3_import_text(ret, tag, ID3_FRAME_TRACK, TAG_TRACK); + tag_id3_import_text(ret, tag, ID3_FRAME_YEAR, TAG_DATE); + tag_id3_import_text(ret, tag, ID3_FRAME_GENRE, TAG_GENRE); + tag_id3_import_text(ret, tag, ID3_FRAME_COMPOSER, TAG_COMPOSER); + tag_id3_import_text(ret, tag, "TPE3", TAG_PERFORMER); + tag_id3_import_text(ret, tag, "TPE4", TAG_PERFORMER); + tag_id3_import_comment(ret, tag, ID3_FRAME_COMMENT, TAG_COMMENT); + tag_id3_import_text(ret, tag, ID3_FRAME_DISC, TAG_DISC); tag_id3_import_musicbrainz(ret, tag); tag_id3_import_ufid(ret, tag); |