diff --git a/Makefile.am b/Makefile.am index 898abba82..c5527458c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -923,6 +923,7 @@ libtag_a_SOURCES =\ src/tag/ReplayGain.cxx src/tag/ReplayGain.hxx \ src/tag/MixRamp.cxx src/tag/MixRamp.hxx \ src/tag/Generic.cxx src/tag/Generic.hxx \ + src/tag/Id3MusicBrainz.cxx src/tag/Id3MusicBrainz.hxx \ src/tag/ApeLoader.cxx src/tag/ApeLoader.hxx \ src/tag/ApeReplayGain.cxx src/tag/ApeReplayGain.hxx \ src/tag/ApeTag.cxx src/tag/ApeTag.hxx diff --git a/src/tag/Id3MusicBrainz.cxx b/src/tag/Id3MusicBrainz.cxx new file mode 100644 index 000000000..d0de427ca --- /dev/null +++ b/src/tag/Id3MusicBrainz.cxx @@ -0,0 +1,34 @@ +/* + * Copyright 2003-2017 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "Id3MusicBrainz.hxx" +#include "TagTable.hxx" +#include "TagType.h" + +const struct tag_table musicbrainz_txxx_tags[] = { + { "ALBUMARTISTSORT", TAG_ALBUM_ARTIST_SORT }, + { "MusicBrainz Artist Id", TAG_MUSICBRAINZ_ARTISTID }, + { "MusicBrainz Album Id", TAG_MUSICBRAINZ_ALBUMID }, + { "MusicBrainz Album Artist Id", + TAG_MUSICBRAINZ_ALBUMARTISTID }, + { "MusicBrainz Track Id", TAG_MUSICBRAINZ_TRACKID }, + { "MusicBrainz Release Track Id", + TAG_MUSICBRAINZ_RELEASETRACKID }, + { nullptr, TAG_NUM_OF_ITEM_TYPES } +}; diff --git a/src/tag/Id3MusicBrainz.hxx b/src/tag/Id3MusicBrainz.hxx new file mode 100644 index 000000000..bbdfc4b26 --- /dev/null +++ b/src/tag/Id3MusicBrainz.hxx @@ -0,0 +1,25 @@ +/* + * Copyright 2003-2017 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_TAG_ID3MUSICBRAINZ_HXX +#define MPD_TAG_ID3MUSICBRAINZ_HXX + +extern const struct tag_table musicbrainz_txxx_tags[]; + +#endif diff --git a/src/tag/TagId3.cxx b/src/tag/TagId3.cxx index 14ce2c392..832696800 100644 --- a/src/tag/TagId3.cxx +++ b/src/tag/TagId3.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "TagId3.hxx" #include "Id3Load.hxx" +#include "Id3MusicBrainz.hxx" #include "TagHandler.hxx" #include "TagTable.hxx" #include "TagBuilder.hxx" @@ -205,19 +206,8 @@ gcc_pure static TagType tag_id3_parse_txxx_name(const char *name) noexcept { - static constexpr struct tag_table txxx_tags[] = { - { "ALBUMARTISTSORT", TAG_ALBUM_ARTIST_SORT }, - { "MusicBrainz Artist Id", TAG_MUSICBRAINZ_ARTISTID }, - { "MusicBrainz Album Id", TAG_MUSICBRAINZ_ALBUMID }, - { "MusicBrainz Album Artist Id", - TAG_MUSICBRAINZ_ALBUMARTISTID }, - { "MusicBrainz Track Id", TAG_MUSICBRAINZ_TRACKID }, - { "MusicBrainz Release Track Id", - TAG_MUSICBRAINZ_RELEASETRACKID }, - { nullptr, TAG_NUM_OF_ITEM_TYPES } - }; - return tag_table_lookup(txxx_tags, name); + return tag_table_lookup(musicbrainz_txxx_tags, name); } /**