mirror of
https://github.com/taglib/taglib.git
synced 2026-06-07 14:59:24 -04:00
Compare commits
5 Commits
v1.12-beta
...
v1.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8b39449c3 | ||
|
|
bd254654bc | ||
|
|
fbc3f9bbec | ||
|
|
99ad01e12f | ||
|
|
83aa01c6af |
2
AUTHORS
2
AUTHORS
@@ -16,6 +16,8 @@ Mathias Panzenböck <grosser.meister.morti@gmx.net>
|
||||
Mod, S3M, IT and XM metadata implementations
|
||||
Damien Plisson <damien78@audirvana.com>
|
||||
DSDIFF metadata implementation
|
||||
Urs Fleisch <ufleisch@users.sourceforge.net>
|
||||
Bug fixes, maintainer.
|
||||
|
||||
Please send all patches and questions to taglib-devel@kde.org rather than to
|
||||
individual developers!
|
||||
|
||||
80
INSTALL.md
80
INSTALL.md
@@ -38,7 +38,7 @@ For a 10.6 Snow Leopard static library with both 32-bit and 64-bit code, use:
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \
|
||||
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX="<folder you want to build to>"
|
||||
-DCMAKE_INSTALL_PREFIX="<folder you want to install to>"
|
||||
|
||||
After `make`, and `make install`, add `libtag.` to your XCode project, and add
|
||||
the include folder to the project's User Header Search Paths.
|
||||
@@ -52,7 +52,7 @@ This means you need to adjust things to suit your system, especially paths.
|
||||
Tested with:
|
||||
* Microsoft Visual Studio 2010, 2015, 2017
|
||||
* Microsoft C++ Build Tools 2015, 2017 (standalone packages not requiring Visual Studio)
|
||||
* Gcc by mingw-w64.sf.net v4.6.3 (Strawberry Perl 32b)
|
||||
* GCC by mingw-w64.sf.net v4.6.3 (Strawberry Perl 32b)
|
||||
* MinGW32-4.8.0
|
||||
|
||||
Requirements:
|
||||
@@ -69,15 +69,15 @@ Optional:
|
||||
Useful configuration options used with CMake (GUI and/or command line):
|
||||
Any of the `ZLIB_` variables may be used at the command line, `ZLIB_ROOT` is only
|
||||
available on the command line.
|
||||
|
||||
| option | description |
|
||||
---------------------| ------------|
|
||||
`ZLIB_ROOT=` | Where to find ZLib's root directory. Assumes parent of: `\include` and `\lib.`|
|
||||
`ZLIB_INCLUDE_DIR=` | Where to find ZLib's Include directory.|
|
||||
`ZLIB_LIBRARY=` | Where to find ZLib's Library.
|
||||
`ZLIB_SOURCE=` | Where to find ZLib's Source Code. Alternative to `ZLIB_INCLUDE_DIR` and `ZLIB_LIBRARY`.
|
||||
`CMAKE_INSTALL_PREFIX=` | Where to install Taglib. |
|
||||
`CMAKE_BUILD_TYPE=` | Release, Debug, etc ... (Not available in MSVC) |
|
||||
|
||||
| option | description |
|
||||
| ----------------------- | ----------- |
|
||||
| `ZLIB_ROOT=` | Where to find ZLib's root directory. Assumes parent of: `\include` and `\lib.`|
|
||||
| `ZLIB_INCLUDE_DIR=` | Where to find ZLib's Include directory.|
|
||||
| `ZLIB_LIBRARY=` | Where to find ZLib's Library.
|
||||
| `ZLIB_SOURCE=` | Where to find ZLib's Source Code. Alternative to `ZLIB_INCLUDE_DIR` and `ZLIB_LIBRARY`.
|
||||
| `CMAKE_INSTALL_PREFIX=` | Where to install Taglib. |
|
||||
| `CMAKE_BUILD_TYPE=` | Release, Debug, etc ... (Not available in MSVC) |
|
||||
|
||||
The easiest way is at the command prompt (Visual C++ command prompt for MSVS users – batch file and/or shortcuts are your friends).
|
||||
|
||||
@@ -85,11 +85,11 @@ The easiest way is at the command prompt (Visual C++ command prompt for MSVS use
|
||||
|
||||
Replace "GENERATOR" with your needs.
|
||||
* For MSVS: `Visual Studio XX YYYY`, e.g. `Visual Studio 14 2015`.
|
||||
|
||||
|
||||
**Note**: As Visual Studio 2017 supports CMake, you can skip this step and open the taglib
|
||||
folder in VS instead.
|
||||
* For MinGW: `MinGW Makefiles`
|
||||
|
||||
|
||||
C:\GitRoot\taglib> cmake -G "GENERATOR" -DCMAKE_INSTALL_PREFIX=C:\Libraries\taglib
|
||||
|
||||
Or use the CMake GUI:
|
||||
@@ -126,13 +126,13 @@ The easiest way is at the command prompt (Visual C++ command prompt for MSVS use
|
||||
C:\GitRoot\taglib> gmake
|
||||
|
||||
OR (Depending on MinGW install)
|
||||
|
||||
|
||||
C:\GitRoot\taglib> mingw32-make
|
||||
|
||||
|
||||
|
||||
3. **Install the project**
|
||||
|
||||
|
||||
(Change `install` to `uninstall` to uninstall the project)
|
||||
* MSVS:
|
||||
|
||||
@@ -140,7 +140,7 @@ The easiest way is at the command prompt (Visual C++ command prompt for MSVS use
|
||||
OR (Depending on MSVC version or personal choice)
|
||||
|
||||
C:\GitRoot\taglib> devenv install.vcxproj
|
||||
|
||||
|
||||
Or in the MSVS GUI:
|
||||
1. Open project.
|
||||
2. Open Solution Explorer.
|
||||
@@ -151,7 +151,7 @@ The easiest way is at the command prompt (Visual C++ command prompt for MSVS use
|
||||
|
||||
C:\GitRoot\taglib> gmake install
|
||||
OR (Depending on MinGW install)
|
||||
|
||||
|
||||
C:\GitRoot\taglib> mingw32-make install
|
||||
|
||||
|
||||
@@ -167,9 +167,53 @@ Unit Tests
|
||||
|
||||
If you want to run the test suite to make sure TagLib works properly on your
|
||||
system, you need to have cppunit installed. To build the tests, include
|
||||
the option `-DBUILD_TESTS=on` when running cmake.
|
||||
the option `-DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=OFF` when running cmake.
|
||||
|
||||
The test suite has a custom target in the build system, so you can run
|
||||
the tests using make:
|
||||
|
||||
make check
|
||||
|
||||
Windows MinGW:
|
||||
|
||||
* Get cppunit from https://www.freedesktop.org/wiki/Software/cppunit/
|
||||
* Build it for MinGW:
|
||||
- `./autogen.sh`
|
||||
- `./configure --disable-shared`
|
||||
- `mingw32-make; mingw32-make install DESTDIR=/path/to/install/dir`
|
||||
* Build TagLib with testing enabled:
|
||||
- ```
|
||||
cmake -G "MinGW Makefiles" -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=OFF \
|
||||
-DCPPUNIT_INCLUDE_DIR=/path/to/cppunit/include \
|
||||
-DCPPUNIT_LIBRARIES=/path/to/cppunit/lib/libcppunit.a \
|
||||
-DCPPUNIT_INSTALLED_VERSION=1.15.1
|
||||
```
|
||||
- `mingw32-make`
|
||||
- `mingw32-make check`
|
||||
|
||||
Windows MSVS:
|
||||
|
||||
* Get cppunit from https://www.freedesktop.org/wiki/Software/cppunit/
|
||||
* Build it in Visual Studio:
|
||||
- Open examples/examples2008.sln, convert all, do not overwrite.
|
||||
- Set architecture to x64, build configuration, e.g. Debug DLL.
|
||||
- It may fail, but the needed libraries should be available in src\cppunit\DebugDll.
|
||||
* Build TagLib with testing enabled:
|
||||
- ```
|
||||
cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
|
||||
-DBUILD_SHARED_LIBS=OFF -DENABLE_STATIC_RUNTIME=ON
|
||||
-DCPPUNIT_INCLUDE_DIR=\path\to\cppunit\include
|
||||
-DCPPUNIT_LIBRARIES=\path\to\cppunit\DebugDll\cppunitd_dll.lib
|
||||
-DCPPUNIT_INSTALLED_VERSION=1.15.1
|
||||
```
|
||||
- `msbuild all_build.vcxproj /p:Configuration=Debug`
|
||||
- `path %path%;\path\to\cppunit\DebugDll`
|
||||
- `tests\Debug\test_runner.exe`
|
||||
|
||||
macOS:
|
||||
|
||||
* Install cppunit using a package manager, e.g. `brew install cppunit`
|
||||
* Build TagLib with testing enabled:
|
||||
- `cmake -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=OFF`
|
||||
- `make`
|
||||
- `make check`
|
||||
|
||||
3
NEWS
3
NEWS
@@ -1,4 +1,5 @@
|
||||
============================
|
||||
TagLib 1.12 (Feb 16, 2021)
|
||||
==========================
|
||||
|
||||
* Added support for WinRT.
|
||||
* Added support for Linux on POWER.
|
||||
|
||||
12
README.md
12
README.md
@@ -4,11 +4,11 @@
|
||||
|
||||
### TagLib Audio Metadata Library
|
||||
|
||||
http://taglib.org/
|
||||
https://taglib.org/
|
||||
|
||||
TagLib is a library for reading and editing the metadata of several
|
||||
popular audio formats. Currently it supports both ID3v1 and [ID3v2][]
|
||||
for MP3 files, [Ogg Vorbis][] comments and ID3 tags
|
||||
for MP3 files, [Ogg Vorbis][] comments and ID3 tags
|
||||
in [FLAC][], MPC, Speex, WavPack, TrueAudio, WAV, AIFF, MP4, APE,
|
||||
and ASF files.
|
||||
|
||||
@@ -18,9 +18,9 @@ it may be used in proprietary applications, but if changes are made to
|
||||
TagLib they must be contributed back to the project. Please review the
|
||||
licenses if you are considering using TagLib in your project.
|
||||
|
||||
[ID3v2]: http://www.id3.org
|
||||
[Ogg Vorbis]: http://vorbis.com/
|
||||
[ID3v2]: https://id3.org/
|
||||
[Ogg Vorbis]: https://xiph.org/vorbis/
|
||||
[FLAC]: https://xiph.org/flac/
|
||||
[GNU Lesser General Public License]: http://www.gnu.org/licenses/lgpl.html
|
||||
[Mozilla Public License]: http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
[GNU Lesser General Public License]: https://www.gnu.org/licenses/lgpl.html
|
||||
[Mozilla Public License]: https://www.mozilla.org/MPL/MPL-1.1.html
|
||||
|
||||
|
||||
@@ -67,8 +67,13 @@ namespace
|
||||
File *detectByResolvers(FileName fileName, bool readAudioProperties,
|
||||
AudioProperties::ReadStyle audioPropertiesStyle)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if(::strlen(fileName) == 0 && ::wcslen(fileName) == 0)
|
||||
return 0;
|
||||
#else
|
||||
if(::strlen(fileName) == 0)
|
||||
return 0;
|
||||
#endif
|
||||
ResolverList::ConstIterator it = fileTypeResolvers.begin();
|
||||
for(; it != fileTypeResolvers.end(); ++it) {
|
||||
File *file = (*it)->createFile(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
|
||||
@@ -166,8 +166,8 @@ namespace TagLib {
|
||||
* \warning This pointer will become invalid when this FileRef and all
|
||||
* copies pass out of scope.
|
||||
*
|
||||
* \warning Do not cast it to any subclasses of \class Tag.
|
||||
* Use tag returning methods of appropriate subclasses of \class File instead.
|
||||
* \warning Do not cast it to any subclasses of Tag.
|
||||
* Use tag returning methods of appropriate subclasses of File instead.
|
||||
*
|
||||
* \see File::tag()
|
||||
*/
|
||||
|
||||
@@ -305,4 +305,10 @@ Ogg::Page::Page(const ByteVectorList &packets,
|
||||
}
|
||||
d->packets = packets;
|
||||
d->header.setPacketSizes(packetSizes);
|
||||
|
||||
// https://xiph.org/ogg/doc/framing.html, absolute granule position:
|
||||
// A special value of '-1' (in two's complement) indicates that no packets
|
||||
// finish on this page.
|
||||
if(!lastPacketCompleted && packets.size() <= 1)
|
||||
d->header.setAbsoluteGranularPosition(-1);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace TagLib {
|
||||
* - LYRICIST
|
||||
* - CONDUCTOR
|
||||
* - REMIXER
|
||||
* - PERFORMER:<XXXX>
|
||||
* - PERFORMER:\<XXXX>
|
||||
*
|
||||
* Other tags:
|
||||
*
|
||||
@@ -204,12 +204,12 @@ namespace TagLib {
|
||||
StringList &operator[](const String &key);
|
||||
|
||||
/*!
|
||||
* Returns true if and only if \other has the same contents as this map.
|
||||
* Returns true if and only if \a other has the same contents as this map.
|
||||
*/
|
||||
bool operator==(const PropertyMap &other) const;
|
||||
|
||||
/*!
|
||||
* Returns false if and only \other has the same contents as this map.
|
||||
* Returns false if and only \a other has the same contents as this map.
|
||||
*/
|
||||
bool operator!=(const PropertyMap &other) const;
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class TestOGG : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testDictInterface2);
|
||||
CPPUNIT_TEST(testAudioProperties);
|
||||
CPPUNIT_TEST(testPageChecksum);
|
||||
CPPUNIT_TEST(testPageGranulePosition);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@@ -222,6 +223,33 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void testPageGranulePosition()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".ogg");
|
||||
{
|
||||
Vorbis::File f(copy.fileName().c_str());
|
||||
// Force the Vorbis comment packet to span more than one page and
|
||||
// check if the granule position is -1 indicating that no packets
|
||||
// finish on this page.
|
||||
f.tag()->setComment(String(ByteVector(70000, 'A')));
|
||||
f.save();
|
||||
|
||||
f.seek(0x3a);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("OggS\0\0", 6), f.readBlock(6));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(-1), f.readBlock(8).toLongLong());
|
||||
}
|
||||
{
|
||||
Vorbis::File f(copy.fileName().c_str());
|
||||
// Use a small Vorbis comment package which ends on the seconds page and
|
||||
// check if the granule position is zero.
|
||||
f.tag()->setComment("A small comment");
|
||||
f.save();
|
||||
|
||||
f.seek(0x3a);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("OggS\0\0", 6), f.readBlock(6));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0), f.readBlock(8).toLongLong());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestOGG);
|
||||
|
||||
Reference in New Issue
Block a user