Commit Graph

52 Commits

Author SHA1 Message Date
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
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
Rosen Penev
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
Urs Fleisch
cc7d23cdf5 Consistently use quote form when including our own headers 2023-07-22 07:09:58 +02:00
Urs Fleisch
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
Urs Fleisch
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
Urs Fleisch
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
Urs Fleisch
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
whatdoineed2do
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
Urs Fleisch
a33cc0635a Remove deprecated stuff 2023-07-09 07:01:37 +02:00
Andreas Sturmlechner
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
Scott Wheeler
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
Tsuda Kageyu
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
Tsuda Kageyu
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
Peter Bauer
0a90687805 add options R, I, D for replace/insert/delete of arbitrary tags 2015-09-23 14:11:40 +02:00
Festus Hagen
35d5ba4eff Add BUILD_BINDINGS option, moved if(BUILD_EXAMPLES) to taglib/CMakeLists, plus some cleanup. 2015-08-06 17:26:37 -04:00
Samuel Martin
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
Tsuda Kageyu
2971891c69 Reduce useless detach operations by making some non-const iterators const. 2014-08-21 16:35:35 +09:00
Tsuda Kageyu
05e0081414 Avoid using sprintf() in tagreader.cpp to fix an MSVC warning. 2014-02-19 23:35:23 +09:00
Tsuda Kageyu
4d126c49e9 Fixed a crash of APE::Item::toString() when the data type is binary 2013-07-14 02:47:48 +09:00
Lukáš Lalinský
15b601f053 Use PropertyMap in tagreader 2012-11-21 14:40:26 +01:00
Lukáš Lalinský
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
Lukáš Lalinský
45b0279b41 Add a tool to inspect audio files, only MP4 is implemented for now 2012-11-11 16:43:36 +01:00
Lukáš Lalinský
050ff3835d Revert "Install examples if built."
This reverts commit 52e96e48c5.
2012-07-14 21:06:53 +02:00
Michael Palimaka
52e96e48c5 Install examples if built. 2012-05-16 04:37:25 +10:00
Lukáš Lalinský
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
Lukáš Lalinský
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
Lukáš Lalinský
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
Alexander Neundorf
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
Lukáš Lalinský
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
Scott Wheeler
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
Lukáš Lalinský
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
Scott Wheeler
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
Scott Wheeler
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
Adriaan de Groot
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
Dirk Mueller
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
David Faure
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
Brad Hards
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
Laurent Montel
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
Laurent Montel
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
Scott Wheeler
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
Scott Wheeler
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
Laurent Montel
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
Laurent Montel
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
Laurent Montel
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
Scott Wheeler
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
Scott Wheeler
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
Scott Wheeler
60f73eb537 fix memory leaks
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@402891 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2005-04-03 16:35:55 +00:00
Scott Wheeler
20fb2bd1ec Don't try to do stuff to files that aren't valid.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@344196 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2004-09-05 17:54:00 +00:00
Scott Wheeler
c22ee9d712 CVS_SILENT oops -- didn't mean to check this in
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@289568 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
2004-02-20 01:42:10 +00:00