remove id3 support from the plugins
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 28 Sep 2004 00:23:57 +0000 (00:23 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 28 Sep 2004 00:23:57 +0000 (00:23 +0000)
27 files changed:
AUTHORS
README
autogen.sh
configure.in
doc/html/changelog.html
doc/html/documentation.html
doc/html/faq.html
doc/html/format.html
src/plugin_common/Makefile.am
src/plugin_common/Makefile.lite
src/plugin_common/all.h
src/plugin_common/canonical_tag.c
src/plugin_common/canonical_tag.h
src/plugin_common/id3v1.c [deleted file]
src/plugin_common/id3v1.h [deleted file]
src/plugin_common/id3v2.c [deleted file]
src/plugin_common/id3v2.h [deleted file]
src/plugin_common/plugin_common_static.dsp
src/plugin_winamp2/config.c
src/plugin_winamp2/config.h
src/plugin_winamp2/infobox.c
src/plugin_xmms/Makefile.am
src/plugin_xmms/Makefile.lite
src/plugin_xmms/fileinfo.c
src/plugin_xmms/plugin.c
src/plugin_xmms/tag.c [moved from src/plugin_xmms/wrap_id3.c with 97% similarity]
src/plugin_xmms/tag.h [moved from src/plugin_xmms/wrap_id3.h with 92% similarity]

diff --git a/AUTHORS b/AUTHORS
index 15cd597..54771a8 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -31,7 +31,7 @@ Other major contributors and their contributions:
 * AIFF file support, PPC assembly versions of libFLAC routines
 
 "Daisuke Shimamura" <Daisuke_Shimamura@nifty.com>
-* id3 v1/v2 and i18n support in the XMMS plugin
+* i18n support in the XMMS plugin
 
 "X-Fixer" <x-fixer@narod.ru>
 * Configuration system, tag editing, and file info in the Winamp2 plugin
diff --git a/README b/README
index f354513..edfff11 100644 (file)
--- a/README
+++ b/README
@@ -133,7 +133,6 @@ $HOME/.xmms/Plugins, instead of the global XMMS plugin area
 (usually /usr/lib/xmms/Input).
 
 --with-ogg=
---with-id3lib=
 --with-xmms-prefix=
 --with-libiconv-prefix=
 Use these if you have these packages but configure can't find them.
index a66f682..e3abe1f 100755 (executable)
@@ -11,7 +11,7 @@
 # - libtool 1.5.6
 #
 # You may need to specify -I /SOME_PATH/share/aclocal if the packages
-# FLAC relies on (autotools, libogg, libiconv, libid3) are installed in
+# FLAC relies on (autotools, libogg, libiconv) are installed in
 # non-standard places.
 #
 # If you don't have XMMS installed at all, you should comment out
index 2ecf9a2..f8288f4 100644 (file)
@@ -25,117 +25,6 @@ AM_INIT_AUTOMAKE(flac, 1.1.1)
 # explicitly requested.  Eases autobuilding -mdz
 AM_MAINTAINER_MODE
 
-# Function to configure paths for id3lib; search for 'meat' to get to the end.
-# adapted from ogg.m4
-# This is here until id3lib comes with an equivalent.
-# It is inline with configure.in instead of a separate file as a courtesy to users unaware of the -I flag to aclocal
-dnl LOCAL__PATH_ID3LIB([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libid3, and define ID3LIB_CFLAGS and ID3LIB_LIBS
-dnl
-AC_DEFUN([LOCAL__PATH_ID3LIB],
-[dnl
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(id3lib,[  --with-id3lib=PFX   Prefix where libid3 is installed (optional)], id3lib_prefix="$withval", id3lib_prefix="")
-AC_ARG_WITH(id3lib-libraries,[  --with-id3lib-libraries=DIR   Directory where libid3 library is installed (optional)], id3lib_libraries="$withval", id3lib_libraries="")
-AC_ARG_WITH(id3lib-includes,[  --with-id3lib-includes=DIR   Directory where libid3 header files are installed (optional)], id3lib_includes="$withval", id3lib_includes="")
-AC_ARG_ENABLE(id3libtest, [  --disable-id3libtest       Do not try to compile and run a test id3lib program],, enable_id3libtest=yes)
-
-       if test "x$id3lib_libraries" != "x" ; then
-               ID3LIB_LIBS="-L$id3lib_libraries"
-       elif test "x$id3lib_prefix" != "x" ; then
-               ID3LIB_LIBS="-L$id3lib_prefix/lib"
-       elif test "x$prefix" != "xNONE" ; then
-               ID3LIB_LIBS="-L$libdir"
-       fi
-
-       ID3LIB_LIBS="$ID3LIB_LIBS -lid3"
-
-       if test "x$id3lib_includes" != "x" ; then
-               ID3LIB_CFLAGS="-I$id3lib_includes"
-       elif test "x$id3lib_prefix" != "x" ; then
-               ID3LIB_CFLAGS="-I$id3lib_prefix/include"
-       elif test "$prefix" != "xNONE"; then
-               ID3LIB_CFLAGS="-I$prefix/include"
-       fi
-
-       AC_MSG_CHECKING(for id3lib)
-
-
-       if test "x$enable_id3libtest" = "xyes" ; then
-               id3lib_found=""
-       else
-               id3lib_found="yes"
-       fi
-       dnl There is some confusion over what libraries libid3 needs
-       dnl so we must be pessimistic and try all permutations:
-       dnl "-lid3" "-lid3 -lstdc++" "-lid3 -lz" "-lid3 -lz -lstdc++"
-       for xtra_stdcpp in "" " -lstdc++" ; do
-               for xtra_z in "" " -lz" ; do
-                       if test "x$id3lib_found" = "x" ; then
-                               ac_save_CFLAGS="$CFLAGS"
-                               ac_save_LIBS="$LIBS"
-                               CFLAGS="$CFLAGS $ID3LIB_CFLAGS"
-                               LIBS="$LIBS $ID3LIB_LIBS$xtra_stdcpp$xtra_z"
-                               rm -f conf.id3libtest
-                               AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <id3.h>
-int main () { system("touch conf.id3libtest"); return 0; }
-], id3lib_found=yes,,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-                               CFLAGS="$ac_save_CFLAGS"
-                               LIBS="$ac_save_LIBS"
-                       fi
-                       if test "x$id3lib_found" = "xyes" ; then
-                               ID3LIB_LIBS="$ID3LIB_LIBS$xtra_stdcpp$xtra_z"
-                       fi
-               done
-       done
-
-       if test "x$id3lib_found" = "xyes" ; then
-               AC_MSG_RESULT(yes)
-               ifelse([$1], , :, [$1])
-       else
-               AC_MSG_RESULT(no)
-               if test -f conf.id3libtest ; then
-                       :
-               else
-                       echo "*** Could not run id3lib test program, checking why..."
-                       CFLAGS="$CFLAGS $ID3LIB_CFLAGS"
-                       LIBS="$LIBS $ID3LIB_LIBS"
-                       AC_TRY_LINK([
-#include <stdio.h>
-#include <id3.h>
-],     [ return 0; ],
-                       [ echo "*** The test program compiled, but did not run. This usually means"
-                       echo "*** that the run-time linker is not finding id3lib or finding the wrong"
-                       echo "*** version of id3lib. If it is not finding id3lib, you'll need to set your"
-                       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-                       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-                       echo "*** is required on your system"
-                       echo "***"
-                       echo "*** If you have an old version installed, it is best to remove it, although"
-                       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-                       [ echo "*** The test program failed to compile or link. See the file config.log for the"
-                       echo "*** exact error that occured. This usually means id3lib was incorrectly installed"
-                       echo "*** or that you have moved id3lib since it was installed." ])
-                       CFLAGS="$ac_save_CFLAGS"
-                       LIBS="$ac_save_LIBS"
-               fi
-               ID3LIB_CFLAGS=""
-               ID3LIB_LIBS=""
-               ifelse([$2], , :, [$2])
-       fi
-       AC_SUBST(ID3LIB_CFLAGS)
-       AC_SUBST(ID3LIB_LIBS)
-       rm -f conf.id3libtest
-])
-
-
-dnl Now the meat of configure.in:
-
 # We need two libtools, one that builds both shared and static, and
 # one that builds only static.  This is because the resulting libtool
 # does not allow us to choose which to build at runtime.
@@ -274,43 +163,6 @@ dnl check for i18n(internationalization); these are from libiconv/gettext
 AM_ICONV
 AM_LANGINFO_CODESET
 
-dnl check for id3lib library
-dnl LOCAL__PATH_ID3LIB is defined by us, and will be until such time as id3lib supplies one
-LOCAL__PATH_ID3LIB(have_id3lib=yes, AC_MSG_WARN([*** id3lib not found - id3v2 support will not be built]))
-AM_CONDITIONAL(FLaC__HAS_ID3LIB, [test x$have_id3lib = xyes])
-if test x$have_id3lib = xyes ; then
-AC_DEFINE(FLAC__HAS_ID3LIB)
-
-dnl expected id3lib version for cross compiling
-ID3LIB_MAJOR=3
-ID3LIB_MINOR=8
-ID3LIB_PATCH=0
-
-CFLAGS_save_blah_blah_blah=$CFLAGS
-CFLAGS="$ID3LIB_CFLAGS $CFLAGS"
-LIBS_save_blah_blah_blah=$LIBS
-LIBS="$ID3LIB_LIBS $LIBS"
-AC_MSG_CHECKING(for id3lib version)
-      AC_TRY_RUN([
-#include <id3.h>
-#include <stdio.h>
-int
-main ()
-{
-       FILE *output;
-       output=fopen("conftest.id3","w");
-       fprintf(output,"ID3LIB_MAJOR=%d\nID3LIB_MINOR=%d\nID3LIB_PATCH=%d\n",ID3LIB_MAJOR_VERSION,ID3LIB_MINOR_VERSION,ID3LIB_PATCH_VERSION);
-       fclose(output);
-       exit(0);
-}
-], . ./conftest.id3; echo "${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH}", AC_MSG_WARN(could not determine id3lib version),[echo $ac_n "cross compiling; assuming ${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH} $ac_c"])
-AC_DEFINE_UNQUOTED(ID3LIB_MAJOR, $ID3LIB_MAJOR)
-AC_DEFINE_UNQUOTED(ID3LIB_MINOR, $ID3LIB_MINOR)
-AC_DEFINE_UNQUOTED(ID3LIB_PATCH, $ID3LIB_PATCH)
-CFLAGS=$CFLAGS_save_blah_blah_blah
-LIBS=$LIBS_save_blah_blah_blah
-fi
-
 AC_CHECK_PROGS(DOXYGEN, doxygen)
 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
 if test -n "$DOXYGEN" ; then
@@ -350,16 +202,12 @@ AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS,  [define to run even more tests])
 AH_TEMPLATE(FLAC__VALGRIND_TESTING,  [define to enable use of Valgrind in testers])
 AH_TEMPLATE(FLAC__HAS_DOXYGEN,  [define if you have Doxygen])
 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN,  [define if you have docbook-to-man or docbook2man])
-AH_TEMPLATE(FLAC__HAS_ID3LIB,  [define if you have the id3lib library])
 AH_TEMPLATE(FLAC__HAS_NASM,  [define if you have the NASM assembler])
 AH_TEMPLATE(FLAC__HAS_OGG,  [define if you have the ogg library])
 AH_TEMPLATE(FLAC__NO_ASM,  [define to disable use of assembly code])
 AH_TEMPLATE(FLAC__SSE_OS,  [define if your operating system supports SSE instructions])
 AH_TEMPLATE(FLAC__USE_3DNOW,  [define to enable use of 3Dnow! instructions])
 AH_TEMPLATE(FLAC__USE_ALTIVEC,  [define to enable use of Altivec instructions])
-AH_TEMPLATE(ID3LIB_MAJOR,  [define to major version number of id3lib])
-AH_TEMPLATE(ID3LIB_MINOR,  [define to minor version number of id3lib])
-AH_TEMPLATE(ID3LIB_PATCH,  [define to patch level of id3lib])
 
 AC_OUTPUT( \
        Makefile \
index bc9100f..3b5cf76 100644 (file)
                                <LI>Speed optimization in ReplayGain synthesis.</LI>
                                <LI>Speed optimization in XMMS playback.</LI>
                                <LI>Support for big-endian architectures in XMMS plugin.</LI>
+                               <LI>Removed support for ID3 tags.</LI>
                                <LI>Bug fix: make hard limiter default to off in XMMS plugin.</LI>
                                <LI>Bug fix: stream length calculation bug in XMMS plugin, debian bug #200435; <A HREF="http://sourceforge.net/mailarchive/forum.php?thread_id=2733072&forum_id=6312">see also</A>.</LI>
                                <LI>Bug fix: small memory leak in XMMS plugin.</LI>
index 100338d..bbdd204 100644 (file)
                <B>MISCELLANEOUS</B>
        </P>
        <P>
-               In order to support come common types of metadata, the reference decoder knows how to skip <A HREF="http://www.id3.org/">ID3v1 and ID3v2 tags</A>.  Note however that the FLAC specification does not require compliant implementations to support ID3 in any form.  The XMMS and Winamp plugins support them out of convenience but other applications need not.
+               As a convenience, the reference decoder knows how to skip <A HREF="http://www.id3.org/">ID3v1 and ID3v2 tags</A>.  Note however that the FLAC specification does not require compliant implementations to support ID3 in any form and their use is discouraged.
        </P>
        <P>
                <B><TT>flac</TT></B> has a verify option <TT>-V</TT> that verifies the output while encoding.  With this option, a decoder is run in parallel to the encoder and its output is compared against the original input.  If a difference is found <B><TT>flac</TT></B> will stop with an error.
index 9c8fb19..e522580 100644 (file)
                FLAC has it's own native tagging system which is identical to that of Vorbis.  They are called alternately "FLAC tags" and "Vorbis comments".  It is the only tagging system required and guaranteed to be supported by FLAC implementations.
        </P>
        <P>
-               Out of convenience, some plugins and implementations allow and also read other kinds of tags.  For example, the official FLAC Winamp and XMMS plugins can also read ID3 v1 and v2 tags in addition to FLAC tags.  The reference decoder knows how to skip ID3 tags so that they don't interfere with decoding.  But you should not expect any tags beside FLAC tags to be supported in all applications; some implementations may not even be able to decode a FLAC file with ID3 tags.
+               Out of convenience, the reference decoder knows how to skip ID3 tags so that they don't interfere with decoding.  But you should not expect any tags beside FLAC tags to be supported in applications; some implementations may not even be able to decode a FLAC file with ID3 tags.
        </P>
        <P>
                <A NAME="general__software"><B>What software support FLAC?</B></A>
index 8a7d6aa..4265e35 100644 (file)
                All numbers used in a FLAC bitstream are integers; there are no floating-point representations.  All numbers are big-endian coded.  All numbers are unsigned unless otherwise specified.
        </P>
        <P>
-               A FLAC bitstream may be appended with ID3V1 data or prepended with ID3V2 data.  FLAC has no knowledge of such data, but the reference decoder knows how to skip an ID3 tag.</A>
-       </P>
-       <P>
                Before the formal description of the stream, an overview might be helpful.
        </P>
        <UL>
index 4d5e9ac..615d174 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include @ID3LIB_CFLAGS@
+INCLUDES = -I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libplugin_common.la
 
@@ -12,8 +12,6 @@ noinst_HEADERS = \
        charset.h \
        defs.h \
        dither.h \
-       id3v1.h \
-       id3v2.h \
        locale_hack.h \
        vorbiscomment.h
 
@@ -21,8 +19,6 @@ libplugin_common_la_SOURCES = \
        canonical_tag.c \
        charset.c \
        dither.c \
-       id3v1.c \
-       id3v2.c \
        vorbiscomment.c
 
 EXTRA_DIST = \
index 2b6c7ca..7972bcd 100644 (file)
@@ -6,14 +6,12 @@ topdir = ../..
 
 LIB_NAME = libplugin_common
 INCLUDES = -I$(topdir)/include -I$(HOME)/local/include
-DEFINES  = -DFLAC__HAS_ID3LIB -DID3LIB_MAJOR=3 -DID3LIB_MINOR=8 -DID3LIB_PATCH=0
+DEFINES  = 
 
 SRCS_C = \
        canonical_tag.c \
        charset.c \
        dither.c \
-       id3v1.c \
-       id3v2.c \
        vorbiscomment.c
 
 include $(topdir)/build/lib.mk
index 303b8da..503736c 100644 (file)
@@ -22,8 +22,6 @@
 #include "canonical_tag.h"
 #include "charset.h"
 #include "dither.h"
-#include "id3v1.h"
-#include "id3v2.h"
 #include "locale_hack.h"
 #include "vorbiscomment.h"
 
index 65a1f42..bf1b06f 100644 (file)
@@ -22,9 +22,9 @@
 \r
 #include <stdlib.h>\r
 #include <stdio.h>\r
+#include <string.h> /* for strlen() and memcpy() */\r
 \r
 #include "canonical_tag.h"\r
-#include "id3v2.h"\r
 #include "vorbiscomment.h"\r
 #include "FLAC/assert.h"\r
 #include "FLAC/metadata.h"\r
@@ -151,38 +151,6 @@ weak_alias (__wcscasecmp, wcscasecmp)
 #endif\r
 #endif\r
 \r
-#ifndef _MSC_VER\r
-/* @@@ cheesy and does base 10 only */\r
-wchar_t *local__itow(int value, wchar_t *string)\r
-{\r
-       if (value == 0) {\r
-               string[0] = (wchar_t)'0';\r
-               string[1] = (wchar_t)0;\r
-       }\r
-       else {\r
-               /* convert backwards, then reverse string */\r
-               wchar_t *start = string, *s;\r
-               if (value < 0) {\r
-                       *start++ = (wchar_t)'-';\r
-                       value = -value; /* @@@ overflow at INT_MIN */\r
-               }\r
-               s = start;\r
-               while (value > 0) {\r
-                       *s++ = (wchar_t)((value % 10) + '0');\r
-                       value /= 10;\r
-               }\r
-               *s-- = (wchar_t)0;\r
-               while (s > start) {\r
-                       wchar_t tmp = *s;\r
-                       *s-- = *start;\r
-                       *start++ = tmp;\r
-               }\r
-       }\r
-\r
-       return string;\r
-}\r
-#endif\r
-\r
 /*\r
  *  helpers\r
  */\r
@@ -611,133 +579,7 @@ void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, const FLA
        }\r
 }\r
 \r
