Commit Graph

55 Commits

Author SHA1 Message Date
8b3f1a459e Fix issues reported by CppCheck
Many shadowFunction, some useStlAlgorithm, and others.

cppcheck --enable=all --inline-suppr \
  --suppress=noExplicitConstructor --suppress=unusedFunction \
  --suppress=missingIncludeSystem --project=compile_commands.json
2023-12-07 05:00:00 +01:00
135c0eb647 tagreader: Fix displaying of seconds in length, UTF-8 for ostream
The padding was wrong, 8 seconds were displayed as 0:80 instead of 0:08.
Also make the output of tagreader and tagreader_c the same, including
the encoding, which was still ISO-8859-1 for std::ostream.
2023-10-27 09:46:54 +02:00
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
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
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
7646184d6b unused includes (#1133)
* unused includes

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* 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 <rosenp@gmail.com>
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2023-09-16 08:22:36 +02:00
cc7d23cdf5 Consistently use quote form when including our own headers 2023-07-22 07:09:58 +02:00
2a1fb27735 clang-tidy: Replace C headers with C++ alternatives
run-clang-tidy -header-filter='.*' -checks='-*,modernize-deprecated-headers'

Fixed manually as automatic fix would shuffle headers around.
2023-07-22 07:09:58 +02:00
77ab5e9689 Narrow the scope of iterators
Also make sure that it is visible at first glance that iterators are
not taken from temporaries.
2023-07-22 07:09:58 +02:00
c2c9e8989c clang-tidy: Use auto where it improves the readability
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-auto' \
-config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'}]}" \
-fix

Manually fixed some wrong `const auto` replacements and verified
that all types are deduced correctly.
2023-07-22 07:09:58 +02:00
63922f2676 Avoid unnecessary detaching of containers
If only a constant iterator is needed, make the container const if
possible, otherwise use cbegin() and cend() to get a constant iterator
without detaching the container.

