1.7 KiB
1.7 KiB
Adding a new field
This document describes how to add support for a new field. From these instructions one can also deduce what places need to be adjusted when amending support for a field.
Support new field in tagparser library
- Check whether https://wiki.hydrogenaud.io/index.php?title=Tag_Mapping contains a recommendation for the specific field to be added.
- Add the field to the enum
KnownField
. - Adjust
TagParser::lastKnownField
accordingly. - Adjust
TagParser::Tag::proposedDataType()
if it is not a text field. Consider that this method might be overwritten in format-specific implementations which might need adjustment as well. - Add the format-specific IDs to the corresponding header files, e.g.
vorbiscommentids.h
for Vorbis Comments. - Add the field mapping to the
internallyGetFieldId()
andinternallyGetKnownField()
methods of all formats which should be supported, e.g.TagParser::Id3v2Tag::internallyGetFieldId()
. - For ID3v2 tags add the mapping
convertToShortId()
andconvertToLongId()
if possible.
Support new field in the tag editor application
- Add the field to the
KnownFieldModel
class.- Add the English denotation of the field to
KnownFieldModel::fieldName
. - Add the field to the constructor
KnownFieldModel::KnownFieldModel
which composes the list of fields shown in the GUI and whether they are displayed by default or not.
- Add the English denotation of the field to
- Add the field to the
FIELD_NAMES
macro. It is used for the CLI's auto-completion andprint-field-names
. Only use small letters (a to z) here. No whitespaces! - Add the field to the
FieldMapping::fieldMapping
array used by the CLI. Be consistent with 2.!