-static wchar_t *local__copy_field(const char *src, unsigned n)\r
-{\r
-       const char *p = src + n;\r
-       wchar_t *dest;\r
-       FLAC__ASSERT(n > 0);\r
-\r
-       while (p>src && *(--p)==' ');\r
-\r
-       n = p - src + 1;\r
-       if (!n) return NULL;\r
-\r
-       if ((dest = malloc((n+1)*sizeof(wchar_t))) != 0)\r
-       {\r
-               mbstowcs(dest, src, n);\r
-               dest[n] = 0;\r
-       }\r
-       return dest;\r
-}\r
-\r
-static void local__add_id3_field(FLAC_Plugin__CanonicalTag *object, const char *value, size_t length, const wchar_t *new_name)\r
-{\r
-       wchar_t *tmp;\r
-       if (0 != value && length > 0) {\r
-               tmp = local__copy_field(value, length);\r
-               if (tmp)\r
-                       FLAC_plugin__canonical_add_tail(object, wcsdup(new_name), tmp);\r
-       }\r
-}\r
-\r
-void FLAC_plugin__canonical_tag_convert_from_id3v1(FLAC_Plugin__CanonicalTag *object, const FLAC_Plugin__Id3v1_Tag *id3v1_tag)\r
-{\r
-       wchar_t *tmp;\r
-       FLAC_plugin__canonical_tag_clear(object);\r
-\r
-       local__add_id3_field(object, id3v1_tag->title, 30, L"TITLE");\r
-       local__add_id3_field(object, id3v1_tag->artist, 30, L"ARTIST");\r
-       local__add_id3_field(object, id3v1_tag->album, 30, L"ALBUM");\r
-       local__add_id3_field(object, id3v1_tag->year, 4, L"YEAR");\r
-\r
-       /* check for v1.1 tags */\r
-       if (id3v1_tag->zero == 0)\r
-       {\r
-               if (id3v1_tag->track && (tmp=(wchar_t*)malloc(sizeof(id3v1_tag->track)*4*sizeof(wchar_t)))!=0)\r
-               {\r
-#ifdef _MSC_VER\r
-                       _itow(id3v1_tag->track, tmp, 10);\r
-#else\r
-                       local__itow(id3v1_tag->track, tmp);\r
-#endif\r
-                       FLAC_plugin__canonical_add_tail(object, wcsdup(L"TRACKNUMBER"), tmp);\r
-               }\r
-               local__add_id3_field(object, id3v1_tag->comment, 28, L"DESCRIPTION");\r
-       }\r
-       else\r
-       {\r
-               local__add_id3_field(object, id3v1_tag->comment, 30, L"DESCRIPTION");\r
-       }\r
-\r
-       tmp = FLAC_plugin__convert_ansi_to_wide(FLAC_plugin__id3v1_tag_get_genre_as_string(id3v1_tag->genre));\r
-       if (tmp) FLAC_plugin__canonical_add_tail(object, wcsdup(L"GENRE"), tmp);\r
-}\r
-\r
-void FLAC_plugin__canonical_tag_convert_from_id3v2(FLAC_Plugin__CanonicalTag *object, const FLAC_Plugin__Id3v2_Tag *id3v2_tag)\r
-{\r
-       FLAC_plugin__canonical_tag_clear(object);\r
-\r
-       local__add_id3_field(object, id3v2_tag->title          , strlen(id3v2_tag->title)          , L"TITLE");\r
-       local__add_id3_field(object, id3v2_tag->composer       , strlen(id3v2_tag->composer)       , L"ARTIST");\r
-       local__add_id3_field(object, id3v2_tag->performer      , strlen(id3v2_tag->performer)      , L"PERFORMER");\r
-       local__add_id3_field(object, id3v2_tag->album          , strlen(id3v2_tag->album)          , L"ALBUM");\r
-       local__add_id3_field(object, id3v2_tag->year_recorded  , strlen(id3v2_tag->year_recorded)  , L"YEAR_RECORDED");\r
-       local__add_id3_field(object, id3v2_tag->year_performed , strlen(id3v2_tag->year_performed) , L"YEAR_PERFORMED");\r
-       local__add_id3_field(object, id3v2_tag->track_number   , strlen(id3v2_tag->track_number)   , L"TRACKNUMBER");\r
-       local__add_id3_field(object, id3v2_tag->tracks_in_album, strlen(id3v2_tag->tracks_in_album), L"TRACKS_IN_ALBUM");\r
-       local__add_id3_field(object, id3v2_tag->genre          , strlen(id3v2_tag->genre)          , L"GENRE");\r
-       local__add_id3_field(object, id3v2_tag->comment        , strlen(id3v2_tag->comment)        , L"DESCRIPTION");\r
-}\r
-\r
-static FLAC__bool local__get_id3v1_tag_as_canonical(const char *filename, FLAC_Plugin__CanonicalTag *tag)\r
-{\r
-       FLAC_Plugin__Id3v1_Tag id3v1_tag;\r
-\r
-       if (FLAC_plugin__id3v1_tag_get(filename, &id3v1_tag))\r
-       {\r
-               FLAC_plugin__canonical_tag_convert_from_id3v1(tag, &id3v1_tag);\r
-               return true;\r
-       }\r
-       return false;\r
-}\r
-\r
-static FLAC__bool local__get_id3v2_tag_as_canonical(const char *filename, FLAC_Plugin__CanonicalTag *tag)\r
-{\r
-       FLAC_Plugin__Id3v2_Tag id3v2_tag;\r
-\r
-       if (FLAC_plugin__id3v2_tag_get(filename, &id3v2_tag))\r
-       {\r
-               FLAC_plugin__canonical_tag_convert_from_id3v2(tag, &id3v2_tag);\r
-               return true;\r
-       }\r
-       return false;\r
-}\r
-\r
-void FLAC_plugin__canonical_tag_add_id3v1(const char *filename, FLAC_Plugin__CanonicalTag *tag)\r
-{\r
-       FLAC_Plugin__CanonicalTag id3v1_tag;\r
-\r
-       FLAC_plugin__canonical_tag_init(&id3v1_tag);\r
-       (void)local__get_id3v1_tag_as_canonical(filename, &id3v1_tag);\r
-       FLAC_plugin__canonical_tag_merge(tag, &id3v1_tag);\r
-\r
-       FLAC_plugin__canonical_tag_clear(&id3v1_tag);\r
-}\r
-\r
-void FLAC_plugin__canonical_tag_add_id3v2(const char *filename, FLAC_Plugin__CanonicalTag *tag)\r
-{\r
-       FLAC_Plugin__CanonicalTag id3v2_tag;\r
-\r
-       FLAC_plugin__canonical_tag_init(&id3v2_tag);\r
-       (void)local__get_id3v2_tag_as_canonical(filename, &id3v2_tag);\r
-       FLAC_plugin__canonical_tag_merge(tag, &id3v2_tag);\r
-\r
-       FLAC_plugin__canonical_tag_clear(&id3v2_tag);\r
-}\r
-\r
 void FLAC_plugin__canonical_tag_get_combined(const char *filename, FLAC_Plugin__CanonicalTag *tag, const char *sep)\r
 {\r
        FLAC_plugin__vorbiscomment_get(filename, tag, sep);\r
-       FLAC_plugin__canonical_tag_add_id3v2(filename, tag);\r
-       FLAC_plugin__canonical_tag_add_id3v1(filename, tag);\r
 }\r
