Commit Graph

768 Commits

Author SHA1 Message Date
Martchus 04e6996ce3 Use the output file path when making an MP4 file also if no rewrite required
Otherwise the `--output-files` option of the tag editor will be ignored
when editing an MP4 file and no rewrite is required.

Note that the condition is already this way in `MediaFileInfo::makeMp3File()`
and `MatroskaContainer::internalMakeFile()`.
2023-01-02 20:04:42 +01:00
Martchus 766e7657b5 Preserve explicitly "undefined" language of MP4 tracks 2023-01-02 19:50:30 +01:00
Martchus 8d4c315611 Improve error messages about missing mandatory MP4 atoms 2023-01-02 19:18:07 +01:00
Martchus 3193df8e3f Fix reading duration from MP4's track header atom
* Skip 4 bytes reserved space correctly
* See https://github.com/Martchus/tageditor/issues/98
2023-01-02 19:16:45 +01:00
Martchus 0347ca73eb Avoid using deprecated OpenSSL functions in testsuite 2023-01-02 01:56:58 +01:00
Martchus dbdfd015bb Bump patch version 2023-01-02 01:55:53 +01:00
Martchus 93da1f1e25 Create ID3v2 tag for AIFF files within `createAppropriateTags()`
Wikipedia says an ID3v2 tag can be added and other software seems to be
able to cope with it.
2022-08-17 23:11:20 +02:00
Martchus bfe6ce8c1e Support detecting AIFF format 2022-08-17 23:06:09 +02:00
Martchus 49c6b61e0c Streamline coding style of date time related tests 2022-08-13 16:05:39 +02:00
Martchus 6333aaa84b Adapt DateTime test to latest changes 2022-08-13 16:04:56 +02:00
Martchus 4ac97910e9 Revert "Adapt tests to recent changes" partially
* In accordance with revert of 44fea6c8c2.
* This partially reverts commit 965ee4ab4b.
2022-08-13 15:43:28 +02:00
Martchus 0cc9271a7f Revert "Omit default components when formatting date time"
* This hack is no longer required as it is now possible to preserve
  what date time parts are specified.
* This reverts commit 44fea6c8c2.
2022-08-13 15:43:28 +02:00
Martchus b50de3cf4f Preserve present parts when converting old record date fields 2022-08-13 15:43:28 +02:00
Martchus f0d8a6efa7 Set only present parts when setting recording time of ID3 <= v2.3
See https://github.com/Martchus/tageditor/issues/86
2022-08-13 14:47:49 +02:00
Martchus 74f6d2b6ac Fix reference to ID3v2 field in error message 2022-08-13 14:43:43 +02:00
Martchus 4aff37b788 Support `CppUtilities::DateTimeExpression` in `TagValue` 2022-08-13 14:42:51 +02:00
Martchus d6a2903749 Fix namespace in documentation of TagDataType 2022-08-13 12:30:59 +02:00
Martchus 99bb786eeb Improve comments about `lRecordingTime`-mapping 2022-08-12 19:41:15 +02:00
Martchus 6da62db035 Add mapping for BPM in Vorbis Comments 2022-08-12 00:37:25 +02:00
Martchus 63c76e6ca4 Bump minor version 2022-08-12 00:36:59 +02:00
Martchus f068c44172 Prevent adding fields with an invalid ID
When there's no mapping for the specified known field, `fieldId()` returns
an invalid field ID. It should not be passed to `setValues()` as we would
otherwise attempt to create an invalid field.
2022-08-12 00:32:17 +02:00
Martchus df27013c2f Avoid misleading log message
"Writing frames" should just be "Writing data" because whatever the file
contains might not be (some kind of) frames.
2022-08-12 00:07:02 +02:00
Martchus 5dd5e301b3 Fix adding ID3v2 tag to file with unknown container format
The bytes skipped while searching for MP3 frames should not be used as
container offset. The container offset should just the offset after the
first ID3v2 tag (or zero if there are no tags).
2022-08-12 00:02:38 +02:00
Martchus 2484cb03f8 Fix merging ID3v2 tags 2022-08-11 23:59:40 +02:00
Martchus 60233c2af2 Add missing documentation 2022-08-02 21:41:05 +02:00
Martchus b4d9a3aeb8 Bump patch version 2022-08-02 21:40:24 +02:00
Martchus ccf77959b4 Convert text values to a supported encoding if needed on the fly
* This makes it harder to use the library wrongly and does not lead to
  worse performance as character set conversions are only done as needed.
* That's actually already done by serializers for most tag formats. This
  change ensures serializers for Matroska and Vorbis tag fields do this as
  well.
