Commit Graph

605 Commits

Author SHA1 Message Date
Martchus aed719bacf Fix usage of bibliographic language codes 2021-01-20 22:39:42 +01:00
Martchus 2d67ddeeea Don't map language code "und"
The library uses empty strings if there's no value
and the ISO language code mapping should not make and
exception.
2021-01-20 22:19:43 +01:00
Martchus abd4fbb868 Allow to specify location of JSON document for ISO-639-2 2021-01-20 21:59:34 +01:00
Martchus cae88246ec Generate code for ISO-639-2/B mapping from iso-codes package 2021-01-20 21:45:14 +01:00
Martchus 2e5ef20af3 Remove unused optional header from localehelper.h 2021-01-20 20:10:56 +01:00
Martchus e5c259c4fa Make functions for dealing with ISO-639-2 names private in favor of Locale class 2021-01-20 20:08:13 +01:00
Martchus 761e3ee44b Mark all "final" tag, track and container classes as such 2020-12-18 21:13:52 +01:00
Martchus e4a89af3c0 Improve documentation 2020-12-16 17:49:02 +01:00
Martchus 6b469f1c26 Add Locale class to deal with differently specified languages/countries
Different media/tag formats specify languages and countries
differently. This change introduces a Locale class to keep track
of the format being used. So far there are no automatic conversions
implemented so it is entirely up to the user to pass valid values using
a format which matches the one required by the media/tag format.

This change also adds support for Matroska's IETF elements so at least the
raw value can be read, written and is preserved.
2020-12-16 17:48:08 +01:00
Martchus 4cc2dbd9e6 Use flags instead of tons of boolean fields in AbstractTrack 2020-12-16 17:48:08 +01:00
Martchus b5983d40ad Add TagValue::nativeData() to store tag format specific meta-data 2020-12-05 21:03:00 +01:00
Martchus 007251c604 Improve documentation of TagValue 2020-12-05 20:52:19 +01:00
Martchus 9368b7a245 Add flags to TagValue, replacing dedicated field for read-only flag 2020-12-05 20:52:01 +01:00
Martchus aa23750307 Make many constructors explicit to avoid unintended implicit conversions 2020-12-05 20:48:57 +01:00
Martchus ed37b6c5e5 Return name for DiagLevel::Debug 2020-12-01 01:51:27 +01:00
Martchus bcf00b0df5 Fix handling AVC config errors leading to crashes
See https://github.com/Martchus/tageditor/issues/60
2020-12-01 01:44:51 +01:00
Martchus 31e8741db0 Improve coding style in AVC config parser
* Avoid magic numbers
* Avoid needlessly verbose syntax
* Add comments
2020-12-01 01:13:01 +01:00
Martchus 40031b8ddf Be more error resilient when checking the container and MP3 frames
Most players/tools can cope with MP3 files which have some bytes of junk
after the ID3v2 tag just fine, e.g. ffmpeg shows just
```
[mp3 @ 0x559e1f4cbd80] Skipping 1670 bytes of junk at 1165.
```
and most players can play the file just fine.

This change makes the tag editor also more resilient, allowing it to skip
a certain amount of junk bytes before a known container is detected. It
will also skip a certain amount of junk MPEG audio frames.
2020-11-27 00:13:26 +01:00
Martchus f371efe642 Don't support IETF language elements explicitely
For now let's just ignore these elements explicitely until they are
actually supported. This way the warnings are at least more specific and
there will be no inconsistency when updating the track language.
2020-11-26 23:18:14 +01:00
Martchus 5d4a211d5d Add IDs of Matroska elements for IETF language info 2020-11-26 23:12:47 +01:00
Martchus 214c8eecb3 Don't emit warning about zero-bytes for designated padding 2020-11-26 23:11:22 +01:00
Martchus 5f39e377dc Use std::size_t consistently 2020-11-25 17:54:30 +01:00
Martchus 9a5d366ce0 Vorbis comment: Turn "YEAR" into "DATE" (unless "DATE" exists)
"DATE" is an official field and "YEAR" only an inofficial one but present
in some files. In consistency with MediaInfo and VLC player it is treated
like "DATE" here.
2020-11-25 01:39:57 +01:00
Martchus cce1e2f96d Apply clang-format 2020-11-14 22:58:55 +01:00
Martchus 9569065fb4 Improve reading MPEG audio info
* Skip empty frames
* Improve error messages
2020-11-14 22:58:40 +01:00
Martchus 32e3cd9593 Fix computing MPEG audio frame size 2020-11-14 22:56:47 +01:00
Martchus c583b3984f Take slot size into account when calculating MPEG audio frame size 2020-11-14 22:54:33 +01:00
Martchus 41184e704d Improve skipping padding
* Skip up to 0x800 bytes
* Skip zero bytes also if there are less than four consecutive zero bytes
  remaining