index 5aa6bab..f792537 100644 (file)
@@ -19,8 +19,7 @@
 #ifndef FLAC__PLUGIN_COMMON__CANONICAL_TAG_H\r
 #define FLAC__PLUGIN_COMMON__CANONICAL_TAG_H\r
 \r
-#include "id3v1.h"\r
-#include "id3v2.h"\r
+#include "FLAC/ordinals.h"\r
 \r
 /* TODO: splay tree? */\r
 typedef struct tagFLAC__tag_entry FLAC__tag_entry;\r
@@ -80,20 +79,6 @@ wchar_t *FLAC_plugin__canonical_get_value(FLAC__tag_iterator it);
 char *FLAC_plugin__canonical_get_formatted(FLAC__tag_iterator it);\r
 \r
 void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, const FLAC_Plugin__CanonicalTag *src);\r
-void FLAC_plugin__canonical_tag_convert_from_id3v1(FLAC_Plugin__CanonicalTag *, const FLAC_Plugin__Id3v1_Tag *);\r
-void FLAC_plugin__canonical_tag_convert_from_id3v2(FLAC_Plugin__CanonicalTag *, const FLAC_Plugin__Id3v2_Tag *);\r
-\r
-void FLAC_plugin__canonical_tag_add_id3v1(const char *filename, FLAC_Plugin__CanonicalTag *tag);\r
-void FLAC_plugin__canonical_tag_add_id3v2(const char *filename, FLAC_Plugin__CanonicalTag *tag);\r
-\r
-/* Returns a merged tag based on any Vorbis comments, id3v2 tag, and id3v1.\r
- * In case of overlaps the preceding precedence applies.\r
- *\r
- * sep - separator to use when merging fields with same name (in VorbisComment).\r
- * should be in UTF-8. if sep==NULL, no merging occurs, so multiple fields\r
- * with the same name can exist.\r
- */\r
-void FLAC_plugin__canonical_tag_get_combined(const char *filename, FLAC_Plugin__CanonicalTag *tag, const char *sep);\r
 \r
 /* helpers */\r
 wchar_t *FLAC_plugin__convert_ansi_to_wide(const char *src);\r
