reverse 0384b236 and fix saving ID3v2 frames

This commit is contained in:
unK
2008-09-30 21:13:23 +02:00
parent 4adcdf8e23
commit 10e60880a5
2 changed files with 12 additions and 9 deletions

View File

@@ -52,12 +52,14 @@ dnl =======================
dnl = checking for taglib = dnl = checking for taglib =
dnl ======================= dnl =======================
if test "$taglib" = "yes" ; then if test "$taglib" = "yes" ; then
PKG_CHECK_MODULES([taglib], taglib >= 1.5, , AC_MSG_ERROR([TagLib >= 1.5 is required])) AC_PATH_PROG(TAGLIB_CONFIG, taglib-config)
AC_SUBST(taglib_LIBS) if test "$TAGLIB_CONFIG" != "" ; then
AC_SUBST(taglib_CFLAGS) CPPFLAGS="$CPPFLAGS `$TAGLIB_CONFIG --cflags`"
CPPFLAGS="$CPPFLAGS $taglib_CFLAGS" LDFLAGS="$LDFLAGS `$TAGLIB_CONFIG --libs`"
LDFLAGS="$LDFLAGS $taglib_LIBS" AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header]))
AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header])) else
AC_MSG_ERROR([taglib-config executable is missing])
fi
fi fi
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])

View File

@@ -159,12 +159,13 @@ bool WriteTags(Song &s)
{ {
MPEG::File file(path_to_file.c_str()); MPEG::File file(path_to_file.c_str());
ID3v2::Tag *tag = file.ID3v2Tag(); ID3v2::Tag *tag = file.ID3v2Tag();
String::Type encoding = UNICODE ? String::UTF8 : String::Latin1;
ByteVector Composer("TCOM"); ByteVector Composer("TCOM");
ByteVector Performer("TOPE"); ByteVector Performer("TOPE");
ByteVector Disc("TPOS"); ByteVector Disc("TPOS");
ID3v2::Frame *ComposerFrame = new ID3v2::TextIdentificationFrame(Composer); ID3v2::Frame *ComposerFrame = new ID3v2::TextIdentificationFrame(Composer, encoding);
ID3v2::Frame *PerformerFrame = new ID3v2::TextIdentificationFrame(Performer); ID3v2::Frame *PerformerFrame = new ID3v2::TextIdentificationFrame(Performer, encoding);
ID3v2::Frame *DiscFrame = new ID3v2::TextIdentificationFrame(Disc); ID3v2::Frame *DiscFrame = new ID3v2::TextIdentificationFrame(Disc, encoding);
ComposerFrame->setText(TO_WSTRING(s.GetComposer())); ComposerFrame->setText(TO_WSTRING(s.GetComposer()));
PerformerFrame->setText(TO_WSTRING(s.GetPerformer())); PerformerFrame->setText(TO_WSTRING(s.GetPerformer()));
DiscFrame->setText(TO_WSTRING(s.GetDisc())); DiscFrame->setText(TO_WSTRING(s.GetDisc()));