2020-11-14 22:52:27 +01:00
Martchus e7ce9e7ced Improve documentation 2020-11-05 19:52:09 +01:00
Martchus 2cdcb9e6b2
Merge pull request #14 from Martchus/enhance-format-description
Enhance track description
2020-10-01 21:01:34 +02:00
Martchus 3a0b6c24dd Include more details into track description
* Usually the profile and level are interesting and don't take much space
* Add also a short description if it is too long after all
2020-10-01 19:58:03 +02:00
Martchus 30f233377f Include AVC profiles in abbreviations
One can still unset sub if it is too much detail.
2020-10-01 19:33:42 +02:00
Martchus 16f4d2165c Do not incorrectly abbreviate MPEG-4 ASP as H.263
Unlike MPEG-4 AVC and H.264, MPEG-4 ASP and H.263 are not identical.
2020-10-01 19:09:01 +02:00
Martchus 965ee4ab4b Adapt tests to recent changes 2020-04-26 22:22:29 +02:00
Martchus 44fea6c8c2 Omit default components when formatting date time
It just looks nicer to have e.g. "2017" instead of "2017-01-01T00:00:00".
The ID3v2.4.0 standard and the Matroska standard explicitely allow this
format as well.
2020-04-26 21:45:20 +02:00
Martchus 13a87b473d Improve documentation 2020-04-24 23:15:30 +02:00
Martchus d26e594777 Deprecate 'Year' in favor of 'RecordDate' and 'ReleaseDate', fix handling in ID3v2
1. Convert TYER and related fields of old ID3v2 versions to the new TDRC
  field and only expose that via the generic accessors.
2. When writing an old ID3v2 tag, convert TDRC back to the old fields.
3. One can still manually unset the via 1. auto-populated TDRC to disable 2.
   and write the old fields directly. So the automatic handling does not
   reduce the flexibility of the library.
4. Deprecate 'Year'; it is replaced by the already existing 'RecordDate'
   which is now supposed to be used everywhere where 'Year' was used before
5. Introduce 'ReleaseDate' to support this field which is supported in
   ID3v2.4.0 and Matroska via the generic accessors.
6. Use ISO format when converting tag values of the type DateTime to/from
   string. This is closer to what's used in ID3v2 tags internally. (The
   library still allows the old format as fallback when parsing for
   compatibility.)
2020-04-24 23:15:13 +02:00
Martchus a7d359df81 Fix warnings about empty expression statements 2020-04-22 22:49:40 +02:00
Martchus 0d4d3da41e Add script to update enum comments 2020-04-22 22:09:00 +02:00
Martchus 0e66b34d48 Add human readable representation of certain IDs as comments 2020-04-22 22:08:02 +02:00
Martchus 6c8f237087 Show warning when reading/writing ID3v2 frames not matching the tag version 2020-04-22 19:48:27 +02:00
Martchus c9e0f82519 Add missing exports in id3v2frameids.h 2020-04-22 19:15:54 +02:00
Martchus 8f3eae59f1 Add more time-related ID3v2 IDs 2020-04-22 19:14:34 +02:00
Martchus 248a6555f3 Add links to upstream documentation of field IDs for the different formats 2020-04-22 18:43:41 +02:00
Martchus 25b567913b Detect Dolby Digital Plus in Matroska files 2020-03-18 17:48:23 +01:00
Martchus fb4633ad36 Add specific diag msg when abort saveing mkv while parsing orig file 2019-12-30 23:53:53 +01:00
Martchus 40a96c1fd4 Use 64 KiB buffer to copy file elements 2019-12-30 23:51:54 +01:00
Martchus b2c02e9acc Fix childs -> children 2019-12-30 22:54:11 +01:00
Martchus 49798ae3a8 Improve wording in Mp4Container 2019-12-15 19:44:44 +01:00
Martchus eabc9c4438 Use 'override' in all TestFixture classes 2019-12-15 19:44:07 +01:00