mirror of
https://github.com/taglib/taglib.git
synced 2026-06-07 14:59:24 -04:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f697fce8e | ||
|
|
320d0f5ad7 | ||
|
|
77087cf865 | ||
|
|
8b4a27beb4 | ||
|
|
998ebf4ce6 | ||
|
|
ccaf650214 | ||
|
|
9fad0b28a5 | ||
|
|
153820bf12 | ||
|
|
29be00dc59 | ||
|
|
ab30ec3a6f | ||
|
|
0a90687805 | ||
|
|
5ca4cd2f52 | ||
|
|
70f8fb1bae | ||
|
|
030e177640 | ||
|
|
3bb0b11bff | ||
|
|
60558d6a4a | ||
|
|
12f59d774e | ||
|
|
e2466a72f8 | ||
|
|
9666b64f28 | ||
|
|
15a1505880 | ||
|
|
fbd3b71690 | ||
|
|
6a76f491f8 | ||
|
|
6d925da75e | ||
|
|
e178875b40 | ||
|
|
bf45cfd84a | ||
|
|
b49e3e5620 | ||
|
|
fa6f33e552 | ||
|
|
021c539002 | ||
|
|
aedfeba66b | ||
|
|
29ed265281 |
@@ -56,14 +56,18 @@ set(TAGLIB_LIB_MAJOR_VERSION "1")
|
||||
set(TAGLIB_LIB_MINOR_VERSION "10")
|
||||
set(TAGLIB_LIB_PATCH_VERSION "0")
|
||||
|
||||
set(TAGLIB_LIB_VERSION_STRING "${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}")
|
||||
if("${TAGLIB_LIB_PATCH_VERSION}" EQUAL "0")
|
||||
set(TAGLIB_LIB_VERSION_STRING "${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}")
|
||||
else()
|
||||
set(TAGLIB_LIB_VERSION_STRING "${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}")
|
||||
endif()
|
||||
|
||||
# 1. If the library source code has changed at all since the last update, then increment revision.
|
||||
# 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
|
||||
# 3. If any interfaces have been added since the last public release, then increment age.
|
||||
# 4. If any interfaces have been removed since the last public release, then set age to 0.
|
||||
set(TAGLIB_SOVERSION_CURRENT 16)
|
||||
set(TAGLIB_SOVERSION_REVISION 0)
|
||||
set(TAGLIB_SOVERSION_REVISION 1)
|
||||
set(TAGLIB_SOVERSION_AGE 15)
|
||||
|
||||
math(EXPR TAGLIB_SOVERSION_MAJOR "${TAGLIB_SOVERSION_CURRENT} - ${TAGLIB_SOVERSION_AGE}")
|
||||
@@ -130,4 +134,4 @@ configure_file(
|
||||
if (NOT TARGET uninstall)
|
||||
add_custom_target(uninstall
|
||||
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
8
NEWS
8
NEWS
@@ -1,6 +1,12 @@
|
||||
TagLib 1.10 (Aug 23, 2015)
|
||||
TagLib 1.10 (Nov 11, 2015)
|
||||
==========================
|
||||
|
||||
1.10:
|
||||
|
||||
* Added new options to the tagwriter example.
|
||||
* Fixed self-assignment operator in some types.
|
||||
* Fixed extraction of MP4 tag keys with an empty list.
|
||||
|
||||
1.10 BETA:
|
||||
|
||||
* New API for the audio length in milliseconds.
|
||||
|
||||
@@ -7,6 +7,6 @@ includedir=${INCLUDE_INSTALL_DIR}
|
||||
Name: TagLib C Bindings
|
||||
Description: Audio meta-data library (C bindings)
|
||||
Requires: taglib
|
||||
Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
|
||||
Version: ${TAGLIB_LIB_VERSION_STRING}
|
||||
Libs: -L${LIB_INSTALL_DIR} -ltag_c
|
||||
Cflags: -I${INCLUDE_INSTALL_DIR}/taglib
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -34,6 +35,7 @@
|
||||
#include <fileref.h>
|
||||
#include <tfile.h>
|
||||
#include <tag.h>
|
||||
#include <tpropertymap.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -65,11 +67,32 @@ void usage()
|
||||
cout << " -g <genre>" << endl;
|
||||
cout << " -y <year>" << endl;
|
||||
cout << " -T <track>" << endl;
|
||||
cout << " -R <tagname> <tagvalue>" << endl;
|
||||
cout << " -I <tagname> <tagvalue>" << endl;
|
||||
cout << " -D <tagname>" << endl;
|
||||
cout << endl;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void checkForRejectedProperties(const TagLib::PropertyMap &tags)
|
||||
{ // stolen from tagreader.cpp
|
||||
if(tags.size() > 0) {
|
||||
unsigned int longest = 0;
|
||||
for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) {
|
||||
if(i->first.size() > longest) {
|
||||
longest = i->first.size();
|
||||
}
|
||||
}
|
||||
cout << "-- rejected TAGs (properties) --" << endl;
|
||||
for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) {
|
||||
for(TagLib::StringList::ConstIterator j = i->second.begin(); j != i->second.end(); ++j) {
|
||||
cout << left << std::setw(longest) << i->first << " - " << '"' << *j << '"' << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TagLib::List<TagLib::FileRef> fileList;
|
||||
@@ -121,6 +144,29 @@ int main(int argc, char *argv[])
|
||||
case 'T':
|
||||
t->setTrack(value.toInt());
|
||||
break;
|
||||
case 'R':
|
||||
case 'I':
|
||||
if(i + 2 < argc) {
|
||||
TagLib::PropertyMap map = (*it).file()->properties ();
|
||||
if(field == 'R') {
|
||||
map.replace(value, TagLib::String(argv[i + 2]));
|
||||
}
|
||||
else {
|
||||
map.insert(value, TagLib::String(argv[i + 2]));
|
||||
}
|
||||
++i;
|
||||
checkForRejectedProperties((*it).file()->setProperties(map));
|
||||
}
|
||||
else {
|
||||
usage();
|
||||
}
|
||||
break;
|
||||
case 'D': {
|
||||
TagLib::PropertyMap map = (*it).file()->properties();
|
||||
map.erase(value);
|
||||
checkForRejectedProperties((*it).file()->setProperties(map));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
|
||||
@@ -35,7 +35,7 @@ do
|
||||
flags="$flags -I$includedir/taglib"
|
||||
;;
|
||||
--version)
|
||||
echo ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
|
||||
echo ${TAGLIB_LIB_VERSION_STRING}
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
|
||||
@@ -29,7 +29,7 @@ goto theend
|
||||
:doit
|
||||
if /i "%1#" == "--libs#" echo -L${LIB_INSTALL_DIR} -llibtag
|
||||
if /i "%1#" == "--cflags#" echo -I${INCLUDE_INSTALL_DIR}/taglib
|
||||
if /i "%1#" == "--version#" echo ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
|
||||
if /i "%1#" == "--version#" echo ${TAGLIB_LIB_VERSION_STRING}
|
||||
if /i "%1#" == "--prefix#" echo ${CMAKE_INSTALL_PREFIX}
|
||||
|
||||
:theend
|
||||
|
||||
@@ -6,6 +6,6 @@ includedir=${INCLUDE_INSTALL_DIR}
|
||||
Name: TagLib
|
||||
Description: Audio meta-data library
|
||||
Requires:
|
||||
Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
|
||||
Version: ${TAGLIB_LIB_VERSION_STRING}
|
||||
Libs: -L${LIB_INSTALL_DIR} -ltag
|
||||
Cflags: -I${INCLUDE_INSTALL_DIR}/taglib
|
||||
|
||||
@@ -86,8 +86,10 @@ APE::Item::~Item()
|
||||
|
||||
Item &APE::Item::operator=(const Item &item)
|
||||
{
|
||||
delete d;
|
||||
d = new ItemPrivate(*item.d);
|
||||
if(&item != this) {
|
||||
delete d;
|
||||
d = new ItemPrivate(*item.d);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,10 +72,12 @@ ASF::Attribute::Attribute(const ASF::Attribute &other)
|
||||
|
||||
ASF::Attribute &ASF::Attribute::operator=(const ASF::Attribute &other)
|
||||
{
|
||||
if(d->deref())
|
||||
delete d;
|
||||
d = other.d;
|
||||
d->ref();
|
||||
if(&other != this) {
|
||||
if(d->deref())
|
||||
delete d;
|
||||
d = other.d;
|
||||
d->ref();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,12 @@ MP4::CoverArt::CoverArt(const CoverArt &item) : d(item.d)
|
||||
MP4::CoverArt &
|
||||
MP4::CoverArt::operator=(const CoverArt &item)
|
||||
{
|
||||
if(d->deref()) {
|
||||
delete d;
|
||||
if(&item != this) {
|
||||
if(d->deref())
|
||||
delete d;
|
||||
d = item.d;
|
||||
d->ref();
|
||||
}
|
||||
d = item.d;
|
||||
d->ref();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,11 +64,13 @@ MP4::Item::Item(const Item &item) : d(item.d)
|
||||
MP4::Item &
|
||||
MP4::Item::operator=(const Item &item)
|
||||
{
|
||||
if(d->deref()) {
|
||||
delete d;
|
||||
if(&item != this) {
|
||||
if(d->deref()) {
|
||||
delete d;
|
||||
}
|
||||
d = item.d;
|
||||
d->ref();
|
||||
}
|
||||
d = item.d;
|
||||
d->ref();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -917,7 +917,7 @@ PropertyMap MP4::Tag::setProperties(const PropertyMap &props)
|
||||
for(; it != props.end(); ++it) {
|
||||
if(reverseKeyMap.contains(it->first)) {
|
||||
String name = reverseKeyMap[it->first];
|
||||
if(it->first == "TRACKNUMBER" || it->first == "DISCNUMBER") {
|
||||
if((it->first == "TRACKNUMBER" || it->first == "DISCNUMBER") && !it->second.isEmpty()) {
|
||||
int first = 0, second = 0;
|
||||
StringList parts = StringList::split(it->second.front(), "/");
|
||||
if(parts.size() > 0) {
|
||||
@@ -928,11 +928,11 @@ PropertyMap MP4::Tag::setProperties(const PropertyMap &props)
|
||||
d->items[name] = MP4::Item(first, second);
|
||||
}
|
||||
}
|
||||
else if(it->first == "BPM") {
|
||||
else if(it->first == "BPM" && !it->second.isEmpty()) {
|
||||
int value = it->second.front().toInt();
|
||||
d->items[name] = MP4::Item(value);
|
||||
}
|
||||
else if(it->first == "COMPILATION") {
|
||||
else if(it->first == "COMPILATION" && !it->second.isEmpty()) {
|
||||
bool value = (it->second.front().toInt() != 0);
|
||||
d->items[name] = MP4::Item(value);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* conversion happening in the background
|
||||
*/
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
#if defined(QT_VERSION) && (QT_VERSION >= 0x040000)
|
||||
#define QStringToTString(s) TagLib::String(s.toUtf8().data(), TagLib::String::UTF8)
|
||||
#else
|
||||
#define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8)
|
||||
@@ -197,7 +197,8 @@ namespace TagLib {
|
||||
|
||||
/*!
|
||||
* Returns a deep copy of this String as a wstring. The returned string is
|
||||
* encoded in UTF-16 (without BOM/CPU byte order).
|
||||
* encoded in UTF-16 (without BOM/CPU byte order), not UTF-32 even if wchar_t
|
||||
* is 32-bit wide.
|
||||
*
|
||||
* \see toCWString()
|
||||
*/
|
||||
@@ -226,7 +227,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Returns a standard C-style (null-terminated) wide character version of
|
||||
* this String. The returned string is encoded in UTF-16 (without BOM/CPU byte
|
||||
* order).
|
||||
* order), not UTF-32 even if wchar_t is 32-bit wide.
|
||||
*
|
||||
* The returned string is still owned by this String and should not be deleted
|
||||
* by the user.
|
||||
|
||||
@@ -305,6 +305,14 @@ public:
|
||||
CPPUNIT_ASSERT(f.tag()->contains("cpil"));
|
||||
CPPUNIT_ASSERT_EQUAL(false, f.tag()->item("cpil").toBool());
|
||||
CPPUNIT_ASSERT_EQUAL(StringList("0"), tags["COMPILATION"]);
|
||||
|
||||
// Empty properties do not result in access violations
|
||||
// when converting integers
|
||||
tags["TRACKNUMBER"] = StringList();
|
||||
tags["DISCNUMBER"] = StringList();
|
||||
tags["BPM"] = StringList();
|
||||
tags["COMPILATION"] = StringList();
|
||||
f.setProperties(tags);
|
||||
}
|
||||
|
||||
void testFuzzedFile()
|
||||
|
||||
Reference in New Issue
Block a user