These fixes are needed so that `auto` can deduce the correct
iterator type.
2023-07-22 07:09:58 +02:00
e20a53afbb C bindings - properties i/f (#1091)
Support properties in C bindings

---------

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2023-07-09 19:48:27 +02:00
a33cc0635a Remove deprecated stuff 2023-07-09 07:01:37 +02:00
243dd863d7 Install examples after we selected to build them
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-03-06 14:52:25 +01:00
47342f6974 Prefer COMM frames with no description for setComment()
This creates symetry with ID3v2::Tag::comment() in preferring frames with no description
when choosing which COMM frame should be updated.  (Previously setComment() simply updated
the first COMM frame.)

Fixes #950
2020-03-27 12:14:51 +01:00
ea55c8b5c1 Merge branch 'cmake-allow-BUILD_SHARED_LIBS-to-drive-ENABLE_STATIC' of https://github.com/tSed/taglib into tSed-cmake-allow-BUILD_SHARED_LIBS-to-drive-ENABLE_STATIC
# Conflicts:
#	CMakeLists.txt
#	examples/CMakeLists.txt
2015-12-02 14:21:58 +09:00
4b8e39e8f0 Merge branch 'fh1.m_AddBuildBindingsOption' of https://github.com/FestusHagen/taglib into FestusHagen-fh1.m_AddBuildBindingsOption
# Conflicts:
#	CMakeLists.txt
2015-11-27 09:35:13 +09:00
0a90687805 add options R, I, D for replace/insert/delete of arbitrary tags 2015-09-23 14:11:40 +02:00
35d5ba4eff Add BUILD_BINDINGS option, moved if(BUILD_EXAMPLES) to taglib/CMakeLists, plus some cleanup. 2015-08-06 17:26:37 -04:00
00c6e7ea79 cmake: use BUILD_SHARED_LIBS instead of ENABLE_STATIC to drive the shared object build
In case ENABLE_STATIC is still set on the CMake command line, this
change will makes CMake bail out becaus e this option is no longer
supported.

This patch makes taglib more compliant with the distro package framework
that uses the standards CMake options.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2015-06-01 19:27:05 +02:00
2971891c69 Reduce useless detach operations by making some non-const iterators const. 2014-08-21 16:35:35 +09:00
05e0081414 Avoid using sprintf() in tagreader.cpp to fix an MSVC warning. 2014-02-19 23:35:23 +09:00
4d126c49e9 Fixed a crash of APE::Item::toString() when the data type is binary 2013-07-14 02:47:48 +09:00
15b601f053 Use PropertyMap in tagreader 2012-11-21 14:40:26 +01:00
c6f7ad3e83 Revert "Add a tool to inspect audio files, only MP4 is implemented for now"
This reverts commit 45b0279b41.
2012-11-12 16:14:32 +01:00
45b0279b41 Add a tool to inspect audio files, only MP4 is implemented for now 2012-11-11 16:43:36 +01:00
050ff3835d Revert "Install examples if built."
This reverts commit 52e96e48c5.
2012-07-14 21:06:53 +02:00
52e96e48c5 Install examples if built. 2012-05-16 04:37:25 +10:00
2f9838a440 *poof*
I've warned people about removing autoconf/automake support for a long time,
so let's make it happen for 1.7. CMake is now the only supported build system.
I'll update build docs in a following commit.

CCMAIL:taglib-devel@kde.org


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1220235 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2011-02-13 11:50:25 +00:00
004551faec Fix tagreader_c.c to not try to access invalid pointers
BUG:218334


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1061671 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2009-12-12 16:44:34 +00:00
db3db34e21 Fix building of examples with ENABLE_STATIC
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1021651 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2009-09-09 18:16:38 +00:00
e2c76396dd -INSTALL_DIR_NAME doesn't have to be set in the toplevel CMakeLists.txt, since it is already set as target property
-remove some unnecessary code
-use BIN_INSTALL_DIR for the RUNTIME destination

Alex




git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@891512 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2008-12-02 12:06:49 +00:00
705fa9d79b Fix compilation on MSVC/Windows
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@777124 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2008-02-19 19:52:04 +00:00
aedbaeaf5a show ape tags in the framelist
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@769307 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2008-02-01 04:15:59 +00:00
bb9e6fe65f Split BUILD_TESTS to BUILD_TESTS and BUILD_EXAMPLES.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@740072 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2007-11-22 13:20:21 +00:00
0da49842dd SVN_SILENT didn't mean for that to go in
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@727756 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2007-10-21 17:37:28 +00:00
1bdb67fafa More TAGLIB_EXPORTs from Lukas.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@727755 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2007-10-21 17:35:40 +00:00
317de487ba Still need the C++ runtime for the C bindings on Solaris; need stdlib.h for various prototypes.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@705364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2007-08-27 20:05:44 +00:00
26751ba95b the usual daily unbreak compilation
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@670244 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2007-05-31 20:51:55 +00:00
245a8af778 fix make install - I guess examples shouldn't actually be installed
(I see that Makefile.am required "make examples" explicitly)


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@594795 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-10-12 10:50:45 +00:00
4edbc93494 Change the taglib build system to use relative include paths.
This allows you to build taglib either as part of kdesupport
(i.e. with a source directory of kdesupport/) or by itself
(i.e. with a source directory of kdesupport/taglib/).


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@593544 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-10-08 06:28:19 +00:00
9dd4bf063e Add support for examples
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@592362 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-10-04 15:21:01 +00:00
619b1eaf54 Add tests directory into build
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@592361 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-10-04 15:12:47 +00:00
f162c5f5f9 And now get everything building again...
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@588037 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-09-24 18:10:30 +00:00
9a2f90be89 Re-add automake/autoconf stuff. I'm tempted to delete the CMake stuff while I'm
at it, but I'll leave it for now...


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@587989 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-09-24 16:17:47 +00:00
0b428130f3 Now taglib compiles with cmake
Remove old build system


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@587949 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-09-24 14:45:33 +00:00
d3d4061adc Fix CMakefiles
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@586716 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-09-20 12:57:59 +00:00
e3cf99c87a Add cmake support
All compile need to test now


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@586714 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2006-09-20 12:52:28 +00:00
c125032f0e ...or this
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@402894 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2005-04-03 16:37:56 +00:00
9b1eb2f5d6 Didn't mean to check this in.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@402892 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2005-04-03 16:36:17 +00:00