Commit Graph

44 Commits

Author SHA1 Message Date
Jonas Kvinge
ea23d71e8a Fix spelling and typos 2021-07-02 11:12:39 +02:00
64d98f5530 Use std::string_view where it makes sense 2021-01-30 21:53:06 +01:00
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
4cc2dbd9e6 Use flags instead of tons of boolean fields in AbstractTrack 2020-12-16 17:48:08 +01:00
b5983d40ad Add TagValue::nativeData() to store tag format specific meta-data 2020-12-05 21:03:00 +01:00
007251c604 Improve documentation of TagValue 2020-12-05 20:52:19 +01:00
9368b7a245 Add flags to TagValue, replacing dedicated field for read-only flag 2020-12-05 20:52:01 +01:00
aa23750307 Make many constructors explicit to avoid unintended implicit conversions 2020-12-05 20:48:57 +01:00
13a87b473d Improve documentation 2020-04-24 23:15:30 +02:00
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
2725bad686 Add options for TagValue comparison
* Support case-insensitive comparision
* Allow ignoring meta-data
2019-08-12 20:24:27 +02:00
c9e1dde70b Adapt to changes in c++utilities 2019-06-12 20:40:45 +02:00
5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
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
a8e20c5ef4 Allow converting the description encoding 2019-06-01 22:57:01 +02:00
7885b99f72 Add TagValue::isNull() 2019-06-01 22:55:16 +02:00
c28ded1bca Allow instantiating TagValue from TimeSpan and DateTime 2019-06-01 22:54:44 +02:00
7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
e81c6bb169 Implement small TODOs for v8 2018-07-12 12:34:38 +02:00
f27dbd8934 Update documentation 2018-07-09 12:42:14 +02:00
d64084ec78 Refactor formatting list of values 2018-07-01 22:11:34 +02:00
3265e0bea4 Fix documentation which was still using the old namespace 2018-06-03 20:38:32 +02:00
60c757dcf6 Add c'tor overload to TagValue to prevent conversion to string 2018-06-03 19:04:48 +02:00
8756c8b267 Use std::size_t in TagValue consistently 2018-06-03 18:58:23 +02:00
0a640c9f7f Fix warnings, mostly about implicit int conversions
This should fix all non-erros, leaving only warnings which
are indeed potential problems.

The following warnings should be safe to ignore:

* Conversions of various offsets from uint64 to
  std::streamoff/int64 are safe because such offsets have
  been obtained via tellg() and other functions
  returning std::streamoff in the first place.
* It also works vice-versa since tellg() should not
  return negative offsets with exceptions enabled.
* Conversions from char to unsigned char are also ok.
* Unused diag arguments can be ignored (those might be
  useful later).
* Annotate all intended fallthoughs.
2018-06-02 23:04:53 +02:00
b47705ff81 Refactor MediaFileInfo::createAppropriateTags() 2018-03-11 18:57:22 +01:00
b35fc2ff0d Improve some structure layouts 2018-03-11 16:14:42 +01:00
a26b98dcd7 Improve TagValue
* Make more functions inline
* Fix use of std::size_t
2018-03-11 15:16:09 +01:00
c0336ed4bb Apply clang-format 2018-03-07 01:17:50 +01:00
0e15c74103 Move everything into namespace TagParser 2018-03-06 23:09:15 +01:00
6b705d5652 Mind encoding when converting TagValue to pos 2017-06-03 21:00:26 +02:00
8b9e800803 TagValue: Strip BOM from assigned text
* So everywhere else can be safely assumed that
  text values never have a BOM
* Only exceptions are move constructor and move
  assignment where the caller must ensure no BOM
  is present
2017-05-18 02:27:08 +02:00
b97192abd3 Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01:00
ed5dba0408 Add TagValue::operator!=(), improve doc for TagValue 2016-10-20 23:39:02 +02:00
0cf30edbff Fix decoration for static builds 2016-08-29 15:43:05 +02:00
d5c8086230 Improve misc details 2016-08-05 01:46:31 +02:00
817a8e25e6 Improve documentation and consistency 2016-08-04 00:16:19 +02:00
8663dedf8c Fix misc issues 2016-07-30 22:35:46 +02:00
1e9df46691 Provide character set conversion for TagValue 2016-07-27 18:26:56 +02:00
a84ac37dbe Add support for raw FLAC streams 2016-05-16 20:56:53 +02:00
899e2a97fe small improvements
- fixed some mostly ID3/MP3 related bugs
- added convenience methods/operators
2016-03-18 21:43:09 +01:00
aa50c2d8b3 fixed includes 2015-09-06 19:57:33 +02:00
b1eb6faba6 fixed includes 2015-09-06 15:42:18 +02:00
033e313c74 First commit 2015-04-22 19:22:01 +02:00