* Update documentation accordingly.
2022-07-21 23:30:45 +02:00
Martchus 2ae83a2301 Remove unused include 2022-07-21 23:24:08 +02:00
Martchus 1a5dff611c
Merge pull request #24 from Martchus/rating
Scale rating automatically when serializing popularity/rating field
2022-07-20 23:26:52 +02:00
Martchus c3c525c352 Scale rating automatically when serializing popularity/rating field
* Allow one to get a `Popularity` where `.rating` is always between 1 and 5
  via `TagValue::toScaledPopularity()` (or a "raw" scale by specifying the
  corresponding tag format)
* Allow one to assign a `Popularity` with `.scale = TagType::Unspecified`
  and `.rating` between 1 and 5 (or a "raw" scale by specifying the
  corresponding tag format). It will then be converted internally to
  the required scale (whatever the tag format internally uses)
    * Ensure all tag formats with popularity/rating field use
      `TagValue::toScaledPopularity()` internally when a `Popularity`
      object is assigned
* Ensure all tag formats with popularity/rating field store the rating as
  popularity object to preserve the scaling information
* Keep passing raw strings around working
    * `TagValue::toString()` still does *no* scaling
    * `TagValue::toScaledPopularity()` does *no* scaling for text values
      and instead just assigns the specified scale
* See https://github.com/Martchus/tagparser/issues/23
2022-07-20 23:23:51 +02:00
Martchus ed0fcad420 Bump minor version 2022-07-20 16:57:01 +02:00
Martchus 98d28ede9f Add scale info to Popularity for furture extension
This would allow implementing a way to convert between different scales and
which in turn would allow the UI to provide an editor with a generic scale
(e.g. stars) instead of only allowing to edit raw values as string.

This also make it assume that a single number is meant to be the rating
(instead of the user). That should make editing the rating a bit more
straight forward (if one doesn't care about the user and play counter).
2022-06-20 21:27:42 +02:00
Martchus d17f04864d Move TagType into separate header
So it can be used in different places without creating a dependency loop.
2022-06-20 21:21:11 +02:00
Martchus c4d850825a Map `RATING` field for Vorbis comments 2022-06-19 17:51:51 +02:00
Martchus 0e3ccf8baa Support play counter ID3v2 frame 2022-06-19 17:40:01 +02:00
Martchus 449ad034de Add string-representation for all types in tagDataTypeString() 2022-06-19 17:39:32 +02:00
Martchus 08570aea32 Support unsigned integers in TagValue 2022-06-19 17:38:54 +02:00
Martchus dcda6b673b Avoid breaking binary compatibility of TagDataType 2022-06-19 16:46:19 +02:00
Martchus 5205d08258 Improve coding style of a few functions in `id3v2frame.cpp`
* Declare functions only used in the compile unit as static
* Use `std` namespace explicitly
* Use `auto` where it makes sense
2022-06-19 16:32:42 +02:00
Martchus 669b054a48 Implement parsing popularimeter ID3v2 frame 2022-06-19 16:29:29 +02:00
Martchus f52b2958df Add implicit conversion of popularity to integer to generalize usage of popularity
* Propose the usage of the popularity type in general for the rating field
  so GUIs can show an appropriate UI element
* Do not just propose the popularity type for ID3v2 tags so a uniform UI
  element can be shown accross tag formats; and API to convert from a
  uniform scale is still TODO
2022-06-19 14:32:45 +02:00
Martchus c41046bd24 Simplify TagValue's comparision code 2022-06-18 14:54:55 +02:00
Martchus aa4b8a8e47 Ensure to handle all conversion errors in TagValue's equality operator
For instance, if a DateTime of wrong size is assigned this would lead to a
conversion error which would otherwise be unhandled.
2022-06-18 14:40:53 +02:00
Martchus 46014def51 Add data type for ID3v2's Popularimeter field
See https://github.com/Martchus/tageditor/issues/84
2022-06-18 14:33:30 +02:00
Martchus 9511d61371 Add comment about meaning of iTunes rating values 2022-06-16 01:15:51 +02:00
Martchus d6e1b4b77d Fix mapping of iTunes "advisory" rating to KnownField::LawRating
That likely fits the "advisory" rating better than KnownField::Rating which
is more a personal rating.
2022-06-16 01:15:51 +02:00
Martchus 5d7b7488fa Fix TagValue::toWString() for TagDataType::DateTime 2022-06-16 00:29:05 +02:00
Martchus 1457dec990 Map "popularity meter" of ID3v2 tags to the generic rating field
See https://github.com/Martchus/tageditor/issues/84
2022-06-15 23:50:15 +02:00
Martchus 7a70a8e098 Apply clang-format 2022-05-23 19:55:50 +02:00
Martchus e40c1901e1 Fix crash when parsing FLAC header 2022-05-23 19:55:32 +02:00