Commit Graph

35 Commits

Author SHA1 Message Date
Martchus d48722f26c Fix unity builds
* Define `CHRONO_UTILITIES_TIMESPAN_INTEGER_SCALE_OVERLOADS` consistently
  with all necassary changes
* Avoid ambiguity between enum members and certain class/struct names
2024-01-30 23:31:15 +01: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 4aff37b788 Support `CppUtilities::DateTimeExpression` in `TagValue` 2022-08-13 14:42:51 +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 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 08570aea32 Support unsigned integers in TagValue 2022-06-19 17:38:54 +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 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 cef4dc0bb7 Apply clang-format 2021-07-06 16:38:52 +02:00
Jonas Kvinge ea23d71e8a Fix spelling and typos 2021-07-02 11:12:39 +02:00
Martchus 965ee4ab4b Adapt tests to recent changes 2020-04-26 22:22:29 +02:00
Martchus eabc9c4438 Use 'override' in all TestFixture classes 2019-12-15 19:44:07 +01:00
Martchus 2725bad686 Add options for TagValue comparison
* Support case-insensitive comparision
* Allow ignoring meta-data
2019-08-12 20:24:27 +02:00
Martchus 5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
Martchus 5114a3ea08 Treat differently encoded values not necessarily as different
That an automatic conversion happens for different types but not
for different encodings was always a bit odd.

This makes writing tests easier and comparing values within the
tag editor does not rely on choosing a particular encoding.
2019-06-01 23:01:53 +02:00
Martchus c28ded1bca Allow instantiating TagValue from TimeSpan and DateTime 2019-06-01 22:54:44 +02:00
Martchus 8c88298fe8 Fix TagValue::operator== if 0 byte contained 2019-06-01 12:33:24 +02:00
Martchus 73adf26401 Fix conversion from PositionInSet to integer
Even though there was already a test verifying that it is
not possible.
2019-06-01 12:18:05 +02:00
Martchus 7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
Martchus 296e5d11b6 Fix TagValue::toStandardGenreIndex() for empty genre index 2019-02-14 18:18:54 +01:00
Martchus 5140b76f08 Treat 255 as empty ID3v1 genre index 2019-02-13 18:56:03 +01:00
Martchus bfe8979812 Fix 2 refs in documentation 2018-06-03 21:00:49 +02:00
Martchus 3c29430790 Extend TagValueTests to cover recent fixes 2018-06-03 19:20:02 +02:00
Martchus 60c757dcf6 Add c'tor overload to TagValue to prevent conversion to string 2018-06-03 19:04:48 +02: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 c875af0ce9 Use CPPUNIT_ASSERT_EQUAL 2018-03-06 22:44:01 +01:00
Martchus ab9ab4ba48 Add missing class descriptions 2017-08-29 01:35:45 +02:00
Martchus b9fb3c9695 Move test helper in its own namespace 2017-08-17 18:40:34 +02:00
Martchus c120b117c0 Fix tests 2017-06-19 13:54:23 +02:00
Martchus 646fc4d302 Fix TagValue::toInteger() from Latin1/UTF-8 str 2017-06-08 00:48:10 +02:00
Martchus 4e59ed2742 Mind encoding in TagValue::toStandardGenreIndex() 2017-06-03 21:00:36 +02:00
Martchus 5e91661de3 Test TagValue 2017-06-03 21:00:26 +02:00