diff --git a/src/plugin_common/id3v1.c b/src/plugin_common/id3v1.c
deleted file mode 100644 (file)
index 274cc9b..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/* plugin_common - Routines common to several plugins\r
- * Copyright (C) 2002,2003,2004  Josh Coalson\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
- */\r
-\r
-#include <stdio.h>\r
-\r
-#include "FLAC/assert.h"\r
-#include "id3v1.h"\r
-#include "locale_hack.h"\r
-\r
-\r
-/*\r
- * Do not sort genres!!\r
- * Last Update: 2000/04/30\r
- */\r
-static const char * const FLAC_plugin__id3v1_tag_genre_table[] =\r
-{\r
-       "Blues",                /* 0 */\r
-       "Classic Rock",\r
-       "Country",\r
-       "Dance",\r
-       "Disco",\r
-       "Funk",                 /* 5 */\r
-       "Grunge",\r
-       "Hip-Hop",\r
-       "Jazz",\r
-       "Metal",\r
-       "New Age",              /* 10 */                \r
-       "Oldies",\r
-       "Other",\r
-       "Pop",\r
-       "R&B",\r
-       "Rap",                  /* 15 */\r
-       "Reggae",\r
-       "Rock",\r
-       "Techno",\r
-       "Industrial",\r
-       "Alternative",          /* 20 */\r
-       "Ska",\r
-       "Death Metal",\r
-       "Pranks",\r
-       "Soundtrack",\r
-       "Euro-Techno",          /* 25 */\r
-       "Ambient",\r
-       "Trip-Hop",\r
-       "Vocal",\r
-       "Jazz+Funk",\r
-       "Fusion",               /* 30 */\r
-       "Trance",\r
-       "Classical",\r
-       "Instrumental",\r
-       "Acid",\r
-       "House",                /* 35 */\r
-       "Game",\r
-       "Sound Clip",\r
-       "Gospel",\r
-       "Noise",\r
-       "Altern Rock",          /* 40 */\r
-       "Bass",\r
-       "Soul",\r
-       "Punk",\r
-       "Space",\r
-       "Meditative",           /* 45 */\r
-       "Instrumental Pop",\r
-       "Instrumental Rock",\r
-       "Ethnic",\r
-       "Gothic",\r
-       "Darkwave",             /* 50 */\r
-       "Techno-Industrial",\r
-       "Electronic",\r
-       "Pop-Folk",\r
-       "Eurodance",\r
-       "Dream",                /* 55 */\r
-       "Southern Rock",\r
-       "Comedy",\r
-       "Cult",\r
-       "Gangsta",\r
-       "Top 40",               /* 60 */\r
-       "Christian Rap",\r
-       "Pop/Funk",\r
-       "Jungle",\r
-       "Native American",\r
-       "Cabaret",              /* 65 */\r
-       "New Wave",\r
-       "Psychadelic",\r
-       "Rave",\r
-       "Showtunes",\r
-       "Trailer",              /* 70 */\r
-       "Lo-Fi",\r
-       "Tribal",\r
-       "Acid Punk",\r
-       "Acid Jazz",\r
-       "Polka",                /* 75 */\r
-       "Retro",\r
-       "Musical",\r
-       "Rock & Roll",\r
-       "Hard Rock",\r
-       "Folk",                 /* 80 */\r
-       "Folk/Rock",\r
-       "National Folk",\r
-       "Fast Fusion",\r
-       "Swing",\r
-       "Bebob",                /* 85 */\r
-       "Latin",\r
-       "Revival",\r
-       "Celtic",\r
-       "Bluegrass",\r
-       "Avantgarde",           /* 90 */\r
-       "Gothic Rock",\r
-       "Progressive Rock",\r
-       "Psychedelic Rock",\r
-       "Symphonic Rock",\r
-       "Slow Rock",            /* 95 */\r
-       "Big Band",\r
-       "Chorus",\r
-       "Easy Listening",\r
-       "Acoustic",\r
-       "Humour",               /* 100 */\r
-       "Speech",\r
-       "Chanson",\r
-       "Opera",\r
-       "Chamber Music",\r
-       "Sonata",               /* 105 */\r
-       "Symphony",\r
-       "Booty Bass",\r
-       "Primus",\r
-       "Porn Groove",\r
-       "Satire",               /* 110 */\r
-       "Slow Jam",\r
-       "Club",\r
-       "Tango",\r
-       "Samba",\r
-       "Folklore",             /* 115 */\r
-       "Ballad",\r
-       "Power Ballad",\r
-       "Rhythmic Soul",\r
-       "Freestyle",\r
-       "Duet",                 /* 120 */\r
-       "Punk Rock",\r
-       "Drum Solo",\r
-       "A Capella",\r
-       "Euro-House",\r
-       "Dance Hall",           /* 125 */\r
-       "Goa",\r
-       "Drum & Bass",\r
-       "Club-House",\r
-       "Hardcore",\r
-       "Terror",               /* 130 */\r
-       "Indie",\r
-       "BritPop",\r
-       "Negerpunk",\r
-       "Polsk Punk",\r
-       "Beat",                 /* 135 */\r
-       "Christian Gangsta Rap",\r
-       "Heavy Metal",\r
-       "Black Metal",\r
-       "Crossover",\r
-       "Contemporary Christian",/* 140 */\r
-       "Christian Rock",\r
-       "Merengue",\r
-       "Salsa",\r
-       "Thrash Metal",\r
-       "Anime",                /* 145 */\r
-       "JPop",\r
-       "Synthpop"\r
-};\r
-\r
-\r
-FLAC__bool FLAC_plugin__id3v1_tag_get(const char *filename, FLAC_Plugin__Id3v1_Tag *tag)\r
-{\r
-       FILE *f;\r
-       int res;\r
-\r
-       FLAC__ASSERT(0 != filename);\r
-       FLAC__ASSERT(0 != tag);\r
-\r
-       memset(tag, 0, sizeof(FLAC_Plugin__Id3v1_Tag));\r
-\r
-       if(0 == (f = fopen(filename, "rb")))\r
-               return false;\r
-       if(-1 == fseek(f, -128, SEEK_END)) {\r
-               fclose(f);\r
-               return false;\r
-       }\r
-       res = fread(tag, 128, 1, f);\r
-       fclose(f);\r
-       return res==1 && !strncmp(tag->tag, "TAG", 3);\r
-}\r
-\r
-const char *FLAC_plugin__id3v1_tag_get_genre_as_string(unsigned char genre_code)\r
-{\r
-       if (genre_code < (sizeof(FLAC_plugin__id3v1_tag_genre_table)/sizeof(FLAC_plugin__id3v1_tag_genre_table[0])))\r
-               return gettext(FLAC_plugin__id3v1_tag_genre_table[genre_code]);\r
-       return "Unknown";\r
-}\r
-\r
-unsigned FLAC_plugin__id3v1_tag_genre_table_max()\r
-{\r
-       return sizeof(FLAC_plugin__id3v1_tag_genre_table) / sizeof(FLAC_plugin__id3v1_tag_genre_table[0]) - 1;\r
-}\r
diff --git a/src/plugin_common/id3v1.h b/src/plugin_common/id3v1.h
deleted file mode 100644 (file)
index c2638cf..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* plugin_common - Routines common to several plugins
- * Copyright (C) 2002,2003,2004  Josh Coalson
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef FLAC__PLUGIN_COMMON__ID3V1_H
-#define FLAC__PLUGIN_COMMON__ID3V1_H
-
-#include <string.h>
-
-#include "FLAC/ordinals.h"
-
-#pragma pack(push, 1)
-
-typedef struct {
-       char tag[3];
-       char title[30];
-       char artist[30];
-       char album[30];
-       char year[4];
-       /* always use layout of id3 v1.1 */
-       char comment[28];
-       char zero;
-       unsigned char track;
-       unsigned char genre;
-} FLAC_Plugin__Id3v1_Tag;
-
-#pragma pack(pop)
-
-FLAC__bool FLAC_plugin__id3v1_tag_get(const char *filename, FLAC_Plugin__Id3v1_Tag *tag);
-
-
-#define FLAC_PLUGIN__ID3V1_TAG_INVALID_GENRE 255
-
-const char *FLAC_plugin__id3v1_tag_get_genre_as_string(unsigned char genre_code);
-unsigned FLAC_plugin__id3v1_tag_genre_table_max();
-
-#endif
diff --git a/src/plugin_common/id3v2.c b/src/plugin_common/id3v2.c
deleted file mode 100644 (file)
index 219a808..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-/* plugin_common - Routines common to several plugins
- * Copyright (C) 2002,2003,2004  Daisuke Shimamura
- *
- * Almost from id3_tag.c - 2001/02/16
- *  EasyTAG - Tag editor for MP3 and OGG files
- *  Copyright (C) 2001-2002  Jerome Couderc <j.couderc@ifrance.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "FLAC/assert.h"
-
-#include <stdlib.h> /* for free() */
-#include <string.h> /* for memset() */
-
-#ifdef FLAC__HAS_ID3LIB
-#include <id3.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#include "id3v1.h" /* for genre stuff */
-#include "locale_hack.h"
-
-#define ID3V2_MAX_STRING_LEN 4096
-#define NUMBER_TRACK_FORMATED 1
-#endif
-
-/*
- * This should come after #include<id3.h> because id3.h doesn't #undef
- * true and false before redefining them, causing warnings.
- */
-#include "id3v2.h"
-
-#ifdef FLAC__HAS_ID3LIB
-/* local__strip() based on glib's g_strchomp() and g_strchug():
- * GLIB - Library of useful routines for C programming
- * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
- * (LGPL 2 follows)
- */
-static void local__strip(char *string)
-{
-       char *s;
-
-       if(0 == string)
-               return;
-
-       for(s = string; *s && isspace(*s); s++)
-               ;
-
-       memmove(string, s, strlen((char*)s) + 1);
-
-       if(!*string)
-               return;
-
-       for(s = string + strlen (string) - 1; s >= string && isspace(*s); s--)
-               *s = '\0';
-}
-
-
-/*
- * As the ID3Tag_Link function of id3lib-3.8.0pre2 returns the ID3v1 tags
- * when a file has both ID3v1 and ID3v2 tags, we first try to explicitely
- * get the ID3v2 tags with ID3Tag_LinkWithFlags and, if we cannot get them,
- * fall back to the ID3v1 tags.
- * (Written by Holger Schemel).
- */
-static size_t local__ID3Tag_Link_wrapper(ID3Tag *id3tag, const char *filename)
-{
-       size_t offset;
-
-#   if ( (ID3LIB_MAJOR >= 3) && (ID3LIB_MINOR >= 8)  )
-               /* First, try to get the ID3v2 tags */
-               offset = ID3Tag_LinkWithFlags(id3tag, filename, ID3TT_ID3V2);
-               if (offset == 0) {
-                       /* No ID3v2 tags available => try to get the ID3v1 tags */
-                       offset = ID3Tag_LinkWithFlags(id3tag, filename, ID3TT_ID3V1);
-               }
-#   else
-               /* Function 'ID3Tag_LinkWithFlags' is not defined up to id3lib-.3.7.13 */
-               offset = ID3Tag_Link(id3tag, filename);
-#   endif
-       return offset;
-}
-
-
-/*
- * As the ID3Field_GetASCII function differs with the version of id3lib, we must redefine it.
- */
-/* [JEC] old id3lib versions may have used index_t for itemNum but size_t is what it wants now and seems safe enough. */
-static size_t local__ID3Field_GetASCII_wrapper(const ID3Field *field, char *buffer, size_t maxChars, size_t itemNum)
-{
-
-       /* Defined by id3lib:   ID3LIB_MAJOR_VERSION, ID3LIB_MINOR_VERSION, ID3LIB_PATCH_VERSION
-        * Defined by autoconf: ID3LIB_MAJOR,         ID3LIB_MINOR,         ID3LIB_PATCH
-        *
-        * <= 3.7.12 : first item num is 1 for ID3Field_GetASCII
-        *  = 3.7.13 : first item num is 0 for ID3Field_GetASCII
-        * >= 3.8.0  : doesn't need item num for ID3Field_GetASCII
-        */
-#      if (ID3LIB_MAJOR >= 3)
-                /* (>= 3.x.x) */
-#              if (ID3LIB_MINOR <= 7)
-                        /* (3.0.0 to 3.7.x) */
-#                      if (ID3LIB_PATCH >= 13)
-                                /* (>= 3.7.13) */
-                                return ID3Field_GetASCII(field, buffer, maxChars, itemNum);
-#                      else
-                                return ID3Field_GetASCII(field, buffer, maxChars, itemNum+1);
-#                      endif
-#              else
-                        /* (>= to 3.8.0) */
-                        /*return ID3Field_GetASCII(field, buffer, maxChars); */
-                        return ID3Field_GetASCIIItem(field, buffer, maxChars, itemNum);
-#              endif
-#      else
-                /* Not tested (< 3.x.x) */
-                return ID3Field_GetASCII(field, buffer, maxChars, itemNum+1);
-#      endif
-}
-
-
-/*
- * Returns the name of a genre code if found
- * Three states for genre code :
- *    - defined (0 to GENRE_MAX)
- *    - undefined/unknown (GENRE_MAX+1 to ID3_INVALID_GENRE-1)
- *    - invalid (>ID3_INVALID_GENRE)
- */
-static const char *local__genre_to_string(unsigned genre_code)
-{
-       if(genre_code >= FLAC_PLUGIN__ID3V1_TAG_INVALID_GENRE)
-               return "";
-       else {
-               const char *s = FLAC_plugin__id3v1_tag_get_genre_as_string((unsigned)genre_code);
-               if(s[0] == 0)
-                       return "Unknown";
-               else
-                       return s;
-       }
-}
-
-
-/*
- * Read id3v1.x / id3v2 tag and load data into the File_Tag structure using id3lib functions.
- * Returns true on success, else false.
- * If a tag entry exists (ex: title), we allocate memory, else value stays to NULL
- */
-static FLAC__bool local__get_tag(const char *filename, FLAC_Plugin__Id3v2_Tag *tag)
-{
-       FILE *file;
-       ID3Tag *id3_tag = 0; /* Tag defined by id3lib */
-       char *string, *string1;
-
-       FLAC__ASSERT(0 != filename);
-       FLAC__ASSERT(0 != tag);
-
-       if(0 == (file = fopen(filename, "r"))) {
-#ifdef DEBUG
-               fprintf(stderr, _("ERROR while opening file: '%s' (%s).\n\a"), filename, strerror(errno));
-#endif
-               return false;
-       }
-       fclose(file); /* We close it cause id3lib opens/closes file itself */
-
-
-       /* Get data from tag */
-       if(0 != (id3_tag = ID3Tag_New())) {
-               ID3Frame *id3_frame;
-               ID3Field *id3_field;
-               luint frm_size;
-               luint num_chars;
-               size_t field_num = 0; /* First field */
-
-               /* Link the file to the tag */
-               frm_size = local__ID3Tag_Link_wrapper(id3_tag, filename);
-
-               string = malloc(ID3V2_MAX_STRING_LEN+1);
-
-               /*********
-                * Title *
-                *********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_TITLE))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               /* Note: if 'num_chars' is equal to 0, then the field is empty or corrupted! */
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-                                       tag->title = strdup(string);
-                               }
-                       }
-               }
-
-
-               /************
-                * Composer *
-                ************/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_COMPOSER))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-                                       tag->composer = strdup(string);
-                               }
-                       }
-               }
-
-
-               /**********
-                * Artist *
-                **********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_LEADARTIST))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-                                       tag->performer = strdup(string);
-                               }
-                       }
-               }
-
-
-               /*********
-                * Album *
-                *********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_ALBUM))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-                                       tag->album = strdup(string);
-                               }
-                       }
-               }
-
-
-               /********
-                * Year *
-                ********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_YEAR))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       char *tmp_str;
-
-                                       local__strip(string);
-
-                                       /* Fix for id3lib 3.7.x: if the id3v1.x tag was filled with spaces
-                                        * instead of zeroes, then the year field contains garbages! */
-                                       tmp_str = string;
-                                       while (isdigit(*tmp_str)) tmp_str++;
-                                       *tmp_str = 0;
-                                       /* End of fix for id3lib 3.7.x */
-
-                                       local__strip(string);
-                                       tag->year_recorded = strdup(string);
-                                       tag->year_performed = strdup(string);
-                               }
-                       }
-               }
-
-
-               /*************************
-                * Track and Total Track *
-                *************************/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_TRACKNUM))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-
-                                       string1 = strchr(string, '/');
-                                       if (NUMBER_TRACK_FORMATED) {
-                                               if (string1) {
-                                                       /* Just to have numbers like this : '01', '05', '12', ... */
-                                                       tag->tracks_in_album = malloc(64);
-                                                       sprintf(tag->tracks_in_album, "%.2d", atoi(string1+1));
-                                                       *string1 = '\0';
-                                               }
-                                               /* Just to have numbers like this : '01', '05', '12', ... */
-                                               tag->track_number = malloc(64);
-                                               sprintf(tag->track_number, "%.2d", atoi(string));
-                                       }
-                                       else {
-                                               if (string1) {
-                                                       tag->tracks_in_album = strdup(string1+1);
-                                                       *string1 = '\0';
-                                               }
-                                               tag->track_number = strdup(string);
-                                       }
-                               }
-                       }
-               }
-
-
-               /*********
-                * Genre *
-                *********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_CONTENTTYPE))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               /*
-                                * We manipulate only the name of the genre
-                                */
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       char *tmp;
-
-                                       local__strip(string);
-
-                                       if((string[0]=='(') && (tmp=strchr(string, ')')) && (strlen((tmp+1))>0)) {
-                                               /* Convert a genre written as '(3)Dance' into 'Dance' */
-                                               tag->genre = strdup(tmp+1);
-
-                                       }
-                                       else if((string[0]=='(') && (tmp=strchr(string, ')'))) {
-                                               /* Convert a genre written as '(3)' into 'Dance' */
-                                               *tmp = 0;
-                                               tag->genre = strdup(local__genre_to_string((unsigned)atoi(string+1)));
-
-                                       }
-                                       else {
-                                               /* Genre is already written as 'Dance' */
-                                               tag->genre = strdup(string);
-                                       }
-                               }
-                       }
-               }
-
-
-               /***********
-                * Comment *
-                ***********/
-               if(0 != (id3_frame = ID3Tag_FindFrameWithID(id3_tag, ID3FID_COMMENT))) {
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_TEXT))) {
-                               if((num_chars = local__ID3Field_GetASCII_wrapper(id3_field, string, ID3V2_MAX_STRING_LEN, field_num)) > 0 && string != NULL) {
-                                       local__strip(string);
-                                       tag->comment = strdup(string);
-                               }
-                       }
-#if 0
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_DESCRIPTION))) {
-                               char *comment1 = calloc(MAX_STRING_LEN+1);
-                               num_chars = ID3Field_GetASCII(id3_field, comment1, MAX_STRING_LEN, Item_Num);
-                               free(comment1);
-                       }
-                       if(0 != (id3_field = ID3Frame_GetField(id3_frame, ID3FN_LANGUAGE))) {
-                               char *comment2 = calloc(MAX_STRING_LEN+1);
-                               num_chars = ID3Field_GetASCII(id3_field, comment2, MAX_STRING_LEN, Item_Num);
-                               free(comment2);
-                       }
-#endif
-               }
-               free(string);
-
-               /* Free allocated data */
-               ID3Tag_Delete(id3_tag);
-       }
-
-       return true;
-}
-#endif /* ifdef FLAC__HAS_ID3LIB */
-
-FLAC__bool FLAC_plugin__id3v2_tag_get(const char *filename, FLAC_Plugin__Id3v2_Tag *tag)
-{
-       FLAC__ASSERT(0 != tag);
-       if(
-               0 != tag->title ||
-               0 != tag->composer ||
-               0 != tag->performer ||
-               0 != tag->album ||
-               0 != tag->year_recorded ||
-               0 != tag->year_performed ||
-               0 != tag->track_number ||
-               0 != tag->tracks_in_album ||
-               0 != tag->genre ||
-               0 != tag->comment
-       )
-               return false;
-#ifdef FLAC__HAS_ID3LIB
-       return local__get_tag(filename, tag);
-#else
-       (void)filename, (void)tag;
-       return false;
-#endif
-}
-
-void FLAC_plugin__id3v2_tag_clear(FLAC_Plugin__Id3v2_Tag *tag)
-{
-       FLAC__ASSERT(0 != tag);
-       if(0 != tag->title)
-               free(tag->title);
-       if(0 != tag->composer)
-               free(tag->composer);
-       if(0 != tag->performer)
-               free(tag->performer);
-       if(0 != tag->album)
-               free(tag->album);
-       if(0 != tag->year_recorded)
-               free(tag->year_recorded);
-       if(0 != tag->year_performed)
-               free(tag->year_performed);
-       if(0 != tag->track_number)
-               free(tag->track_number);
-       if(0 != tag->tracks_in_album)
-               free(tag->tracks_in_album);
-       if(0 != tag->genre)
-               free(tag->genre);
-       if(0 != tag->comment)
-               free(tag->comment);
-       memset(tag, 0, sizeof(*tag));
-}
diff --git a/src/plugin_common/id3v2.h b/src/plugin_common/id3v2.h
deleted file mode 100644 (file)
index dbb766c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* plugin_common - Routines common to several plugins
- * Copyright (C) 2002,2003,2004  Josh Coalson
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef FLAC__PLUGIN_COMMON__ID3V2_H
-#define FLAC__PLUGIN_COMMON__ID3V2_H
-
-#include "FLAC/ordinals.h"
-
-/*
- * This is a simple structure that holds pointers to field values (in ASCII)
- * for fields we care about.
- */
-typedef struct {
-       char *title;
-       char *composer;
-       char *performer;
-       char *album;
-       char *year_recorded;
-       char *year_performed;
-       char *track_number;
-       char *tracks_in_album;
-       char *genre;
-       char *comment;
-} FLAC_Plugin__Id3v2_Tag;
-
-/* Fills up an existing FLAC_Plugin__Id3v2_Tag.  All pointers must be NULL on
- * entry or the function will return false.  For any field for which there is
- * no corresponding ID3 frame, it's pointer will be NULL.
- *
- * If loading fails, all pointers will be cleared and the function will return
- * false.
- *
- * If the function returns true, be sure to call FLAC_plugin__id3v2_tag_clear()
- * when you are done with 'tag'.
- */
-FLAC__bool FLAC_plugin__id3v2_tag_get(const char *filename, FLAC_Plugin__Id3v2_Tag *tag);
-
-/* free()s any non-NULL pointers in 'tag'.  Does NOT free(tag).
- */
-void FLAC_plugin__id3v2_tag_clear(FLAC_Plugin__Id3v2_Tag *tag);
-
-#endif
index cafa6ff..c62c719 100644 (file)
@@ -97,14 +97,6 @@ SOURCE=.\dither.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\id3v1.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\id3v2.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\vorbiscomment.c\r
 # End Source File\r
 # End Group\r
