Martchus / tageditor

A tag editor with Qt GUI and command-line interface supporting MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska
GNU General Public License v2.0
672 stars 56 forks source link

Support multiple strings per ID3v2.4 text frame #38

Open jonnyrobbie opened 6 years ago

jonnyrobbie commented 6 years ago

Does tageditor support multiple strings per frame?

Martchus commented 6 years ago

Are you referring to ID3v2 frames? As far as I remember ID3v2 text frames can only contain one value at a time. Some frames can occur multiple times, though. However, regarding text frames the specification says: "There may only be one text information frame of its kind in an tag." So if I understand the question correctly I'd say that's not even possible according to the ID3v2 specification.


Note that in general the CLI supports specifying the same field multiple times: https://github.com/Martchus/tageditor/blob/master/tests/cli.cpp#L581

jonnyrobbie commented 6 years ago

http://id3.org/id3v2.4.0-frames section 4.2

All text information frames supports multiple strings, stored as a null separated list, where null is reperesented by the termination code for the charater encoding.

Martchus commented 6 years ago

Ah.. this has been introduced in ID3v2.4. ID3v2.3 just says: "If the textstring is followed by a termination ($00 (00)) all the following information should be ignored and not be displayed." (http://id3.org/d3v2.3.0 section 4.2)

And that's what the tag editor is currently doing. So no, it is not supported so far.

But I could implement it. At least the CLI already supports specifying fields multiple times. Those could be combined into a single text frame the the underlying library then.

For the GUI I'm not so sure whether it is worth the effort.

jonnyrobbie commented 6 years ago

As far as the GUI goes, there could certainly be a pretty robust solution, but you are correct that it would be a substantial effort to implement properly. For that I suggest to simply have a character substitution - like \n -> \0 (with multiline-enabled text boxes) or \x7c -> \0 ...or preferably user-choice substitution.

Martchus commented 6 years ago

This should work now for the CLI with latest master of tageditor and tagparser: https://github.com/Martchus/tageditor/commit/898ee2434e2a4eca11349e2a013227df9cc3dd1a