Commit Graph

78 Commits

Author SHA1 Message Date
Martchus 64d98f5530 Use std::string_view where it makes sense 2021-01-30 21:53:06 +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 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 214c8eecb3 Don't emit warning about zero-bytes for designated padding 2020-11-26 23:11:22 +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 7043c3d2a9 Don't suppress IO errors when writing files
* Close or flush streams explicitely so writing is not
  deferred
    * to catch errors in the right place
    * to avoid suppressing errors completely when writing
      would be deferred to the destructor invocation
* Improve comments
2019-12-15 19:43:16 +01:00
Martchus 6e9b39726d Add conversion from ISO-639-2/B codes to language names 2019-08-17 20:56:09 +02:00
Martchus 5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
Martchus 3288d49d62 Support 'file://' URLs also when saving 2019-05-04 16:04:37 +02:00
Martchus 7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
Martchus 0452b42bfc Add MediaFileInfo::overallAverageBitrate() 2019-03-10 16:31:47 +01:00
Martchus c4adad4297 Detect AV1 in IVF stream 2018-07-28 14:56:00 +02:00
Martchus e81c6bb169 Implement small TODOs for v8 2018-07-12 12:34:38 +02:00
Martchus a87ad5f5ec Don't use global variable for backup directory 2018-07-12 12:34:38 +02:00
Martchus 3265e0bea4 Fix documentation which was still using the old namespace 2018-06-03 20:38:32 +02:00
Martchus e29f9bd4f8 Fix warnings in MediaFileInfo, make safe casts explicit 2018-04-30 19:00:02 +02:00
Martchus 1889afef8f Take over track parsing status when parsing FLAC tags 2018-04-30 18:59:17 +02:00
Martchus 9cbc708a56 Apply clang-format 2018-04-29 21:15:34 +02:00
Martchus 388945d2b4 Add diag message when padding not supported 2018-04-29 21:13:30 +02:00
Martchus 30553c947c Fix warnings and improve style in makeMp3File() 2018-04-29 18:58:41 +02:00
Martchus ae65ad0408 Fix removing tags from FLAC files 2018-04-29 18:17:24 +02:00
Martchus 96010768f0 Improve documentation in MediaFileInfo 2018-04-29 18:11:15 +02:00
Martchus b76c334606 Apply clang-format 2018-04-29 17:19:33 +02:00
Martchus 0f0260fb77 Fix parseTags() for FLAC, consider tags unsupported if container unknown
FLAC stores tags on track level. Hence we must parse the
tracks here in order to parse the tags. This hasn't been taken
into account when refactoring the tag editor CLI leading to
https://github.com/Martchus/tageditor/issues/36.

So let's handle these format specific details in the tagparser
library which will now internally parse tracks when calling
parseTags() on FLAC files.

This also fixes the weird behavior to consider tags supported
although the container format is unknown.
2018-04-29 17:18:17 +02:00
Martchus b47705ff81 Refactor MediaFileInfo::createAppropriateTags() 2018-03-11 18:57:22 +01:00
Martchus b35fc2ff0d Improve some structure layouts 2018-03-11 16:14:42 +01:00
Martchus c0336ed4bb Apply clang-format 2018-03-07 01:17:50 +01:00
Martchus 0e15c74103 Move everything into namespace TagParser 2018-03-06 23:09:15 +01:00
Martchus 36511fcc13 Add progress feedback and diagnostics replacing status provider 2018-03-06 22:44:01 +01:00
Martchus e5c93e8293 Update 100 % percentage correctly 2017-10-30 08:21:17 +01:00
Martchus cdccc247c6 Treat WavPack files like MP3
Players seem to be able to at least skip ID3v2 or
are even able to display it. ID3v1 should not cause
any trouble at all because its use is even proposed
in the WavPack documentation.
2017-10-29 18:04:13 +01:00
Martchus f65b90885a Improve coding style 2017-10-09 21:49:04 +02:00
Martchus 5e4e6a04a9 Transfer notifications to media file info
Commit 'Fix duplicate notifications' (0f6ac6a) caused missing
notifications by omitting `addNotifications(*m_container);`
before clearing parsing results. This commit restores the old
behavior and will actually preserve all notifications. However,
it will cause duplicated notifications again. The notification
system must be reworked in v7 for a decent solution.
2017-09-14 22:13:34 +02:00
Martchus 098c54e016 Update documentation 2017-09-14 21:41:18 +02:00
Martchus 9c8a27c8b1 Fix gathering notifications of MatroskaContainer 2017-09-14 01:57:22 +02:00
Martchus 8197374249 Detect Speex in Ogg 2017-09-03 18:34:33 +02:00
Martchus 0f6ac6a7e3 Fix duplicate notifications 2017-08-20 01:59:43 +02:00
Martchus 9df142bdf6 Adjust constraints for ID3 tag conversion 2017-08-17 19:08:54 +02:00
Martchus 0485d6b5c6 Add method to generate technical summary 2017-08-17 19:08:54 +02:00
Martchus fd138f65ca Add method to find available languages 2017-08-17 19:08:54 +02:00
Martchus 555fb53ab8 Improve documentation of MediaFileInfo::createAppropriateTags() 2017-07-28 21:01:28 +02:00
Martchus 4faef55906 Fix writing MP4 chunk-by-chunk
This also involves finally implementing
Mp4Track::makeTrack(). Mp4Track::makeSampleTable()
which would enable modifying stbl atom is still not
fully implemented yet, though.
2017-05-29 00:58:08 +02:00
Martchus c3394acdb2 Fix typos 2017-03-01 18:21:00 +01:00
Martchus b97192abd3 Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01:00
Martchus 477ac9884b Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
Martchus 820078bb15 Fix saving MP3/FLAC when save saveFilePath() set 2016-11-18 17:58:47 +01:00
Martchus b20e02ec29 Fix parsing/accessing Matroska editions/chapters 2016-08-06 20:51:57 +02:00
Martchus d5c8086230 Improve misc details 2016-08-05 01:46:31 +02:00
Martchus 817a8e25e6 Improve documentation and consistency 2016-08-04 00:16:19 +02:00
Martchus 2a1102676b Imporve doc for createAppropriateTags 2016-07-27 20:28:35 +02:00