@@ -129,10 +121,6 @@ SOURCE=.\dither.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\id3v1.h\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\locale_hack.h\r
 # End Source File\r
 # Begin Source File\r
index b8c2194..86462e1 100644 (file)
@@ -59,7 +59,6 @@ void ReadConfig()
        flac_cfg.title.tag_format_w = FLAC_plugin__convert_ansi_to_wide(flac_cfg.title.tag_format);\r
        /* @@@ FIXME: trailing spaces */\r
        RS(flac_cfg.title.sep, sizeof(flac_cfg.title.sep), default_sep);\r
-       RI(flac_cfg.title.read_v1, 1);\r
        RI(flac_cfg.tag.reserve_space, 1);\r
 \r
        RI(flac_cfg.display.show_bps, 1);\r
@@ -77,7 +76,6 @@ void ReadConfig()
 void WriteConfig()\r
 {\r
        WS(flac_cfg.title.tag_format);\r
-       WI(flac_cfg.title.read_v1);\r
        WI(flac_cfg.tag.reserve_space);\r
        WS(flac_cfg.title.sep);\r
 \r
@@ -116,7 +114,7 @@ static INT_PTR CALLBACK GeneralProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
 \r
                SetDlgItemText(hwnd, IDC_TITLE, flac_cfg.title.tag_format);\r
                SetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep);\r
