Commit Graph
2720 Commits
Author SHA1 Message Date
Urs Fleisch 0db487bf61 Remove deprecated FileRef::create() method
In order to achieve this, the TagLib_File type of the C bindings is now
a FileRef and no longer a File. The support for the .oga extension has been
ported to FileRef(), so that taglib_file_new() should still behave the
same, but additionally also support content based file type detection.
2023-10-27 09:46:54 +02:00
Urs Fleisch 8d98ebf24b Provide properties methods on FileRef, make FileRef non-virtual
Use of FileRef::file() is discouraged, but was necessary to access the
properties. It was also not clear whether to access the properties via
tag() or file(). With the property methods on FileRef, it should become
the "simple usage" interface it was meant to be.
As the destructor was the only virtual method on FileRef, it is now made
non-virtual. Probably, it is not useful as a virtual base class.
2023-10-27 09:46:54 +02:00
Urs Fleisch 11f94903d0 DSDIFF: Add tests for ID3 in PROP and DIIN chunks 2023-10-23 06:06:05 +02:00
Urs Fleisch dce8e016b9 DSDIFF: Fix MSVC warnings 2023-10-23 06:06:05 +02:00
Urs Fleisch 6b5f28d56d DSDIFF: Fix adding and removing DIIN chunks
Also modernize and simplify code, fix formatting, support
ID3v2FrameFactory, fix updating the internal chunk bookkeeping
after file modifications, stripping ID3 and DIIN tags.
2023-10-23 06:06:05 +02:00
Stephen F. BoothandUrs Fleisch 19cceab211 DSDIFF support, add tests, fix formatting 2023-10-23 06:06:05 +02:00
Urs Fleisch 182edcd3f9 Add unit tests for C bindings 2023-10-21 06:19:55 +02:00
Urs Fleisch a3ad2d0aaa C bindings for complex properties like pictures (#953)
Provides a unified API for complex properties in the same way as
the Properties API in the C bindings. Since constructing and
traversing complex properties in C is a bit complicated, there
are convenience functions for the most common use case of getting
or setting a single picture.

    TAGLIB_COMPLEX_PROPERTY_PICTURE(props, data, size, "Written by TagLib",
                                   "image/jpeg", "Front Cover");
    taglib_complex_property_set(file, "PICTURE", props);

and

    TagLib_Complex_Property_Attribute*** properties =
      taglib_complex_property_get(file, "PICTURE");
    TagLib_Complex_Property_Picture_Data picture;
    taglib_picture_from_complex_property(properties, &picture);
2023-10-21 06:19:55 +02:00
complexlogicandGitHub 1d213b8b98 List: Add Sort Functions (#1160) 2023-10-18 07:54:22 +02:00
complexlogicandUrs Fleisch b40b834b1b Add ByteVector conversion functions, tests 2023-10-15 08:29:58 +02:00
Urs Fleisch 6be03b7ae1 Unified interface for complex properties like pictures (#94)
Provides a dynamic interface for properties which cannot be represented
with simple strings, e.g. pictures. The keys of such properties can
be queried using `complexPropertyKeys()`, which could return for example
["PICTURE"]. The property can then be read using
`complexProperties("PICTURE")`, which will return a list of variant maps
containing the picture data and attributes. Adding a picture is as
easy as

    t->setComplexProperties("PICTURE", {
      {
        {"data", data},
        {"pictureType", "Front Cover"},
        {"mimeType", "image/jpeg"}
      }
    });
2023-10-14 09:01:59 +02:00
Urs Fleisch 75d4252480 Variant type as container for complex properties 2023-10-14 09:01:59 +02:00
Urs Fleisch 304ab62957 Fix building without zlib 2023-10-14 09:01:59 +02:00
Rosen PenevandGitHub 89a54863ee std::array conversion (#1157) 2023-10-09 17:09:27 +02:00
3f25d3c342 Proofreading (#1155)
---------

Co-authored-by: Urs Fleisch <[email protected]>
2023-10-08 05:58:33 +02:00
Urs Fleisch 2e3a66cc31 Fix memory leak in testParsePodcastFrame() 2023-10-07 09:18:22 +02:00
Urs Fleisch 41077aa57e Braced list initialization for StringList and ByteVectorList (#1154)
Additionally, provide operator==() and operator!=() for Map and
operator<<() for ByteVectorList to facilitate the writing of tests.
2023-10-07 08:51:17 +02:00
21b08c0dcb List: Support Braced List Initialization (#1154)
* List: support braced list initialization

* Use swap for assignment

---------

Co-authored-by: complexlogic <[email protected]>
2023-10-07 07:27:29 +02:00
8a800b8c38 Map: Support Braced List Initialization (#1153)
* Map: support braced list initialization

* Use swap assignment

---------

Co-authored-by: complexlogic <[email protected]>
2023-10-07 07:27:14 +02:00
c332aa04f2 Add simple runtime version check API (#970)
How to use:

  #include <tversionnumber.h>

  if (TagLib::runtimeVersion() >= TagLib::VersionNumber(1, 11, 1)) {
    // running v1.11.1 or higher
  }

  if (TagLib::runtimeVersion() >= TagLib::VersionNumber(1, 12)) {
    // running v1.12 or higher
  }

---------

Co-authored-by: Urs Fleisch <[email protected]>
2023-10-06 14:15:30 +02:00
Urs Fleisch 24e0ac7aa4 Do not use tabs in CMake files 2023-09-30 15:12:51 +02:00
evpobrandUrs Fleisch ad1696ade6 Fix undefined PLATFORM_WINRT CMake option (#870) 2023-09-30 14:34:58 +02:00
Urs FleischandGitHub c13a42021a Do not scan full MPEG file for ID3v2 tag in Fast read style (#968) (#1151)
This is based on the patch used by VLC, but the full scan is only
skipped when the read style is explicitly set to Fast.
https://code.videolan.org/videolan/vlc/-/blob/master/contrib/src/taglib/0001-Implement-ID3v2-readStyle-avoid-worst-case.patch
2023-09-30 14:25:52 +02:00
Jan PalusandGitHub 2154078187 cmake: support both relative and absolute paths for pc files (#1152)
cmake supports both absolute and relative to prefix install dirs. #1071
effectively mandated relative paths only. check if install dir is
relative or absolute and either include ${prefix} in pc file or not

Fixes #1098
2023-09-30 14:25:00 +02:00
Urs Fleisch eaf7ff8b94 DSF: Support frame factory, ID3v2.3, allow trailing garbage
Additionally test coverage and formatting are improved.
2023-09-26 16:23:03 +02:00
Stephen F. BoothandUrs Fleisch 39d1d68237 DSD Stream File (DSF) support 2023-09-26 16:23:03 +02:00
Rosen PenevandGitHub e275abb8a3 Convert private raw pointers to unique_ptr (#1127)
Simplifies the code quite a bit.
2023-09-23 06:46:05 +02:00
nmariuspandGitHub 967aaf7af2 Require CMake version 3.5 (#1148)
Fix issue "CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.".
2023-09-16 22:00:22 -05:00
Rosen PenevandGitHub 48c4bf9c05 change two loops to while (#1147)
and one to for range.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-16 13:28:12 +02:00
Rosen PenevandGitHub bdf50eda99 use some more auto (#1146) 2023-09-16 13:12:04 +02:00
Rosen PenevandGitHub 653c2fe9e1 clang-tidy: use using instead of typedef (#1120)
Signed-off-by: Rosen Penev <[email protected]>
2023-09-16 09:06:14 +02:00
Rosen PenevandGitHub 6ed0ca28db add utf8cpp git submodule (#1142)
* add utf8cpp git submodule

More standard. Allows using the system provided utf8cpp.

Signed-off-by: Rosen Penev <[email protected]>

* cmake: use standard find_package for zlib

Simpler.

Signed-off-by: Rosen Penev <[email protected]>

---------

Signed-off-by: Rosen Penev <[email protected]>
2023-09-16 08:41:01 +02:00
Rosen PenevandGitHub cf5ad66922 default some more (#1135)
* remove defaulted constructor

It gets implicitly generated.

Signed-off-by: Rosen Penev <[email protected]>

* default some more

swap is not needed here as shared_ptr is copyable.

Signed-off-by: Rosen Penev <[email protected]>

---------

Signed-off-by: Rosen Penev <[email protected]>
2023-09-16 08:25:04 +02:00
Rosen PenevandGitHub 97a74ca3d8 clang: fix -Wextra-semi warnings (#1134)
Achieved by adding do/while to mandate a semicolon.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-16 08:23:45 +02:00
7646184d6b unused includes (#1133)
* unused includes

Signed-off-by: Rosen Penev <[email protected]>

* Use consistent order of includes

Always include in the following order:
- Own header files
- Standard header files
- System header files
- Project header files (toolkit first)

Exceptions:
- cppunit/extensions/HelperMacros.h must be included after
  header files declaring stream operators
- config.h must be included before its definitions are used

---------

Signed-off-by: Rosen Penev <[email protected]>
Co-authored-by: Urs Fleisch <[email protected]>
2023-09-16 08:22:36 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2dc1aa4ec9 build(deps): bump actions/checkout from 3 to 4 (#1143)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-10 12:27:11 +02:00
Rosen PenevandGitHub 00cfee30b6 github: add dependabot (#1141)
Bot to update CI.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-10 07:10:59 +02:00
Rosen PenevandGitHub 88cb197111 replace vector with array (#1140)
No need for vector. Allows simplifying some code.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-10 06:44:13 +02:00
Rosen PenevandGitHub 110a253ba3 use using declarations (#1139)
Signed-off-by: Rosen Penev <[email protected]>
2023-09-10 06:40:24 +02:00
Rosen PenevandGitHub d42e8ed3fe remove out of line declaration (#1137)
Seems to have been an oversight at some point.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-08 13:41:41 +02:00
Rosen PenevandGitHub 37ba5a5cc1 convert missed for loop (#1136)
clang-tidy missed it as the declaration is outside of the loop.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-07 11:04:02 -05:00
Rosen PenevandGitHub 23186f24ff remove unused typedefs (#1138)
This was done in C++98 times. No longer needed with auto.

Signed-off-by: Rosen Penev <[email protected]>
2023-09-07 11:02:55 -05:00
Rosen PenevandGitHub 528b84fbde size() to isEmpty() (#1131)
Signed-off-by: Rosen Penev <[email protected]>
2023-09-06 21:23:28 +02:00
Rosen PenevandGitHub 912897cd35 simplify boolean expressions (#1130)
Signed-off-by: Rosen Penev <[email protected]>
2023-09-06 21:16:59 +02:00
Rosen PenevandGitHub 54f84cc924 clang-tidy: use data() (#1129)
Found with readability-container-data-pointer

Signed-off-by: Rosen Penev <[email protected]>
2023-09-06 21:15:56 +02:00
Urs FleischandGitHub 47c4e0859c Restore const iterators replaced in #1107 (#1128)
Also make sure that the lines calling std algorithms are not
excessively long.
2023-09-06 20:59:01 +02:00
524b588a1e manual range loop conversions (#1126)
* manual range loop conversions

Signed-off-by: Rosen Penev <[email protected]>

* Restore const containers where non const temporaries are iterated

* Use std::as_const() instead of const container copies where possible

---------

Signed-off-by: Rosen Penev <[email protected]>
Co-authored-by: Urs Fleisch <[email protected]>
2023-09-06 20:58:13 +02:00
Rosen PenevandGitHub 303b55fb97 clang-tidy: ending namespace comment (#1132)
Signed-off-by: Rosen Penev <[email protected]>
2023-09-03 21:39:49 -05:00
Rosen PenevandGitHub ecf1d4fa53 clang: fix documentation (#1111)
* Use [[deprecated]] always

Simplifies the code. Codebase is C++17 anyways.

Signed-off-by: Rosen Penev <[email protected]>

* clang: fix documentation

Found with Wdocumentation

Signed-off-by: Rosen Penev <[email protected]>

* add deprecated to length() and fix usages

Signed-off-by: Rosen Penev <[email protected]>

---------

Signed-off-by: Rosen Penev <[email protected]>
2023-09-03 15:14:05 +02:00
Urs Fleisch d2bd56c519 Fix possible loss of data warning by MSVC 2023-09-02 16:30:45 +02:00