|
|
|
@@ -1,7 +1,21 @@
|
|
|
|
|
diff -dPNur taglib-1.6/config-taglib.h.cmake taglib-1.6-ds/config-taglib.h.cmake
|
|
|
|
|
--- taglib-1.6/config-taglib.h.cmake 2008-11-12 09:17:11.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/config-taglib.h.cmake 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -6,6 +6,8 @@
|
|
|
|
|
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
|
|
|
|
|
index e4a6d1f..324c502 100644
|
|
|
|
|
--- a/ConfigureChecks.cmake
|
|
|
|
|
+++ b/ConfigureChecks.cmake
|
|
|
|
|
@@ -14,6 +14,8 @@ else()
|
|
|
|
|
set(HAVE_ZLIB 0)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
+set(HAVE_LIBRCC 1)
|
|
|
|
|
+
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
|
|
|
|
find_package(CppUnit)
|
|
|
|
|
if(NOT CppUnit_FOUND AND BUILD_TESTS)
|
|
|
|
|
diff --git a/config-taglib.h.cmake b/config-taglib.h.cmake
|
|
|
|
|
index 9c2f487..8e445c7 100644
|
|
|
|
|
--- a/config-taglib.h.cmake
|
|
|
|
|
+++ b/config-taglib.h.cmake
|
|
|
|
|
@@ -3,6 +3,8 @@
|
|
|
|
|
/* Define if you have libz */
|
|
|
|
|
#cmakedefine HAVE_ZLIB 1
|
|
|
|
|
|
|
|
|
@@ -10,42 +24,40 @@ diff -dPNur taglib-1.6/config-taglib.h.cmake taglib-1.6-ds/config-taglib.h.cmake
|
|
|
|
|
#cmakedefine NO_ITUNES_HACKS 1
|
|
|
|
|
#cmakedefine WITH_ASF 1
|
|
|
|
|
#cmakedefine WITH_MP4 1
|
|
|
|
|
diff -dPNur taglib-1.6/ConfigureChecks.cmake taglib-1.6-ds/ConfigureChecks.cmake
|
|
|
|
|
--- taglib-1.6/ConfigureChecks.cmake 2008-12-21 22:46:41.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/ConfigureChecks.cmake 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -14,6 +14,8 @@
|
|
|
|
|
#check for libz using the cmake supplied FindZLIB.cmake
|
|
|
|
|
FIND_PACKAGE(ZLIB)
|
|
|
|
|
|
|
|
|
|
+SET(HAVE_LIBRCC 1)
|
|
|
|
|
+
|
|
|
|
|
IF(ZLIB_FOUND)
|
|
|
|
|
SET(HAVE_ZLIB 1)
|
|
|
|
|
ELSE(ZLIB_FOUND)
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/CMakeLists.txt taglib-1.6-ds/taglib/CMakeLists.txt
|
|
|
|
|
--- taglib-1.6/taglib/CMakeLists.txt 2009-09-13 12:19:34.000000000 +0200
|
|
|
|
|
+++ taglib-1.6-ds/taglib/CMakeLists.txt 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -163,6 +163,7 @@
|
|
|
|
|
diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt
|
|
|
|
|
index 61bcb49..49fbb62 100644
|
|
|
|
|
--- a/taglib/CMakeLists.txt
|
|
|
|
|
+++ b/taglib/CMakeLists.txt
|
|
|
|
|
@@ -35,6 +35,7 @@ set(tag_HDRS
|
|
|
|
|
audioproperties.h
|
|
|
|
|
taglib_export.h
|
|
|
|
|
${CMAKE_BINARY_DIR}/taglib_config.h
|
|
|
|
|
+ toolkit/rccpatch.h
|
|
|
|
|
toolkit/taglib.h
|
|
|
|
|
toolkit/tstring.h
|
|
|
|
|
toolkit/tlist.h
|
|
|
|
|
@@ -269,6 +270,7 @@ set(xm_SRCS
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
SET(toolkit_SRCS
|
|
|
|
|
+toolkit/rccpatch.cpp
|
|
|
|
|
toolkit/tstring.cpp
|
|
|
|
|
toolkit/tstringlist.cpp
|
|
|
|
|
toolkit/tbytevector.cpp
|
|
|
|
|
@@ -190,7 +191,7 @@
|
|
|
|
|
add_library(tag SHARED ${tag_LIB_SRCS})
|
|
|
|
|
endif(ENABLE_STATIC)
|
|
|
|
|
set(toolkit_SRCS
|
|
|
|
|
+ toolkit/rccpatch.cpp
|
|
|
|
|
toolkit/tstring.cpp
|
|
|
|
|
toolkit/tstringlist.cpp
|
|
|
|
|
toolkit/tbytevector.cpp
|
|
|
|
|
@@ -295,6 +297,8 @@ set(tag_LIB_SRCS
|
|
|
|
|
|
|
|
|
|
-TARGET_LINK_LIBRARIES(tag )
|
|
|
|
|
+TARGET_LINK_LIBRARIES(tag rcc)
|
|
|
|
|
add_library(tag ${tag_LIB_SRCS} ${tag_HDRS})
|
|
|
|
|
|
|
|
|
|
+target_link_libraries(tag rcc)
|
|
|
|
|
+
|
|
|
|
|
if(ZLIB_FOUND)
|
|
|
|
|
TARGET_LINK_LIBRARIES(tag ${ZLIB_LIBRARIES})
|
|
|
|
|
endif(ZLIB_FOUND)
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/mpeg/id3v1/id3v1tag.cpp taglib-1.6-ds/taglib/mpeg/id3v1/id3v1tag.cpp
|
|
|
|
|
--- taglib-1.6/taglib/mpeg/id3v1/id3v1tag.cpp 2008-02-04 16:11:56.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/taglib/mpeg/id3v1/id3v1tag.cpp 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -59,17 +59,18 @@
|
|
|
|
|
target_link_libraries(tag ${ZLIB_LIBRARIES})
|
|
|
|
|
endif()
|
|
|
|
|
diff --git a/taglib/mpeg/id3v1/id3v1tag.cpp b/taglib/mpeg/id3v1/id3v1tag.cpp
|
|
|
|
|
index e9eb47b..08650a1 100644
|
|
|
|
|
--- a/taglib/mpeg/id3v1/id3v1tag.cpp
|
|
|
|
|
+++ b/taglib/mpeg/id3v1/id3v1tag.cpp
|
|
|
|
|
@@ -64,17 +64,18 @@ StringHandler::StringHandler()
|
|
|
|
|
|
|
|
|
|
String ID3v1::StringHandler::parse(const ByteVector &data) const
|
|
|
|
|
{
|
|
|
|
@@ -66,7 +78,7 @@ diff -dPNur taglib-1.6/taglib/mpeg/id3v1/id3v1tag.cpp taglib-1.6-ds/taglib/mpeg/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
@@ -240,7 +241,7 @@
|
|
|
|
|
@@ -247,7 +248,7 @@ void ID3v1::Tag::parse(const ByteVector &data)
|
|
|
|
|
d->track = uchar(data[offset + 29]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@@ -75,10 +87,11 @@ diff -dPNur taglib-1.6/taglib/mpeg/id3v1/id3v1tag.cpp taglib-1.6-ds/taglib/mpeg/
|
|
|
|
|
|
|
|
|
|
offset += 30;
|
|
|
|
|
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/mpeg/id3v2/frames/commentsframe.cpp taglib-1.6-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp
|
|
|
|
|
--- taglib-1.6/taglib/mpeg/id3v2/frames/commentsframe.cpp 2008-02-04 16:11:56.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -136,10 +136,10 @@
|
|
|
|
|
diff --git a/taglib/mpeg/id3v2/frames/commentsframe.cpp b/taglib/mpeg/id3v2/frames/commentsframe.cpp
|
|
|
|
|
index deaa9d9..9d0df07 100644
|
|
|
|
|
--- a/taglib/mpeg/id3v2/frames/commentsframe.cpp
|
|
|
|
|
+++ b/taglib/mpeg/id3v2/frames/commentsframe.cpp
|
|
|
|
|
@@ -150,10 +150,10 @@ void CommentsFrame::parseFields(const ByteVector &data)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -91,65 +104,25 @@ diff -dPNur taglib-1.6/taglib/mpeg/id3v2/frames/commentsframe.cpp taglib-1.6-ds/
|
|
|
|
|
|
|
|
|
|
ByteVectorList l = ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2);
|
|
|
|
|
|
|
|
|
|
@@ -155,10 +155,12 @@
|
|
|
|
|
@@ -174,10 +174,12 @@ ByteVector CommentsFrame::renderFields() const
|
|
|
|
|
|
|
|
|
|
String::Type encoding = d->textEncoding;
|
|
|
|
|
|
|
|
|
|
+ encoding = String::ID3WType(encoding);
|
|
|
|
|
+
|
|
|
|
|
encoding = checkEncoding(d->description, encoding);
|
|
|
|
|
encoding = checkEncoding(d->text, encoding);
|
|
|
|
|
-
|
|
|
|
|
encoding = checkTextEncoding(d->description, encoding);
|
|
|
|
|
encoding = checkTextEncoding(d->text, encoding);
|
|
|
|
|
|
|
|
|
|
- v.append(char(encoding));
|
|
|
|
|
+
|
|
|
|
|
+ v.append(char(String::ID3RealType(encoding)));
|
|
|
|
|
v.append(d->language.size() == 3 ? d->language : "XXX");
|
|
|
|
|
v.append(d->description.data(encoding));
|
|
|
|
|
v.append(textDelimiter(encoding));
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/mpeg/id3v2/frames/textidentificationframe.cpp taglib-1.6-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp
|
|
|
|
|
--- taglib-1.6/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2008-02-04 16:11:56.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -105,12 +105,12 @@
|
|
|
|
|
|
|
|
|
|
// read the string data type (the first byte of the field data)
|
|
|
|
|
|
|
|
|
|
- d->textEncoding = String::Type(data[0]);
|
|
|
|
|
+ d->textEncoding = String::ID3Type(data[0]);
|
|
|
|
|
|
|
|
|
|
// split the byte array into chunks based on the string type (two byte delimiter
|
|
|
|
|
// for unicode encodings)
|
|
|
|
|
|
|
|
|
|
- int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
|
|
|
|
|
+ int byteAlign = (d->textEncoding == String::Latin1 || d->textEncoding == String::Latin1ID3 || d->textEncoding == String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2;
|
|
|
|
|
|
|
|
|
|
// build a small counter to strip nulls off the end of the field
|
|
|
|
|
|
|
|
|
|
@@ -139,11 +139,14 @@
|
|
|
|
|
|
|
|
|
|
ByteVector TextIdentificationFrame::renderFields() const
|
|
|
|
|
{
|
|
|
|
|
- String::Type encoding = checkEncoding(d->fieldList, d->textEncoding);
|
|
|
|
|
+ String::Type encoding = d->textEncoding;
|
|
|
|
|
+
|
|
|
|
|
+ encoding = String::ID3WType(encoding);
|
|
|
|
|
+ encoding = checkEncoding(d->fieldList, encoding);
|
|
|
|
|
|
|
|
|
|
ByteVector v;
|
|
|
|
|
|
|
|
|
|
- v.append(char(encoding));
|
|
|
|
|
+ v.append(char(String::ID3RealType(encoding)));
|
|
|
|
|
|
|
|
|
|
for(StringList::ConstIterator it = d->fieldList.begin(); it != d->fieldList.end(); it++) {
|
|
|
|
|
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/toolkit/CMakeLists.txt taglib-1.6-ds/taglib/toolkit/CMakeLists.txt
|
|
|
|
|
--- taglib-1.6/taglib/toolkit/CMakeLists.txt 2006-09-20 14:52:28.000000000 +0200
|
|
|
|
|
+++ taglib-1.6-ds/taglib/toolkit/CMakeLists.txt 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -1 +1 @@
|
|
|
|
|
-INSTALL( FILES taglib.h tstring.h tlist.h tlist.tcc tstringlist.h tbytevector.h tbytevectorlist.h tfile.h tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
|
|
|
|
|
+INSTALL( FILES rccpatch.h taglib.h tstring.h tlist.h tlist.tcc tstringlist.h tbytevector.h tbytevectorlist.h tfile.h tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/rccpatch.cpp
|
|
|
|
|
--- taglib-1.6/taglib/toolkit/rccpatch.cpp 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/taglib/toolkit/rccpatch.cpp 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
diff --git a/taglib/toolkit/rccpatch.cpp b/taglib/toolkit/rccpatch.cpp
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..eadbcb1
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/taglib/toolkit/rccpatch.cpp
|
|
|
|
|
@@ -0,0 +1,198 @@
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
|
+
|
|
|
|
@@ -209,8 +182,8 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+void rccPatchSetContext(void *newctx) {
|
|
|
|
|
+#ifdef HAVE_LIBRCC
|
|
|
|
|
+ if (newctx) {
|
|
|
|
|
+ ctx = (rcc_context)newctx;
|
|
|
|
|
+ rcc_initialized = 1;
|
|
|
|
|
+ ctx = (rcc_context)newctx;
|
|
|
|
|
+ rcc_initialized = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -218,8 +191,8 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+static void rccPatchTryInit() {
|
|
|
|
|
+#ifdef HAVE_LIBRCC
|
|
|
|
|
+ if (!rcc_initialized) {
|
|
|
|
|
+ rccPatchInit();
|
|
|
|
|
+ if (rcc_initialized) atexit(rccPatchFree);
|
|
|
|
|
+ rccPatchInit();
|
|
|
|
|
+ if (rcc_initialized) atexit(rccPatchFree);
|
|
|
|
|
+ }
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -240,7 +213,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ return v;
|
|
|
|
|
+#else
|
|
|
|
|
+ v.setData("", 0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return v;
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -260,7 +233,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ return v;
|
|
|
|
|
+#else
|
|
|
|
|
+ v.setData("", 0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return v;
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -280,7 +253,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ return v;
|
|
|
|
|
+#else
|
|
|
|
|
+ v.setData("", 0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return v;
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -300,7 +273,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ return v;
|
|
|
|
|
+#else
|
|
|
|
|
+ v.setData("", 0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return v;
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+}
|
|
|
|
@@ -311,17 +284,17 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ char charset[32];
|
|
|
|
|
+
|
|
|
|
|
+ rccPatchTryInit();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (!rccLocaleGetCharset(charset, NULL, 31)) {
|
|
|
|
|
+ if (!strncmp(charset, "UTF", 3)) {
|
|
|
|
|
+ len = strlen(charset);
|
|
|
|
|
+
|
|
|
|
|
+ if (charset[len-1]=='8') return TagLib::String::UTF8;
|
|
|
|
|
+ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return TagLib::String::Latin1;
|
|
|
|
|
+ if (!strncmp(charset, "UTF", 3)) {
|
|
|
|
|
+ len = strlen(charset);
|
|
|
|
|
+
|
|
|
|
|
+ if (charset[len-1]=='8') return TagLib::String::UTF8;
|
|
|
|
|
+ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return TagLib::String::Latin1;
|
|
|
|
|
+ }
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+ return TagLib::String::UTF8;
|
|
|
|
@@ -333,25 +306,27 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.cpp taglib-1.6-ds/taglib/toolkit/
|
|
|
|
|
+ const char *charset;
|
|
|
|
|
+
|
|
|
|
|
+ rccPatchTryInit();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ charset = rccGetCurrentCharsetName(ctx, ID3V2_CLASS);
|
|
|
|
|
+ if (charset) {
|
|
|
|
|
+ if (!strncmp(charset, "UTF", 3)) {
|
|
|
|
|
+ len = strlen(charset);
|
|
|
|
|
+
|
|
|
|
|
+ if (charset[len-1]=='8') return TagLib::String::UTF8;
|
|
|
|
|
+ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return TagLib::String::Latin1ID3V2;
|
|
|
|
|
+ if (!strncmp(charset, "UTF", 3)) {
|
|
|
|
|
+ len = strlen(charset);
|
|
|
|
|
+
|
|
|
|
|
+ if (charset[len-1]=='8') return TagLib::String::UTF8;
|
|
|
|
|
+ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
|
|
|
|
|
+ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return TagLib::String::Latin1ID3V2;
|
|
|
|
|
+ }
|
|
|
|
|
+#endif /* HAVE_LIBRCC */
|
|
|
|
|
+ return TagLib::String::Latin1;
|
|
|
|
|
+}
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.h taglib-1.6-ds/taglib/toolkit/rccpatch.h
|
|
|
|
|
--- taglib-1.6/taglib/toolkit/rccpatch.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ taglib-1.6-ds/taglib/toolkit/rccpatch.h 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
diff --git a/taglib/toolkit/rccpatch.h b/taglib/toolkit/rccpatch.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..9484a93
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/taglib/toolkit/rccpatch.h
|
|
|
|
|
@@ -0,0 +1,20 @@
|
|
|
|
|
+#ifndef _RCC_PATCH_H
|
|
|
|
|
+#define _RCC_PATCH_H
|
|
|
|
@@ -373,9 +348,10 @@ diff -dPNur taglib-1.6/taglib/toolkit/rccpatch.h taglib-1.6-ds/taglib/toolkit/rc
|
|
|
|
|
+TagLib::String::Type rccPatchGetID3Type();
|
|
|
|
|
+
|
|
|
|
|
+#endif /* _RCC_PATCH_H */
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/tstring.cpp
|
|
|
|
|
--- taglib-1.6/taglib/toolkit/tstring.cpp 2009-04-29 17:57:05.000000000 +0200
|
|
|
|
|
+++ taglib-1.6-ds/taglib/toolkit/tstring.cpp 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp
|
|
|
|
|
index 292f353..45b7d03 100644
|
|
|
|
|
--- a/taglib/toolkit/tstring.cpp
|
|
|
|
|
+++ b/taglib/toolkit/tstring.cpp
|
|
|
|
|
@@ -23,6 +23,7 @@
|
|
|
|
|
* http://www.mozilla.org/MPL/ *
|
|
|
|
|
***************************************************************************/
|
|
|
|
@@ -384,7 +360,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
#include "tstring.h"
|
|
|
|
|
#include "unicode.h"
|
|
|
|
|
#include "tdebug.h"
|
|
|
|
|
@@ -167,7 +168,7 @@
|
|
|
|
|
@@ -168,7 +169,7 @@ String::String(const ByteVector &v, Type t)
|
|
|
|
|
if(v.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@@ -393,7 +369,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
|
|
|
|
|
int length = 0;
|
|
|
|
|
d->data.resize(v.size());
|
|
|
|
|
@@ -369,10 +370,21 @@
|
|
|
|
|
@@ -397,10 +398,21 @@ ByteVector String::data(Type t) const
|
|
|
|
|
{
|
|
|
|
|
ByteVector v;
|
|
|
|
|
|
|
|
|
@@ -412,11 +388,11 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
+ else /* if (t == Latin1(Locale) */ v = rccPatchRecodeOutput(s);
|
|
|
|
|
+
|
|
|
|
|
+ if (v.size()) return v;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++)
|
|
|
|
|
v.append(char(*it));
|
|
|
|
|
break;
|
|
|
|
|
@@ -707,6 +719,31 @@
|
|
|
|
|
@@ -750,6 +762,31 @@ void String::detach()
|
|
|
|
|
|
|
|
|
|
void String::prepare(Type t)
|
|
|
|
|
{
|
|
|
|
@@ -429,26 +405,26 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
+ if (t == Latin1ID3) v = rccPatchRecodeInputID3(s, false);
|
|
|
|
|
+ else if (t == Latin1ID3V2) v = rccPatchRecodeInputID3(s, true);
|
|
|
|
|
+ else /* Latin1 converted from Locale */ v = rccPatchRecodeInput(s);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (v.size()) {
|
|
|
|
|
+ int length = 0;
|
|
|
|
|
+ d->data.resize(v.size());
|
|
|
|
|
+ wstring::iterator targetIt = d->data.begin();
|
|
|
|
|
+ for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
|
|
|
|
|
+ *targetIt = uchar(*it);
|
|
|
|
|
+ ++targetIt;
|
|
|
|
|
+ ++length;
|
|
|
|
|
+ }
|
|
|
|
|
+ d->data.resize(length);
|
|
|
|
|
+ int length = 0;
|
|
|
|
|
+ d->data.resize(v.size());
|
|
|
|
|
+ wstring::iterator targetIt = d->data.begin();
|
|
|
|
|
+ for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
|
|
|
|
|
+ *targetIt = uchar(*it);
|
|
|
|
|
+ ++targetIt;
|
|
|
|
|
+ ++length;
|
|
|
|
|
+ }
|
|
|
|
|
+ d->data.resize(length);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ t = UTF8;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
switch(t) {
|
|
|
|
|
case UTF16:
|
|
|
|
|
{
|
|
|
|
|
@@ -796,6 +833,27 @@
|
|
|
|
|
@@ -839,6 +876,27 @@ const TagLib::String operator+(const TagLib::String &s1, const char *s2)
|
|
|
|
|
|
|
|
|
|
std::ostream &operator<<(std::ostream &s, const String &str)
|
|
|
|
|
{
|
|
|
|
@@ -459,17 +435,17 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+String::Type String::ID3Type(int i) {
|
|
|
|
|
+ if (i == Latin1) return Latin1ID3V2;
|
|
|
|
|
+ return Type(i);
|
|
|
|
|
+ if (i == Latin1) return Latin1ID3V2;
|
|
|
|
|
+ return Type(i);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+String::Type String::ID3WType(Type type) {
|
|
|
|
|
+ Type rcc_type = rccPatchGetID3Type();
|
|
|
|
|
+ if ((rcc_type == Latin1ID3)||(rcc_type == Latin1ID3V2)) {
|
|
|
|
|
+ if (type == Latin1) return rcc_type;
|
|
|
|
|
+ return type;
|
|
|
|
|
+ if (type == Latin1) return rcc_type;
|
|
|
|
|
+ return type;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return rcc_type;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
@@ -477,10 +453,11 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.cpp taglib-1.6-ds/taglib/toolkit/t
|
|
|
|
|
+ if ((type == Latin1ID3)||(type == Latin1ID3V2)) return Latin1;
|
|
|
|
|
+ return type;
|
|
|
|
|
+}
|
|
|
|
|
diff -dPNur taglib-1.6/taglib/toolkit/tstring.h taglib-1.6-ds/taglib/toolkit/tstring.h
|
|
|
|
|
--- taglib-1.6/taglib/toolkit/tstring.h 2009-07-02 22:54:32.000000000 +0200
|
|
|
|
|
+++ taglib-1.6-ds/taglib/toolkit/tstring.h 2009-10-02 17:53:08.000000000 +0200
|
|
|
|
|
@@ -81,6 +81,18 @@
|
|
|
|
|
diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h
|
|
|
|
|
index 759a175..af38090 100644
|
|
|
|
|
--- a/taglib/toolkit/tstring.h
|
|
|
|
|
+++ b/taglib/toolkit/tstring.h
|
|
|
|
|
@@ -90,6 +90,18 @@ namespace TagLib {
|
|
|
|
|
*/
|
|
|
|
|
enum Type {
|
|
|
|
|
/*!
|
|
|
|
@@ -499,7 +476,7 @@ diff -dPNur taglib-1.6/taglib/toolkit/tstring.h taglib-1.6-ds/taglib/toolkit/tst
|
|
|
|
|
* IS08859-1, or <i>Latin1</i> encoding. 8 bit characters.
|
|
|
|
|
*/
|
|
|
|
|
Latin1 = 0,
|
|
|
|
|
@@ -103,6 +115,10 @@
|
|
|
|
|
@@ -112,6 +124,10 @@ namespace TagLib {
|
|
|
|
|
UTF16LE = 4
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|