-               Check(IDC_ID3V1, flac_cfg.title.read_v1);\r
+               Check(IDC_ID3V1, 0);\r
 /*!            Check(IDC_RESERVE, flac_cfg.tag.reserve_space); */\r
                Check(IDC_BPS, flac_cfg.display.show_bps);\r
                Check(IDC_ERRORS, flac_cfg.output.misc.stop_err);\r
@@ -133,14 +131,13 @@ static INT_PTR CALLBACK GeneralProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
                        GetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep, sizeof(flac_cfg.title.sep));\r
                        flac_cfg.title.tag_format_w = FLAC_plugin__convert_ansi_to_wide(flac_cfg.title.tag_format);\r
 \r
-                       flac_cfg.title.read_v1 = GetCheck(IDC_ID3V1);\r
 /*!                    flac_cfg.tag.reserve_space = GetCheck(IDC_RESERVE); */\r
                        flac_cfg.display.show_bps = GetCheck(IDC_BPS);\r
                        flac_cfg.output.misc.stop_err = GetCheck(IDC_ERRORS);\r
                        break;\r
                /* reset */\r
                case IDC_RESET:\r
-                       Check(IDC_ID3V1, 1);\r
+                       Check(IDC_ID3V1, 0);\r
                        Check(IDC_RESERVE, 1);\r
                        Check(IDC_BPS, 1);\r
                        Check(IDC_ERRORS, 0);\r
