I added two attachments: id3v2-format-string.patch and id3v2-format-string-with-playtime.patch.
The first one is a more or less seamless implementation of -p/--print option.
The second one is an improved version of the first one, it adds %S (playtime in seconds) to format string specifiers. It is a hack rather than a correct patch because this feature is implemented via two new files mp3tech.h and mp3tech.c, which are almost entirely taken from the correspondent files in mp3info 0.8.5a, therefore violating the project structure and ideology. A proper implementation of a patch for playtime calculation is a time-consuming feature, for it is a tag-independent problem, and it requires to implement a number of relatively low-level operations from scratch.
In brief, the second patch should be used only if %S is absolutely needed (in my case, I met this requirement in EMMS for Emacs when tried to use id3v2 as a tag scanner instead of mp3info used by default).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added two attachments: id3v2-format-string.patch and id3v2-format-string-with-playtime.patch.
The first one is a more or less seamless implementation of -p/--print option.
The second one is an improved version of the first one, it adds %S (playtime in seconds) to format string specifiers. It is a hack rather than a correct patch because this feature is implemented via two new files mp3tech.h and mp3tech.c, which are almost entirely taken from the correspondent files in mp3info 0.8.5a, therefore violating the project structure and ideology. A proper implementation of a patch for playtime calculation is a time-consuming feature, for it is a tag-independent problem, and it requires to implement a number of relatively low-level operations from scratch.
In brief, the second patch should be used only if %S is absolutely needed (in my case, I met this requirement in EMMS for Emacs when tried to use id3v2 as a tag scanner instead of mp3info used by default).
id3v2-format-string.diff with additional hack for playtime output