changeset 964:bf06569fb0b4 trunk

[svn] Quick n dirty unicode hack pending taglib-1.5. See http://bugs.kde.org/show_bug.cgi?id=126192
author nemo
date Mon, 24 Apr 2006 12:49:51 -0700
parents e42ce60c308f
children dd8347ed9616
files Plugins/Input/mpg123/Makefile.in Plugins/Input/mpg123/fileinfo.c Plugins/Input/mpg123/tag_c_hacked.cpp Plugins/Input/mpg123/tag_c_hacked.h
diffstat 4 files changed, 33 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/mpg123/Makefile.in	Mon Apr 24 12:46:47 2006 -0700
+++ b/Plugins/Input/mpg123/Makefile.in	Mon Apr 24 12:49:51 2006 -0700
@@ -11,8 +11,10 @@
 	tabinit.c equalizer.c http.c \
 	dxhead.c decode.c dct64.c
 
-OBJECTS = ${SOURCES:.c=.o}
+OBJECTS = ${SOURCES:.c=.o} tag_c_hacked.o
 
 CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) $(TAGLIB_CFLAGS) $(ARCH_DEFINES) -I../../../intl -I../../..
 
-LIBADD = -ltag_c $(GTK_LIBS) $(ID3LIBS)
+CXXFLAGS = $(CFLAGS)
+
+LIBADD = -ltag_c $(GTK_LIBS) $(TAGLIB_LIBS)
--- a/Plugins/Input/mpg123/fileinfo.c	Mon Apr 24 12:46:47 2006 -0700
+++ b/Plugins/Input/mpg123/fileinfo.c	Mon Apr 24 12:49:51 2006 -0700
@@ -22,6 +22,7 @@
 #include "mpg123.h"
 
 #include <tag_c.h>
+#include "tag_c_hacked.h"
 
 #include <glib.h>
 #include <glib/gi18n.h>
@@ -117,12 +118,15 @@
   if (str_has_prefix_nocase(current_filename, "http://"))
     return;
 
+  taglib_set_strings_unicode(1);
+
   taglib_file = taglib_file_new(current_filename);
   if(taglib_file) {
     taglib_tag = taglib_file_tag(taglib_file);
     taglib_ap = taglib_file_audioproperties(taglib_file);
   } else return;
 
+  taglib_set_id3v2_default_text_encoding();
   taglib_tag_set_title(taglib_tag, gtk_entry_get_text(GTK_ENTRY(title_entry)));
   taglib_tag_set_artist(taglib_tag, gtk_entry_get_text(GTK_ENTRY(artist_entry)));
   taglib_tag_set_album(taglib_tag, gtk_entry_get_text(GTK_ENTRY(album_entry)));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/Input/mpg123/tag_c_hacked.cpp	Mon Apr 24 12:49:51 2006 -0700
@@ -0,0 +1,14 @@
+#include <taglib/tag.h>
+#include <taglib/id3v2framefactory.h>
+
+extern "C"
+{
+#include "tag_c_hacked.h"
+}
+using namespace TagLib;
+using namespace ID3v2;
+void taglib_set_id3v2_default_text_encoding()
+{
+  TagLib::ID3v2::FrameFactory::instance()->setDefaultTextEncoding(TagLib::String::UTF8);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/Input/mpg123/tag_c_hacked.h	Mon Apr 24 12:49:51 2006 -0700
@@ -0,0 +1,11 @@
+#ifndef TAGLIB_TAG_C_HACKED
+#define TAGLIB_TAG_C_HACKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void taglib_set_id3v2_default_text_encoding();
+#ifdef __cplusplus
+}
+#endif
+#endif