index 11ec20b..93b1bfb 100644 (file)
@@ -27,7 +27,6 @@ typedef struct {
                char tag_format[256];\r
                char sep[16];\r
                WCHAR *tag_format_w;\r
-               BOOL read_v1;\r
        } title;\r
        struct {\r
                BOOL reserve_space;\r
index d94054d..23b0cbd 100644 (file)
@@ -395,9 +395,6 @@ void ReadTags(const char *fileName, FLAC_Plugin__CanonicalTag *tag, BOOL forDisp
        FLAC_plugin__canonical_tag_init(tag);\r
        FLAC_plugin__vorbiscomment_get(fileName, tag, forDisplay ? flac_cfg.title.sep : NULL);\r
 \r
-       if (flac_cfg.title.read_v1)\r
-               FLAC_plugin__canonical_tag_add_id3v1(fileName, tag);\r
-\r
        /* add file name */\r
        if (forDisplay)\r
        {\r
index 17f9593..d639926 100644 (file)
@@ -25,9 +25,9 @@ EXTRA_DIST = \
 noinst_HEADERS = \
        charset.h \
        configure.h \
-       wrap_id3.h
+       tag.h
 
-CFLAGS = @CFLAGS@ @ID3LIB_CFLAGS@ @XMMS_CFLAGS@
+CFLAGS = @CFLAGS@ @XMMS_CFLAGS@
 INCLUDES = -I$(top_srcdir)/src
 if FLaC__INSTALL_XMMS_PLUGIN_LOCALLY
 xmmsinputplugindir = $(HOME)/.xmms/Plugins
@@ -40,13 +40,9 @@ LIBTOOL = $(top_builddir)/libtool-disable-static
 
 xmmsinputplugin_LTLIBRARIES = libxmms-flac.la
 
-plugin_sources = charset.c configure.c plugin.c wrap_id3.c fileinfo.c
+plugin_sources = charset.c configure.c plugin.c tag.c fileinfo.c
 
-if FLaC__HAS_ID3LIB
 libxmms_flac_la_SOURCES = $(plugin_sources)
-else
-libxmms_flac_la_SOURCES = $(plugin_sources)
-endif
 
 # work around the bug in libtool where its relinking fails with a different DESTDIR
 # for libtool bug info see:
@@ -64,6 +60,5 @@ libxmms_flac_la_LIBADD = \
        $(top_builddir)/src/share/utf8/libutf8.la \
        $(top_builddir)/src/libFLAC/libFLAC.la \
        -L$(top_builddir)/src/libFLAC/.libs \
-       @XMMS_LIBS@ \
-       @ID3LIB_LIBS@
+       @XMMS_LIBS@
 libxmms_flac_la_LDFLAGS = -module -avoid-version
index f1de70a..e5763db 100644 (file)
@@ -24,14 +24,14 @@ topdir = ../..
 LIB_NAME  = libxmms-flac
 INCLUDES  = $(shell xmms-config --cflags) -I./include -I$(topdir)/include -I..
 # refer to the static libs explicitly
-LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
+LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a -lstdc++ -lz
 
 SRCS_C = \
        charset.c \
        configure.c \
        plugin.c \
        fileinfo.c \
-       wrap_id3.c
+       tag.c
 
 include $(topdir)/build/lib.mk
 
index 22de4a5..12c808c 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h> /* for strlen() */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
index 1a5652e..bdb1e4a 100644 (file)
@@ -40,8 +40,8 @@
 #include "share/grabbag.h"
 #include "share/replaygain_synthesis.h"
 #include "configure.h"
-#include "wrap_id3.h"
 #include "charset.h"
+#include "tag.h"
 
 #ifdef min
 #undef min
similarity index 97%
rename from src/plugin_xmms/wrap_id3.c
rename to src/plugin_xmms/tag.c
index a48aaeb..b9a1085 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "FLAC/metadata.h"
 #include "plugin_common/canonical_tag.h"
+#include "plugin_common/vorbiscomment.h"
 #include "charset.h"
 #include "configure.h"
 
@@ -103,7 +104,7 @@ char *flac_format_song_title(char *filename)
 
        FLAC_plugin__canonical_tag_init(&tag);
 
-       FLAC_plugin__canonical_tag_get_combined(filename, &tag, /*sep=*/0);
+       FLAC_plugin__vorbiscomment_get(filename, &tag, /*sep=*/0);
 
        title       = local__getfield(&tag, L"TITLE");
        artist      = local__getfield(&tag, L"ARTIST");
similarity index 92%
rename from src/plugin_xmms/wrap_id3.h
rename to src/plugin_xmms/tag.h
index f7fa469..479eb3b 100644 (file)
@@ -16,8 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#ifndef __FLAC_ID3_H__
-#define __FLAC_ID3_H__
+#ifndef __FLAC__PLUGIN_XMMS__TAG_H__
+#define __FLAC__PLUGIN_XMMS__TAG_H__
 
 gchar *flac_format_song_title(gchar * filename);