Remove winamp2 plugin
authorErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 30 Mar 2012 10:35:41 +0000 (21:35 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 30 Mar 2012 10:35:41 +0000 (21:35 +1100)
Patch from Cristian Rodríguez
Nullsoft has provided a native FLAC support since Winamp 5.31 (since
the year 2006).

21 files changed:
README
configure.ac
src/Makefile.am
src/plugin_winamp2/Makefile.am [deleted file]
src/plugin_winamp2/configure.c [deleted file]
src/plugin_winamp2/configure.h [deleted file]
src/plugin_winamp2/in_flac.c [deleted file]
src/plugin_winamp2/in_flac.dsp [deleted file]
src/plugin_winamp2/in_flac.vcproj [deleted file]
src/plugin_winamp2/include/Makefile.am [deleted file]
src/plugin_winamp2/include/winamp2/Makefile.am [deleted file]
src/plugin_winamp2/include/winamp2/in2.h [deleted file]
src/plugin_winamp2/include/winamp2/out.h [deleted file]
src/plugin_winamp2/infobox.c [deleted file]
src/plugin_winamp2/infobox.h [deleted file]
src/plugin_winamp2/playback.c [deleted file]
src/plugin_winamp2/playback.h [deleted file]
src/plugin_winamp2/resource.h [deleted file]
src/plugin_winamp2/resource.rc [deleted file]
src/plugin_winamp2/tagz.cpp [deleted file]
src/plugin_winamp2/tagz.h [deleted file]

diff --git a/README b/README
index f126c27..d047bba 100644 (file)
--- a/README
+++ b/README
@@ -235,7 +235,7 @@ linked (e.g. obj\release\bin\flac.exe).
 Everything will end up in the "obj" directory.  DLLs and .exe files
 are all that are needed and can be copied to an installation area and
 added to the PATH.  The plugins have to be copied to their appropriate
-place in the player area.  For Winamp2 this is <winamp2-dir>\Plugins.
+place in the player area.
 
 By default the code is configured with Ogg support.  Before building FLAC
 you will need to get the Ogg source distribution
index da23a43..37e5610 100644 (file)
@@ -389,9 +389,6 @@ AC_CONFIG_FILES([ \
        src/monkeys_audio_utilities/flac_mac/Makefile \
        src/monkeys_audio_utilities/flac_ren/Makefile \
        src/plugin_common/Makefile \
-       src/plugin_winamp2/Makefile \
-       src/plugin_winamp2/include/Makefile \
-       src/plugin_winamp2/include/winamp2/Makefile \
        src/plugin_xmms/Makefile \
        src/share/Makefile \
        src/share/getopt/Makefile \
index 712b0e3..e833eb3 100644 (file)
@@ -30,7 +30,6 @@ SUBDIRS = \
        metaflac \
        monkeys_audio_utilities \
        $(XMMS_DIRS) \
-       plugin_winamp2 \
        test_grabbag \
        test_libs_common \
        test_libFLAC \
diff --git a/src/plugin_winamp2/Makefile.am b/src/plugin_winamp2/Makefile.am
deleted file mode 100644 (file)
index 5e2d647..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#  in_flac - Winamp2 FLAC input plugin
-#  Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library 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
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-SUBDIRS = include
-
-EXTRA_DIST = \
-       configure.h \
-       configure.c \
-       in_flac.c \
-       in_flac.dsp \
-       in_flac.vcproj \
-       infobox.c \
-       infobox.h \
-       playback.c \
-       playback.h \
-       resource.h \
-       resource.rc \
-       tagz.cpp \
-       tagz.h
diff --git a/src/plugin_winamp2/configure.c b/src/plugin_winamp2/configure.c
deleted file mode 100644 (file)
index 2921a38..0000000
+++ /dev/null
@@ -1,428 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#if HAVE_CONFIG_H\r
-#  include <config.h>\r
-#endif\r
-\r
-#include <windows.h>\r
-#include <commctrl.h>\r
-#include <stdio.h>\r
-#include "configure.h"\r
-#include "tagz.h"\r
-#include "resource.h"\r
-#include "share/alloc.h"\r
-\r
-\r
-static char buffer[256];\r
-static char ini_name[MAX_PATH];\r
-\r
-/*\r
- *  Read/write config\r
- */\r
-\r
-#define RI(x, def)          (x = GetPrivateProfileInt("FLAC", #x, def, ini_name))\r
-#define WI(x)               WritePrivateProfileString("FLAC", #x, itoa(x, buffer, 10), ini_name)\r
-#define RS(x, n, def)       GetPrivateProfileString("FLAC", #x, def, x, n, ini_name)\r
-#define WS(x)               WritePrivateProfileString("FLAC", #x, x, ini_name)\r
-\r
-static const char default_format[] = "[%artist% - ]$if2(%title%,%filename%)";\r
-static const char default_sep[] = ", ";\r
-\r
-static wchar_t *convert_ansi_to_wide_(const char *src)\r
-{\r
-       int len;\r
-       wchar_t *dest;\r
-\r
-       FLAC__ASSERT(0 != src);\r
-\r
-       len = strlen(src) + 1;\r
-       /* copy */\r
-       dest = safe_malloc_mul_2op_(len, /*times*/sizeof(wchar_t));\r
-       if (dest) mbstowcs(dest, src, len);\r
-       return dest;\r
-}\r
-\r
-void InitConfig()\r
-{\r
-       char *p;\r
-\r
-       GetModuleFileName(NULL, ini_name, sizeof(ini_name));\r
-       p = strrchr(ini_name, '.');\r
-       if (!p) p = ini_name + strlen(ini_name);\r
-       strcpy(p, ".ini");\r
-\r
-       flac_cfg.title.tag_format_w = NULL;\r
-}\r
-\r
-void ReadConfig()\r
-{\r
-       RS(flac_cfg.title.tag_format, sizeof(flac_cfg.title.tag_format), default_format);\r
-       if (flac_cfg.title.tag_format_w)\r
-               free(flac_cfg.title.tag_format_w);\r
-       flac_cfg.title.tag_format_w = 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.tag.reserve_space, 1);\r
-\r
-       RI(flac_cfg.display.show_bps, 1);\r
-       RI(flac_cfg.output.misc.stop_err, 0);\r
-       RI(flac_cfg.output.replaygain.enable, 1);\r
-       RI(flac_cfg.output.replaygain.album_mode, 0);\r
-       RI(flac_cfg.output.replaygain.hard_limit, 0);\r
-       RI(flac_cfg.output.replaygain.preamp, 0);\r
-       RI(flac_cfg.output.resolution.normal.dither_24_to_16, 0);\r
-       RI(flac_cfg.output.resolution.replaygain.dither, 0);\r
-       RI(flac_cfg.output.resolution.replaygain.noise_shaping, 1);\r
-       RI(flac_cfg.output.resolution.replaygain.bps_out, 16);\r
-}\r
-\r
-void WriteConfig()\r
-{\r
-       WS(flac_cfg.title.tag_format);\r
-       WI(flac_cfg.tag.reserve_space);\r
-       WS(flac_cfg.title.sep);\r
-\r
-       WI(flac_cfg.display.show_bps);\r
-       WI(flac_cfg.output.misc.stop_err);\r
-       WI(flac_cfg.output.replaygain.enable);\r
-       WI(flac_cfg.output.replaygain.album_mode);\r
-       WI(flac_cfg.output.replaygain.hard_limit);\r
-       WI(flac_cfg.output.replaygain.preamp);\r
-       WI(flac_cfg.output.resolution.normal.dither_24_to_16);\r
-       WI(flac_cfg.output.resolution.replaygain.dither);\r
-       WI(flac_cfg.output.resolution.replaygain.noise_shaping);\r
-       WI(flac_cfg.output.resolution.replaygain.bps_out);\r
-}\r
-\r
-/*\r
- *  Dialog\r
- */\r
-\r
-#define PREAMP_RANGE            24\r
-\r
-#define Check(x,y)              CheckDlgButton(hwnd, x, y ? BST_CHECKED : BST_UNCHECKED)\r
-#define GetCheck(x)             (IsDlgButtonChecked(hwnd, x)==BST_CHECKED)\r
-#define GetSel(x)               SendDlgItemMessage(hwnd, x, CB_GETCURSEL, 0, 0)\r
-#define GetPos(x)               SendDlgItemMessage(hwnd, x, TBM_GETPOS, 0, 0)\r
-#define Enable(x,y)             EnableWindow(GetDlgItem(hwnd, x), y)\r
-\r
-static INT_PTR CALLBACK GeneralProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
-{\r
-       switch (msg)\r
-       {\r
-       /* init */\r
-       case WM_INITDIALOG:\r
-               SendDlgItemMessage(hwnd, IDC_TITLE, EM_LIMITTEXT, 255, 0);\r
-               SendDlgItemMessage(hwnd, IDC_SEP, EM_LIMITTEXT, 15, 0);\r
-\r
-               SetDlgItemText(hwnd, IDC_TITLE, flac_cfg.title.tag_format);\r
-               SetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep);\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
-               return TRUE;\r
-       /* commands */\r
-       case WM_COMMAND:\r
-               switch (LOWORD(wParam))\r
-               {\r
-               /* ok */\r
-               case IDOK:\r
-                       GetDlgItemText(hwnd, IDC_TITLE, flac_cfg.title.tag_format, sizeof(flac_cfg.title.tag_format));\r
-                       if (flac_cfg.title.tag_format_w)\r
-                               free(flac_cfg.title.tag_format_w);\r
-                       GetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep, sizeof(flac_cfg.title.sep));\r
-                       flac_cfg.title.tag_format_w = convert_ansi_to_wide_(flac_cfg.title.tag_format);\r
-\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, 0);\r
-                       Check(IDC_RESERVE, 1);\r
-                       Check(IDC_BPS, 1);\r
-                       Check(IDC_ERRORS, 0);\r
-                       /* fall throught */\r
-               /* default */\r
-               case IDC_TAGZ_DEFAULT:\r
-                       SetDlgItemText(hwnd, IDC_TITLE, default_format);\r
-                       break;\r
-               /* help */\r
-               case IDC_TAGZ_HELP:\r
-                       MessageBox(hwnd, tagz_manual, "Help", 0);\r
-                       break;\r
-               }\r
-               break;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-\r
-static void UpdatePreamp(HWND hwnd, HWND hamp)\r
-{\r
-       int pos = SendMessage(hamp, TBM_GETPOS, 0, 0) - PREAMP_RANGE;\r
-       sprintf(buffer, "%d dB", pos);\r
-       SetDlgItemText(hwnd, IDC_PA, buffer);\r
-}\r
-\r
-static void UpdateRG(HWND hwnd)\r
-{\r
-       int on = GetCheck(IDC_ENABLE);\r
-       Enable(IDC_ALBUM, on);\r
-       Enable(IDC_LIMITER, on);\r
-       Enable(IDC_PREAMP, on);\r
-       Enable(IDC_PA, on);\r
-}\r
-\r
-static void UpdateDither(HWND hwnd)\r
-{\r
-       int on = GetCheck(IDC_DITHERRG);\r
-       Enable(IDC_SHAPE, on);\r
-}\r
-\r
-static INT_PTR CALLBACK OutputProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
-{\r
-       switch (msg)\r
-       {\r
-       /* init */\r
-       case WM_INITDIALOG:\r
-               Check(IDC_ENABLE, flac_cfg.output.replaygain.enable);\r
-               Check(IDC_ALBUM, flac_cfg.output.replaygain.album_mode);\r
-               Check(IDC_LIMITER, flac_cfg.output.replaygain.hard_limit);\r
-               Check(IDC_DITHER, flac_cfg.output.resolution.normal.dither_24_to_16);\r
-               Check(IDC_DITHERRG, flac_cfg.output.resolution.replaygain.dither);\r
-               /* prepare preamp slider */\r
-               {\r
-                       HWND hamp = GetDlgItem(hwnd, IDC_PREAMP);\r
-                       SendMessage(hamp, TBM_SETRANGE, 1, MAKELONG(0, PREAMP_RANGE*2));\r
-                       SendMessage(hamp, TBM_SETPOS, 1, flac_cfg.output.replaygain.preamp+PREAMP_RANGE);\r
-                       UpdatePreamp(hwnd, hamp);\r
-               }\r
-               /* fill comboboxes */\r
-               {\r
-                       HWND hlist = GetDlgItem(hwnd, IDC_TO);\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"16 bps");\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"24 bps");\r
-                       SendMessage(hlist, CB_SETCURSEL, flac_cfg.output.resolution.replaygain.bps_out/8 - 2, 0);\r
-\r
-                       hlist = GetDlgItem(hwnd, IDC_SHAPE);\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"None");\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"Low");\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"Medium");\r
-                       SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"High");\r
-                       SendMessage(hlist, CB_SETCURSEL, flac_cfg.output.resolution.replaygain.noise_shaping, 0);\r
-               }\r
-               UpdateRG(hwnd);\r
-               UpdateDither(hwnd);\r
-               return TRUE;\r
-       /* commands */\r
-       case WM_COMMAND:\r
-               switch (LOWORD(wParam))\r
-               {\r
-               /* ok */\r
-               case IDOK:\r
-                       flac_cfg.output.replaygain.enable = GetCheck(IDC_ENABLE);\r
-                       flac_cfg.output.replaygain.album_mode = GetCheck(IDC_ALBUM);\r
-                       flac_cfg.output.replaygain.hard_limit = GetCheck(IDC_LIMITER);\r
-                       flac_cfg.output.replaygain.preamp = GetPos(IDC_PREAMP) - PREAMP_RANGE;\r
-                       flac_cfg.output.resolution.normal.dither_24_to_16 = GetCheck(IDC_DITHER);\r
-                       flac_cfg.output.resolution.replaygain.dither = GetCheck(IDC_DITHERRG);\r
-                       flac_cfg.output.resolution.replaygain.noise_shaping = GetSel(IDC_SHAPE);\r
-                       flac_cfg.output.resolution.replaygain.bps_out = (GetSel(IDC_TO)+2)*8;\r
-                       break;\r
-               /* reset */\r
-               case IDC_RESET:\r
-                       Check(IDC_ENABLE, 1);\r
-                       Check(IDC_ALBUM, 0);\r
-                       Check(IDC_LIMITER, 0);\r
-                       Check(IDC_DITHER, 0);\r
-                       Check(IDC_DITHERRG, 0);\r
-\r
-                       SendDlgItemMessage(hwnd, IDC_PREAMP, TBM_SETPOS, 1, PREAMP_RANGE);\r
-                       SendDlgItemMessage(hwnd, IDC_TO, CB_SETCURSEL, 0, 0);\r
-                       SendDlgItemMessage(hwnd, IDC_SHAPE, CB_SETCURSEL, 1, 0);\r
-\r
-                       UpdatePreamp(hwnd, GetDlgItem(hwnd, IDC_PREAMP));\r
-                       UpdateRG(hwnd);\r
-                       UpdateDither(hwnd);\r
-                       break;\r
-               /* active check-boxes */\r
-               case IDC_ENABLE:\r
-                       UpdateRG(hwnd);\r
-                       break;\r
-               case IDC_DITHERRG:\r
-                       UpdateDither(hwnd);\r
-                       break;\r
-               }\r
-               break;\r
-       /* scroller */\r
-       case WM_HSCROLL:\r
-               if (GetDlgCtrlID((HWND)lParam)==IDC_PREAMP)\r
-                       UpdatePreamp(hwnd, (HWND)lParam);\r
-               return 0;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-#define NUM_PAGES       2\r
-\r
-typedef struct\r
-{\r
-       HWND htab;\r
-       HWND hdlg;\r
-       RECT r;\r
-       HWND all[NUM_PAGES];\r
-} LOCALDATA;\r
-\r
-static void ScreenToClientRect(HWND hwnd, RECT *rect)\r
-{\r
-       POINT pt = { rect->left, rect->top };\r
-       ScreenToClient(hwnd, &pt);\r
-       rect->left = pt.x;\r
-       rect->top  = pt.y;\r
-\r
-       pt.x = rect->right;\r
-       pt.y = rect->bottom;\r
-       ScreenToClient(hwnd, &pt);\r
-       rect->right  = pt.x;\r
-       rect->bottom = pt.y;\r
-}\r
-\r
-static void SendCommand(HWND hwnd, int command)\r
-{\r
-       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-       SendMessage(data->hdlg, WM_COMMAND, command, 0);\r
-}\r
-\r
-static void BroadcastCommand(HWND hwnd, int command)\r
-{\r
-       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-       int i;\r
-\r
-       for (i=0; i<NUM_PAGES; i++)\r
-               SendMessage(data->all[i], WM_COMMAND, command, 0);\r
-}\r
-\r
-static void OnSelChange(HWND hwnd)\r
-{\r
-       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-       int index = TabCtrl_GetCurSel(data->htab);\r
-       if (index < 0) return;\r
-       /* hide previous */\r
-       if (data->hdlg)\r
-               ShowWindow(data->hdlg, SW_HIDE);\r
-       /* display */\r
-       data->hdlg = data->all[index];\r
-       SetWindowPos(data->hdlg, HWND_TOP, data->r.left, data->r.top, data->r.right-data->r.left, data->r.bottom-data->r.top, SWP_SHOWWINDOW);\r
-       SetFocus(hwnd);\r
-}\r
-\r
-static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
-{\r
-       static activePage = 0;\r
-\r
-       switch (msg)\r
-       {\r
-       /* init */\r
-       case WM_INITDIALOG:\r
-               {\r
-                       LOCALDATA *data = LocalAlloc(LPTR, sizeof(LOCALDATA));\r
-                       HINSTANCE inst = (HINSTANCE)lParam;\r
-                       TCITEM item;\r
-\r
-                       /* init */\r
-                       SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);\r
-                       data->htab = GetDlgItem(hwnd, IDC_TABS);\r
-                       data->hdlg = NULL;\r
-                       /* add pages */\r
-                       item.mask = TCIF_TEXT;\r
-                       data->all[0] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_GENERAL), hwnd, GeneralProc);\r
-                       item.pszText = "General";\r
-                       TabCtrl_InsertItem(data->htab, 0, &item);\r
-\r
-                       data->all[1] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_OUTPUT), hwnd, OutputProc);\r
-                       item.pszText = "Output";\r
-                       TabCtrl_InsertItem(data->htab, 1, &item);\r
-                       /* get rect (after adding pages) */\r
-                       GetWindowRect(data->htab, &data->r);\r
-                       ScreenToClientRect(hwnd, &data->r);\r
-                       TabCtrl_AdjustRect(data->htab, 0, &data->r);\r
-                       /* simulate item change */\r
-                       TabCtrl_SetCurSel(data->htab, activePage);\r
-                       OnSelChange(hwnd);\r
-               }\r
-               return TRUE;\r
-       /* destory */\r
-       case WM_DESTROY:\r
-               {\r
-                       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-                       int i;\r
-\r
-                       activePage = TabCtrl_GetCurSel(data->htab);\r
-\r
-                       for (i=0; i<NUM_PAGES; i++)\r
-                               DestroyWindow(data->all[i]);\r
-\r
-                       LocalFree(data);\r
-               }\r
-               break;\r
-       /* commands */\r
-       case WM_COMMAND:\r
-               switch (LOWORD(wParam))\r
-               {\r
-               /* ok/cancel */\r
-               case IDOK:\r
-                       BroadcastCommand(hwnd, IDOK);\r
-                       /* fall through */\r
-               case IDCANCEL:\r
-                       EndDialog(hwnd, LOWORD(wParam));\r
-                       return TRUE;\r
-               case IDC_RESET:\r
-                       SendCommand(hwnd, IDC_RESET);\r
-                       break;\r
-               }\r
-               break;\r
-       /* notification */\r
-       case WM_NOTIFY:\r
-               if (LOWORD(wParam) == IDC_TABS)\r
-               {\r
-                       NMHDR *hdr = (NMHDR*)lParam;\r
-\r
-                       switch (hdr->code)\r
-                       {\r
-                       case TCN_SELCHANGE:\r
-                               OnSelChange(hwnd);\r
-                               break;\r
-                       }\r
-               }\r
-               break;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-\r
-int DoConfig(HINSTANCE inst, HWND parent)\r
-{\r
-       return DialogBoxParam(inst, MAKEINTRESOURCE(IDD_CONFIG), parent, DialogProc, (LONG)inst) == IDOK;\r
-}\r
diff --git a/src/plugin_winamp2/configure.h b/src/plugin_winamp2/configure.h
deleted file mode 100644 (file)
index 6d033ac..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#include "playback.h"\r
-\r
-/*\r
- *  common stuff\r
- */\r
-\r
-typedef struct {\r
-       struct {\r
-               char tag_format[256];\r
-               char sep[16];\r
-               WCHAR *tag_format_w;\r
-       } title;\r
-       struct {\r
-               BOOL reserve_space;\r
-       } tag;\r
-       struct {\r
-               FLAC__bool show_bps;\r
-       } display;\r
-       output_config_t output;\r
-} flac_config_t;\r
-\r
-extern flac_config_t flac_cfg;\r
-\r
-/*\r
- *  prototypes\r
- */\r
-\r
-void InitConfig();\r
-void ReadConfig();\r
-void WriteConfig();\r
-int  DoConfig(HINSTANCE inst, HWND parent);\r
diff --git a/src/plugin_winamp2/in_flac.c b/src/plugin_winamp2/in_flac.c
deleted file mode 100644 (file)
index 6f54f2f..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#if HAVE_CONFIG_H\r
-#  include <config.h>\r
-#endif\r
-\r
-#include <windows.h>\r
-#include <limits.h> /* for INT_MAX */\r
-#include <stdio.h>\r
-\r
-#include "share/alloc.h"\r
-#include "winamp2/in2.h"\r
-#include "configure.h"\r
-#include "infobox.h"\r
-#include "tagz.h"\r
-\r
-#define PLUGIN_VERSION          "1.2.1"\r
-\r
-static In_Module mod_;                      /* the input module (declared near the bottom of this file) */\r
-static char lastfn_[MAX_PATH];              /* currently playing file (used for getting info on the current file) */\r
-flac_config_t flac_cfg;\r
-\r
-static stream_data_struct stream_data_;\r
-static int paused;\r
-static FLAC__StreamDecoder *decoder_;\r
-static char sample_buffer_[SAMPLES_PER_WRITE * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS * (24/8) * 2];\r
-/* (24/8) for max bytes per sample, and 2 for DSPs */\r
-\r
-static HANDLE thread_handle = NULL;         /* the handle to the decode thread */\r
-static DWORD WINAPI DecodeThread(void *b);  /* the decode thread procedure */\r
-\r
-/*\r
- *  init/quit\r
- */\r
-\r
-static void init()\r
-{\r
-       decoder_ = FLAC__stream_decoder_new();\r
-       strcpy(lastfn_, "");\r
-\r
-       InitConfig();\r
-       ReadConfig();\r
-       InitInfobox();\r
-}\r
-\r
-static void quit()\r
-{\r
-       WriteConfig();\r
-       DeinitInfobox();\r
-       FLAC_plugin__decoder_delete(decoder_);\r
-       decoder_ = 0;\r
-}\r
-\r
-/*\r
- *  open/close\r
- */\r
-\r
-static int isourfile(char *fn) { return 0; }\r
-\r
-static int play(char *fn)\r
-{\r
-       LONGLONG filesize;\r
-       DWORD thread_id;\r
-       int   maxlatency;\r
-       /* checks */\r
-       if (decoder_ == 0) return 1;\r
-       if (!(filesize = FileSize(fn))) return -1;\r
-       /* init decoder */\r
-       if (!FLAC_plugin__decoder_init(decoder_, fn, filesize, &stream_data_, &flac_cfg.output))\r
-               return 1;\r
-       strcpy(lastfn_, fn);\r
-       /* open output */\r
-       maxlatency = mod_.outMod->Open(stream_data_.sample_rate, stream_data_.channels, stream_data_.output_bits_per_sample, -1, -1);\r
-       if (maxlatency < 0)\r
-       {\r
-               FLAC_plugin__decoder_finish(decoder_);\r
-               return 1;\r
-       }\r
-       /* set defaults */\r
-       mod_.outMod->SetVolume(-666);\r
-       mod_.outMod->SetPan(0);\r
-       /* initialize vis stuff */\r
-       mod_.SAVSAInit(maxlatency, stream_data_.sample_rate);\r
-       mod_.VSASetInfo(stream_data_.sample_rate, stream_data_.channels);\r
-       /* set info */\r
-       mod_.SetInfo(stream_data_.average_bps, stream_data_.sample_rate/1000, stream_data_.channels, 1);\r
-       /* start playing thread */\r
-       paused = 0;\r
-       thread_handle = CreateThread(NULL, 0, DecodeThread, NULL, 0, &thread_id);\r
-       if (!thread_handle)     return 1;\r
-\r
-       return 0;\r
-}\r
-\r
-static void stop()\r
-{\r
-       if (thread_handle)\r
-       {\r
-               stream_data_.is_playing = false;\r
-               if (WaitForSingleObject(thread_handle, 2000) == WAIT_TIMEOUT)\r
-               {\r
-                       FLAC_plugin__show_error("Error while stopping decoding thread.");\r
-                       TerminateThread(thread_handle, 0);\r
-               }\r
-               CloseHandle(thread_handle);\r
-               thread_handle = NULL;\r
-       }\r
-\r
-       FLAC_plugin__decoder_finish(decoder_);\r
-       mod_.outMod->Close();\r
-       mod_.SAVSADeInit();\r
-}\r
-\r
-/*\r
- *  play control\r
- */\r
-\r
-static void pause()\r
-{\r
-       paused = 1;\r
-       mod_.outMod->Pause(1);\r
-}\r
-\r
-static void unpause()\r
-{\r
-       paused = 0;\r
-       mod_.outMod->Pause(0);\r
-}\r
-\r
-static int ispaused()\r
-{\r
-       return paused;\r
-}\r
-\r
-static int getlength()\r
-{\r
-       return stream_data_.length_in_msec;\r
-}\r
-\r
-static int getoutputtime()\r
-{\r
-       return mod_.outMod->GetOutputTime();\r
-}\r
-\r
-static void setoutputtime(int time_in_ms)\r
-{\r
-       stream_data_.seek_to = time_in_ms;\r
-}\r
-\r
-static void setvolume(int volume)\r
-{\r
-       mod_.outMod->SetVolume(volume);\r
-}\r
-\r
-static void setpan(int pan)\r
-{\r
-       mod_.outMod->SetPan(pan);\r
-}\r
-\r
-static void eq_set(int on, char data[10], int preamp) {}\r
-\r
-/*\r
- *  playing loop\r
- */\r
-\r
-static void do_vis(char *data, int nch, int resolution, int position, unsigned samples)\r
-{\r
-       static char vis_buffer[SAMPLES_PER_WRITE * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS];\r
-       char *ptr;\r
-       int size, count;\r
-\r
-       /*\r
-        * Winamp visuals may have problems accepting sample sizes larger than\r
-        * 16 bits, so we reduce the sample size here if necessary.\r
-        */\r
-\r
-       switch(resolution) {\r
-               case 32:\r
-               case 24:\r
-                       size  = resolution / 8;\r
-                       count = samples * nch;\r
-                       data += size - 1;\r
-\r
-                       ptr = vis_buffer;\r
-                       while(count--) {\r
-                               *ptr++ = data[0] ^ 0x80;\r
-                               data += size;\r
-                       }\r
-\r
-                       data = vis_buffer;\r
-                       resolution = 8;\r
-                       /* fall through */\r
-               case 16:\r
-               case 8:\r
-                       mod_.SAAddPCMData(data, nch, resolution, position);\r
-                       mod_.VSAAddPCMData(data, nch, resolution, position);\r
-       }\r
-}\r
-\r
-static DWORD WINAPI DecodeThread(void *unused)\r
-{\r
-       const unsigned channels = stream_data_.channels;\r
-       const unsigned bits_per_sample = stream_data_.bits_per_sample;\r
-       const unsigned target_bps = stream_data_.output_bits_per_sample;\r
-       const unsigned sample_rate = stream_data_.sample_rate;\r
-       const unsigned fact = channels * (target_bps/8);\r
-\r
-       while (stream_data_.is_playing)\r
-       {\r
-               /* seek needed */\r
-               if (stream_data_.seek_to != -1)\r
-               {\r
-                       const int pos = FLAC_plugin__seek(decoder_, &stream_data_);\r
-                       if (pos != -1) mod_.outMod->Flush(pos);\r
-               }\r
-               /* stream ended */\r
-               else if (stream_data_.eof)\r
-               {\r
-                       if (!mod_.outMod->IsPlaying())\r
-                       {\r
-                               PostMessage(mod_.hMainWindow, WM_WA_MPEG_EOF, 0, 0);\r
-                               return 0;\r
-                       }\r
-                       Sleep(10);\r
-               }\r
-               /* decode */\r
-               else\r
-               {\r
-                       /* decode samples */\r
-                       int bytes = FLAC_plugin__decode(decoder_, &stream_data_, sample_buffer_);\r
-                       const int n = bytes / fact;\r
-                       /* visualization */\r
-                       do_vis(sample_buffer_, channels, target_bps, mod_.outMod->GetWrittenTime(), n);\r
-                       /* dsp */\r
-                       if (mod_.dsp_isactive())\r
-                               bytes = mod_.dsp_dosamples((short*)sample_buffer_, n, target_bps, channels, sample_rate) * fact;\r
-                       /* output */\r
-                       while (mod_.outMod->CanWrite()<bytes && stream_data_.is_playing && stream_data_.seek_to==-1)\r
-                               Sleep(20);\r
-                       if (stream_data_.is_playing && stream_data_.seek_to==-1)\r
-                               mod_.outMod->Write(sample_buffer_, bytes);\r
-                       /* show bitrate */\r
-                       if (flac_cfg.display.show_bps)\r
-                       {\r
-                               const int rate = FLAC_plugin__get_rate(mod_.outMod->GetWrittenTime(), mod_.outMod->GetOutputTime(), &stream_data_);\r
-                               if (rate) mod_.SetInfo(rate/1000, stream_data_.sample_rate/1000, stream_data_.channels, 1);\r
-                       }\r
-               }\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-/*\r
- *  title formatting\r
- */\r
-\r
-static T_CHAR *get_tag(const T_CHAR *tag, void *param)\r
-{\r
-       FLAC__StreamMetadata *tags = (FLAC__StreamMetadata*)param;\r
-       char *tagname, *p;\r
-       T_CHAR *val;\r
-\r
-       if (!tag)\r
-               return 0;\r
-       /* Vorbis comment names must be ASCII, so convert 'tag' first */\r
-       tagname = safe_malloc_add_2op_(wcslen(tag), /*+*/1);\r
-       for(p=tagname;*tag;) {\r
-               if(*tag > 0x7d) {\r
-                       free(tagname);\r
-                       return 0;\r
-               }\r
-               else\r
-                       *p++ = (char)(*tag++);\r
-       }\r
-       *p++ = '\0';\r
-       /* now get it */\r
-       val = FLAC_plugin__tags_get_tag_ucs2(tags, tagname);\r
-       free(tagname);\r
-       /* some "user friendly cheavats" */\r
-       if (!val)\r
-       {\r
-               if (!wcsicmp(tag, L"ARTIST"))\r
-               {\r
-                       val = FLAC_plugin__tags_get_tag_ucs2(tags, "PERFORMER");\r
-                       if (!val) val = FLAC_plugin__tags_get_tag_ucs2(tags, "COMPOSER");\r
-               }\r
-               else if (!wcsicmp(tag, L"YEAR") || !wcsicmp(tag, L"DATE"))\r
-               {\r
-                       val = FLAC_plugin__tags_get_tag_ucs2(tags, "YEAR_RECORDED");\r
-                       if (!val) val = FLAC_plugin__tags_get_tag_ucs2(tags, "YEAR_PERFORMED");\r
-               }\r
-       }\r
-\r
-       return val;\r
-}\r
-\r
-static void free_tag(T_CHAR *tag, void *param)\r
-{\r
-       (void)param;\r
-       free(tag);\r
-}\r
-\r
-static void format_title(const char *filename, WCHAR *title, unsigned max_size)\r
-{\r
-       FLAC__StreamMetadata *tags;\r
-\r
-       ReadTags(filename, &tags, /*forDisplay=*/true);\r
-\r
-       tagz_format(flac_cfg.title.tag_format_w, get_tag, free_tag, tags, title, max_size);\r
-\r
-       FLAC_plugin__tags_destroy(&tags);\r
-}\r
-\r
-static void getfileinfo(char *filename, char *title, int *length_in_msec)\r
-{\r
-       FLAC__StreamMetadata streaminfo;\r
-\r
-       if (!filename || !*filename) {\r
-               filename = lastfn_;\r
-               if (length_in_msec) {\r
-                       *length_in_msec = stream_data_.length_in_msec;\r
-                       length_in_msec = 0;    /* force skip in following code */\r
-               }\r
-       }\r
-\r
-       if (!FLAC__metadata_get_streaminfo(filename, &streaminfo)) {\r
-               if (length_in_msec)\r
-                       *length_in_msec = -1;\r
-               return;\r
-       }\r
-\r
-       if (title) {\r
-               static WCHAR buffer[400];\r
-               format_title(filename, buffer, 400);\r
-               WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, buffer, -1, title, 400, NULL, NULL);\r
-       }\r
-\r
-       if (length_in_msec) {\r
-               /* with VC++ you have to spoon feed it the casting from uint64->int64->double */\r
-               FLAC__uint64 l = (FLAC__uint64)((double)(FLAC__int64)streaminfo.data.stream_info.total_samples / (double)streaminfo.data.stream_info.sample_rate * 1000.0 + 0.5);\r
-               if (l > INT_MAX)\r
-                       l = INT_MAX;\r
-               *length_in_msec = (int)l;\r
-       }\r
-}\r
-\r
-/*\r
- *  interface\r
- */\r
-\r
-void FLAC_plugin__show_error(const char *message,...)\r
-{\r
-       char foo[512];\r
-       va_list args;\r
-       va_start(args, message);\r
-       vsprintf(foo, message, args);\r
-       va_end(args);\r
-       MessageBox(mod_.hMainWindow, foo, "FLAC Plug-in Error", MB_ICONSTOP);\r
-}\r
-\r
-static void about(HWND hwndParent)\r
-{\r
-       MessageBox(hwndParent, "Winamp2 FLAC Plugin v"PLUGIN_VERSION"\nby Josh Coalson and X-Fixer\n\nuses libFLAC "VERSION"\nSee http://flac.sourceforge.net/\n", "About FLAC Plugin", MB_ICONINFORMATION);\r
-}\r
-\r
-static void config(HWND hwndParent)\r
-{\r
-       if (DoConfig(mod_.hDllInstance, hwndParent))\r
-               WriteConfig();\r
-}\r
-\r
-static int infobox(char *fn, HWND hwnd)\r
-{\r
-       DoInfoBox(mod_.hDllInstance, hwnd, fn);\r
-       return 0;\r
-}\r
-\r
-/*\r
- *  exported stuff\r
- */\r
-\r
-static In_Module mod_ =\r
-{\r
-       IN_VER,\r
-       "FLAC Decoder v" PLUGIN_VERSION,\r
-       0,                                    /* hMainWindow */\r
-       0,                                    /* hDllInstance */\r
-       "FLAC\0FLAC Audio File (*.FLAC)\0",\r
-       1,                                    /* is_seekable */\r
-       1,                                    /* uses output */\r
-       config,\r
-       about,\r
-       init,\r
-       quit,\r
-       getfileinfo,\r
-       infobox,\r
-       isourfile,\r
-       play,\r
-       pause,\r
-       unpause,\r
-       ispaused,\r
-       stop,\r
-\r
-       getlength,\r
-       getoutputtime,\r
-       setoutputtime,\r
-\r
-       setvolume,\r
-       setpan,\r
-\r
-       0,0,0,0,0,0,0,0,0,                    /* vis stuff */\r
-       0,0,                                  /* dsp */\r
-       eq_set,\r
-       NULL,                                 /* setinfo */\r
-       0                                     /* out_mod */\r
-};\r
-\r
-__declspec(dllexport) In_Module *winampGetInModule2()\r
-{\r
-       return &mod_;\r
-}\r
-\r
-BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\r
-{\r
-       return TRUE;\r
-}\r
diff --git a/src/plugin_winamp2/in_flac.dsp b/src/plugin_winamp2/in_flac.dsp
deleted file mode 100644 (file)
index 8c813d4..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-# Microsoft Developer Studio Project File - Name="in_flac" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
-\r
-CFG=in_flac - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "in_flac.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "in_flac.mak" CFG="in_flac - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "in_flac - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "in_flac - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName "$/Studio/in_flac"\r
-# PROP Scc_LocalPath "."\r
-CPP=cl.exe\r
-MTL=midl.exe\r
-RSC=rc.exe\r
-\r
-!IF  "$(CFG)" == "in_flac - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "in_flac_EXPORTS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /WX /GX /Ox /Og /Oi /Os /Op /Gf /Gy /I "include" /I ".." /I "..\..\include" /D "NDEBUG" /D VERSION=\"1.2.1\" /D "in_flac_EXPORTS" /D "FLAC__NO_DLL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TAGZ_UNICODE" /YX /FD /c\r
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
-# ADD RSC /l 0x409 /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
-# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /machine:I386 /out:"../../obj/release/bin/in_flac.dll" /libpath:"../../obj/release/lib" ..\..\obj\release\lib\ogg_static.lib /opt:nowin98\r
-# SUBTRACT LINK32 /pdb:none\r
-\r
-!ELSEIF  "$(CFG)" == "in_flac - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "in_flac_EXPORTS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I ".." /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "REAL_STDIO" /D VERSION=\"1.2.1\" /D "in_flac_EXPORTS" /D "FLAC__NO_DLL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TAGZ_UNICODE" /YX /FD /GZ /c\r
-# SUBTRACT CPP /WX\r
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
-# ADD RSC /l 0x409 /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /out:"../../obj/debug/bin/in_flac.dll" /pdbtype:sept /libpath:"../../obj/debug/lib" ..\..\obj\release\lib\ogg_static.lib\r
-# SUBTRACT LINK32 /pdb:none\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "in_flac - Win32 Release"\r
-# Name "in_flac - Win32 Debug"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Group "Winamp2 SDK"\r
-\r
-# PROP Default_Filter ""\r
-# Begin Source File\r
-\r
-SOURCE=.\include\winamp2\in2.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\include\winamp2\out.h\r
-# End Source File\r
-# End Group\r
-# Begin Source File\r
-\r
-SOURCE=.\configure.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\configure.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\in_flac.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\infobox.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\infobox.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\playback.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\playback.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\resource.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\resource.rc\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\tagz.cpp\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\tagz.h\r
-# End Source File\r
-# End Group\r
-# End Target\r
-# End Project\r
diff --git a/src/plugin_winamp2/in_flac.vcproj b/src/plugin_winamp2/in_flac.vcproj
deleted file mode 100644 (file)
index c3d328f..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8.00"\r
-       Name="in_flac"\r
-       ProjectGUID="{4cefbc82-c215-11db-8314-0800200c9a66}"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="..\..\obj\debug\lib"\r
-                       IntermediateDirectory="Debug_dynamic"\r
-                       ConfigurationType="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories=".\include;..;..\..\include"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IN_FLAC_EXPORTS;FLAC__NO_DLL;VERSION=\&quot;1.2.0\&quot;;TAGZ_UNICODE;DEBUG"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="4"\r
-                               DisableSpecificWarnings="4267;4996"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include&quot;"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib user32.lib"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib"\r
-                               IgnoreDefaultLibraryNames="uuid.lib"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="..\..\obj\release\lib"\r
-                       IntermediateDirectory="Release_dynamic"\r
-                       ConfigurationType="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               EnableIntrinsicFunctions="true"\r
-                               FavorSizeOrSpeed="1"\r
-                               OmitFramePointers="true"\r
-                               WholeProgramOptimization="true"\r
-                               AdditionalIncludeDirectories=".\include;..;..\..\include"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IN_FLAC_EXPORTS;FLAC__NO_DLL;VERSION=\&quot;1.2.0\&quot;;TAGZ_UNICODE"\r
-                               RuntimeLibrary="0"\r
-                               BufferSecurityCheck="false"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="3"\r
-                               DisableSpecificWarnings="4267;4996"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include&quot;"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib user32.lib"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib"\r
-                               IgnoreDefaultLibraryNames="uuid.lib"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               LinkTimeCodeGeneration="1"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\configure.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\include\winamp2\in2.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\infobox.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\include\winamp2\out.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\playback.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\resource.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\tagz.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\resource.rc"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\configure.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\in_flac.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\infobox.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\playback.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\tagz.cpp"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/src/plugin_winamp2/include/Makefile.am b/src/plugin_winamp2/include/Makefile.am
deleted file mode 100644 (file)
index dedd85d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#  in_flac - Winamp2 FLAC input plugin
-#  Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library 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
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-SUBDIRS = winamp2
diff --git a/src/plugin_winamp2/include/winamp2/Makefile.am b/src/plugin_winamp2/include/winamp2/Makefile.am
deleted file mode 100644 (file)
index 6f5a3c4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#  in_flac - Winamp2 FLAC input plugin
-#  Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library 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
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-EXTRA_DIST = \
-       in2.h \
-       out.h
diff --git a/src/plugin_winamp2/include/winamp2/in2.h b/src/plugin_winamp2/include/winamp2/in2.h
deleted file mode 100644 (file)
index 46e22f0..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Standard Winamp input-plugin header
- */
-
-#include "out.h"
-
-/* post this to the main window at end of file (after playback as stopped) */\r
-#define WM_WA_MPEG_EOF          (WM_USER + 2)\r
-\r
-// note: exported symbol is now winampGetInModule2.
-
-#define IN_VER 0x100
-
-typedef struct
-{
-       int version;                            // module type (IN_VER)
-       char *description;                      // description of module, with version string
-
-       HWND hMainWindow;                       // winamp's main window (filled in by winamp)
-       HINSTANCE hDllInstance;         // DLL instance handle (Also filled in by winamp)
-
-       char *FileExtensions;           // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
-                                                               // May be altered from Config, so the user can select what they want
-
-       int is_seekable;                        // is this stream seekable?
-       int UsesOutputPlug;                     // does this plug-in use the output plug-ins? (musn't ever change, ever :)
-
-       void (*Config)(HWND hwndParent); // configuration dialog
-       void (*About)(HWND hwndParent);  // about dialog
-
-       void (*Init)();                         // called at program init
-       void (*Quit)();                         // called at program quit
-
-       void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used
-       int (*InfoBox)(char *file, HWND hwndParent);
-
-       int (*IsOurFile)(char *fn);     // called before extension checks, to allow detection of mms://, etc
-       // playback stuff
-       int (*Play)(char *fn);          // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
-       void (*Pause)();                        // pause stream
-       void (*UnPause)();                      // unpause stream
-       int (*IsPaused)();                      // ispaused? return 1 if paused, 0 if not
-       void (*Stop)();                         // stop (unload) stream
-
-       // time stuff
-       int (*GetLength)();                     // get length in ms
-       int (*GetOutputTime)();         // returns current output time in ms. (usually returns outMod->GetOutputTime()
-       void (*SetOutputTime)(int time_in_ms);  // seeks to point in stream (in ms). Usually you signal yoru thread to seek, which seeks and calls outMod->Flush()..
-
-       // volume stuff
-       void (*SetVolume)(int volume);  // from 0 to 255.. usually just call outMod->SetVolume
-       void (*SetPan)(int pan);        // from -127 to 127.. usually just call outMod->SetPan
-
-       // in-window builtin vis stuff
-
-       void (*SAVSAInit)(int maxlatency_in_ms, int srate);             // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
-       // call after opening audio device with max latency in ms and samplerate
-       void (*SAVSADeInit)();  // call in Stop()
-
-
-       // simple vis supplying mode
-       void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
-                                                                                       // sets the spec data directly from PCM data
-                                                                                       // quick and easy way to get vis working :)
-                                                                                       // needs at least 576 samples :)
-
-       // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
-       int (*SAGetMode)();             // gets csa (the current type (4=ws,2=osc,1=spec))
-                                                       // use when calling SAAdd()
-       void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
-
-
-       // vis stuff (plug-in)
-       // simple vis supplying mode
-       void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
-                                                                                       // quick and easy way to get vis working :)
-                                                                                       // needs at least 576 samples :)
-
-       // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
-       int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
-       void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
-
-
-       // call this in Play() to tell the vis plug-ins the current output params.
-       void (*VSASetInfo)(int nch, int srate);
-
-
-       // dsp plug-in processing:
-       // (filled in by winamp, called by input plug)
-
-       // returns 1 if active (which means that the number of samples returned by dsp_dosamples
-       // could be greater than went in.. Use it to estimate if you'll have enough room in the
-       // output buffer
-       int (*dsp_isactive)();
-
-       // returns number of samples to output. This can be as much as twice numsamples.
-       // be sure to allocate enough buffer for samples, then.
-       int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
-
-
-       // eq stuff
-       void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.
-
-       // info setting (filled in by winamp)
-       void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
-
-       Out_Module *outMod; // filled in by winamp, optionally used :)
-} In_Module;
diff --git a/src/plugin_winamp2/include/winamp2/out.h b/src/plugin_winamp2/include/winamp2/out.h
deleted file mode 100644 (file)
index e8ad412..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Standard Winamp output-plugin header
- */
-
-#define OUT_VER 0x10
-
-typedef struct
-{
-       int version;                            // module version (OUT_VER)
-       char *description;                      // description of module, with version string
-       int id;                                         // module id. each input module gets its own. non-nullsoft modules should
-                                                               // be >= 65536.
-
-       HWND hMainWindow;                       // winamp's main window (filled in by winamp)
-       HINSTANCE hDllInstance;         // DLL instance handle (filled in by winamp)
-
-       void (*Config)(HWND hwndParent); // configuration dialog
-       void (*About)(HWND hwndParent);  // about dialog
-
-       void (*Init)();                         // called when loaded
-       void (*Quit)();                         // called when unloaded
-
-       int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
-                                       // returns >=0 on success, <0 on failure
-                                       // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
-                                       //    ... so don't expect the max latency returned to be what you asked for.
-                                       // returns max latency in ms (0 for diskwriters, etc)
-                                       // bufferlenms and prebufferms must be in ms. 0 to use defaults.
-                                       // prebufferms must be <= bufferlenms
-
-       void (*Close)();        // close the ol' output device.
-
-       int (*Write)(char *buf, int len);
-                                       // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
-                                       // 1 returns not able to write (yet). Non-blocking, always.
-
-       int (*CanWrite)();      // returns number of bytes possible to write at a given time.
-                                               // Never will decrease unless you call Write (or Close, heh)
-
-       int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
-                                               // written (i.e. closing while IsPlaying() returns 1 would truncate the song
-
-       int (*Pause)(int pause); // returns previous pause state
-
-       void (*SetVolume)(int volume); // volume is 0-255
-       void (*SetPan)(int pan); // pan is -128 to 128
-
-       void (*Flush)(int t);   // flushes buffers and restarts output at time t (in ms)
-                                                       // (used for seeking)
-
-       int (*GetOutputTime)(); // returns played time in MS
-       int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
-
-} Out_Module;
-
-
diff --git a/src/plugin_winamp2/infobox.c b/src/plugin_winamp2/infobox.c
deleted file mode 100644 (file)
index 48b0879..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#if HAVE_CONFIG_H\r
-#  include <config.h>\r
-#endif\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "FLAC/all.h"\r
-#include "share/alloc.h"\r
-#include "plugin_common/all.h"\r
-#include "infobox.h"\r
-#include "configure.h"\r
-#include "resource.h"\r
-\r
-\r
-typedef struct\r
-{\r
-       char filename[MAX_PATH];\r
-       FLAC__StreamMetadata *tags;\r
-} LOCALDATA;\r
-\r
-static char buffer[8192];\r
-static char *genres = NULL;\r
-static DWORD genresSize = 0, genresCount = 0;\r
-static BOOL genresChanged = FALSE, isNT;\r
-\r
-static const char infoTitle[] = "FLAC File Info";\r
-\r
-/*\r
- *  Genres\r
- */\r
-\r
-/* TODO: write genres in utf-8 ? */\r
-\r
-static __inline int GetGenresFileName(char *buffer, int size)\r
-{\r
-       char *c;\r
-\r
-       if (!GetModuleFileName(NULL, buffer, size))\r
-               return 0;\r
-       c = strrchr(buffer, '\\');\r
-       if (!c) return 0;\r
-       strcpy(c+1, "genres.txt");\r
-\r
-       return 1;\r
-}\r
-\r
-static void LoadGenres()\r
-{\r
-       HANDLE hFile;\r
-       DWORD  spam;\r
-       char  *c;\r
-\r
-       FLAC__ASSERT(0 != genres);\r
-\r
-       if (!GetGenresFileName(buffer, sizeof(buffer))) return;\r
-       /* load file */\r
-       hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\r
-       if (hFile == INVALID_HANDLE_VALUE) return;\r
-       genresSize = GetFileSize(hFile, 0);\r
-       if (genresSize && (genres = (char*)safe_malloc_add_2op_(genresSize, /*+*/2)))\r
-       {\r
-               if (!ReadFile(hFile, genres, genresSize, &spam, NULL) || spam!=genresSize)\r
-               {\r
-                       free(genres);\r
-                       genres = NULL;\r
-               }\r
-               else\r
-               {\r
-                       genres[genresSize] = 0;\r
-                       genres[genresSize+1] = 0;\r
-                       /* replace newlines */\r
-                       genresChanged = FALSE;\r
-                       genresCount = 1;\r
-\r
-                       for (c=genres; *c; c++)\r
-                       {\r
-                               if (*c == 10)\r
-                               {\r
-                                       *c = 0;\r
-                                       if (*(c+1))\r
-                                               genresCount++;\r
-                                       else genresSize--;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-\r
-       CloseHandle(hFile);\r
-}\r
-\r
-static void SaveGenres(HWND hlist)\r
-{\r
-       HANDLE hFile;\r
-       DWORD  spam;\r
-       int i, count, len;\r
-\r
-       if (!GetGenresFileName(buffer, sizeof(buffer))) return;\r
-       /* write file */\r
-       hFile = CreateFile(buffer, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\r
-       if (hFile == INVALID_HANDLE_VALUE) return;\r
-\r
-       count = SendMessage(hlist, CB_GETCOUNT, 0, 0);\r
-       for (i=0; i<count; i++)\r
-       {\r
-               SendMessage(hlist, CB_GETLBTEXT, i, (LPARAM)buffer);\r
-               len = strlen(buffer);\r
-               if (i != count-1)\r
-               {\r
-                       buffer[len] = 10;\r
-                       len++;\r
-               }\r
-               WriteFile(hFile, buffer, len, &spam, NULL);\r
-       }\r
-\r
-       CloseHandle(hFile);\r
-}\r
-\r
-static void AddGenre(HWND hwnd, const char *genre)\r
-{\r
-       HWND hgen = GetDlgItem(hwnd, IDC_GENRE);\r
-\r
-       if (SendMessage(hgen, CB_FINDSTRINGEXACT, -1, (LPARAM)genre) == CB_ERR)\r
-       {\r
-               genresChanged = TRUE;\r
-               SendMessage(hgen, CB_ADDSTRING, 0, (LPARAM)genre);\r
-       }\r
-}\r
-\r
-static void InitGenres(HWND hwnd)\r
-{\r
-       HWND hgen = GetDlgItem(hwnd, IDC_GENRE);\r
-       char *c;\r
-\r
-       /* set text length limit to 64 chars */\r
-       SendMessage(hgen, CB_LIMITTEXT, 64, 0);\r
-       /* try to load genres */\r
-       if (!genres)\r
-               LoadGenres(hgen);\r
-       /* add the to list */\r
-       if (genres)\r
-       {\r
-               SendMessage(hgen, CB_INITSTORAGE, genresCount, genresSize);\r
-\r
-               for (c = genres; *c; c += strlen(c)+1)\r
-                       SendMessage(hgen, CB_ADDSTRING, 0, (LPARAM)c);\r
-       }\r
-}\r
-\r
-static void DeinitGenres(HWND hwnd, BOOL final)\r
-{\r
-       if (genresChanged && hwnd)\r
-       {\r
-               SaveGenres(GetDlgItem(hwnd, IDC_GENRE));\r
-               genresChanged = FALSE;\r
-               final = TRUE;\r
-       }\r
-       if (final)\r
-       {\r
-               free(genres);\r
-               genres = 0;\r
-       }\r
-}\r
-\r
-static wchar_t *AnsiToWide(const char *src)\r
-{\r
-       int len;\r
-       wchar_t *dest;\r
-\r
-       FLAC__ASSERT(0 != src);\r
-\r
-       len = strlen(src) + 1;\r
-       /* copy */\r
-       dest = (wchar_t*)safe_malloc_mul_2op_(len, /*times*/sizeof(wchar_t));\r
-       if (dest) mbstowcs(dest, src, len);\r
-       return dest;\r
-}\r
-\r
-/*\r
- *  Infobox helpers\r
- */\r
-\r
-#define SetText(x,y)            ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, y); \\r
-                                WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ucs2, -1, buffer, sizeof(buffer), NULL, NULL); \\r
-                                if(ucs2) free(ucs2); \\r
-                                SetDlgItemText(hwnd, x, buffer)\r
-\r
-#define GetText(x,y)            GetDlgItemText(hwnd, x, buffer, sizeof(buffer));                        \\r
-                                if (*buffer) { ucs2 = AnsiToWide(buffer); FLAC_plugin__tags_set_tag_ucs2(data->tags, y, ucs2, /*replace_all=*/false); free(ucs2); } \\r
-                                else FLAC_plugin__tags_delete_tag(data->tags, y)\r
-\r
-#define SetTextW(x,y)           ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, y); \\r
-                                SetDlgItemTextW(hwnd, x, ucs2); \\r
-                                free(ucs2)\r
-\r
-#define GetTextW(x,y)           GetDlgItemTextW(hwnd, x, (WCHAR*)buffer, sizeof(buffer)/2);                     \\r
-                                if (*(WCHAR*)buffer) FLAC_plugin__tags_set_tag_ucs2(data->tags, y, (WCHAR*)buffer, /*replace_all=*/false); \\r
-                                else FLAC_plugin__tags_delete_tag(data->tags, y)\r
-\r
-\r
-static BOOL InitInfoboxInfo(HWND hwnd, const char *file)\r
-{\r
-       LOCALDATA *data = LocalAlloc(LPTR, sizeof(LOCALDATA));\r
-       wchar_t *ucs2;\r
-       FLAC__StreamMetadata streaminfo;\r
-       DWORD    length, bps, ratio, rg;\r
-       LONGLONG filesize;\r
-\r
-       SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);\r
-       /* file name */\r
-       strncpy(data->filename, file, sizeof(data->filename));\r
-       SetDlgItemText(hwnd, IDC_NAME, file);\r
-       /* stream data and vorbis comment */\r
-       filesize = FileSize(file);\r
-       if (!filesize) return FALSE;\r
-       if (!FLAC__metadata_get_streaminfo(file, &streaminfo))\r
-               return FALSE;\r
-       ReadTags(file, &data->tags, false);\r
-\r
-       length = (DWORD)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate);\r
-       bps = (DWORD)(filesize / (125*streaminfo.data.stream_info.total_samples/streaminfo.data.stream_info.sample_rate));\r
-       ratio = bps*1000000 / (streaminfo.data.stream_info.sample_rate*streaminfo.data.stream_info.channels*streaminfo.data.stream_info.bits_per_sample);\r
-       rg  = FLAC_plugin__tags_get_tag_utf8(data->tags, "REPLAYGAIN_TRACK_GAIN") ? 1 : 0;\r
-       rg |= FLAC_plugin__tags_get_tag_utf8(data->tags, "REPLAYGAIN_ALBUM_GAIN") ? 2 : 0;\r
-\r
-       sprintf(buffer, "Sample rate: %d Hz\nChannels: %d\nBits per sample: %d\nMin block size: %d\nMax block size: %d\n"\r
-                       "File size: %I64d bytes\nTotal samples: %I64d\nLength: %d:%02d\nAvg. bitrate: %d\nCompression ratio: %d.%d%%\n"\r
-                       "ReplayGain: %s\n",\r
-           streaminfo.data.stream_info.sample_rate, streaminfo.data.stream_info.channels, streaminfo.data.stream_info.bits_per_sample,\r
-           streaminfo.data.stream_info.min_blocksize, streaminfo.data.stream_info.max_blocksize, filesize, streaminfo.data.stream_info.total_samples,\r
-           length/60, length%60, bps, ratio/10, ratio%10,\r
-           rg==3 ? "track gain\nReplayGain: album gain" : rg==2 ? "album gain" : rg==1 ? "track gain" : "not present");\r
-\r
-       SetDlgItemText(hwnd, IDC_INFO, buffer);\r
-       /* tag */\r
-       if (isNT)\r
-       {\r
-               SetTextW(IDC_TITLE,   "TITLE");\r
-               SetTextW(IDC_ARTIST,  "ARTIST");\r
-               SetTextW(IDC_ALBUM,   "ALBUM");\r
-               SetTextW(IDC_COMMENT, "COMMENT");\r
-               SetTextW(IDC_YEAR,    "DATE");\r
-               SetTextW(IDC_TRACK,   "TRACKNUMBER");\r
-               SetTextW(IDC_GENRE,   "GENRE");\r
-       }\r
-       else\r
-       {\r
-               SetText(IDC_TITLE,   "TITLE");\r
-               SetText(IDC_ARTIST,  "ARTIST");\r
-               SetText(IDC_ALBUM,   "ALBUM");\r
-               SetText(IDC_COMMENT, "COMMENT");\r
-               SetText(IDC_YEAR,    "DATE");\r
-               SetText(IDC_TRACK,   "TRACKNUMBER");\r
-               SetText(IDC_GENRE,   "GENRE");\r
-       }\r
-\r
-       return TRUE;\r
-}\r
-\r
-static void __inline SetTag(HWND hwnd, const char *filename, FLAC__StreamMetadata *tags)\r
-{\r
-       strcpy(buffer, infoTitle);\r
-\r
-       if (FLAC_plugin__tags_set(filename, tags))\r
-               strcat(buffer, " [Updated]");\r
-       else strcat(buffer, " [Failed]");\r
-\r
-       SetWindowText(hwnd, buffer);\r
-}\r
-\r
-static void UpdateTag(HWND hwnd)\r
-{\r
-       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-       wchar_t *ucs2;\r
-\r
-       /* get fields */\r
-       if (isNT)\r
-       {\r
-               GetTextW(IDC_TITLE,   "TITLE");\r
-               GetTextW(IDC_ARTIST,  "ARTIST");\r
-               GetTextW(IDC_ALBUM,   "ALBUM");\r
-               GetTextW(IDC_COMMENT, "COMMENT");\r
-               GetTextW(IDC_YEAR,    "DATE");\r
-               GetTextW(IDC_TRACK,   "TRACKNUMBER");\r
-               GetTextW(IDC_GENRE,   "GENRE");\r
-\r
-               ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, "GENRE");\r
-               WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ucs2, -1, buffer, sizeof(buffer), NULL, NULL);\r
-               free(ucs2);\r
-       }\r
-       else\r
-       {\r
-               GetText(IDC_TITLE,   "TITLE");\r
-               GetText(IDC_ARTIST,  "ARTIST");\r
-               GetText(IDC_ALBUM,   "ALBUM");\r
-               GetText(IDC_COMMENT, "COMMENT");\r
-               GetText(IDC_YEAR,    "DATE");\r
-               GetText(IDC_TRACK,   "TRACKNUMBER");\r
-               GetText(IDC_GENRE,   "GENRE");\r
-       }\r
-\r
-       /* update genres list (buffer should contain genre) */\r
-       if (buffer[0]) AddGenre(hwnd, buffer);\r
-\r
-       /* write tag */\r
-       SetTag(hwnd, data->filename, data->tags);\r
-}\r
-\r
-static void RemoveTag(HWND hwnd)\r
-{\r
-       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-       FLAC_plugin__tags_delete_all(data->tags);\r
-\r
-       SetDlgItemText(hwnd, IDC_TITLE,   "");\r
-       SetDlgItemText(hwnd, IDC_ARTIST,  "");\r
-       SetDlgItemText(hwnd, IDC_ALBUM,   "");\r
-       SetDlgItemText(hwnd, IDC_COMMENT, "");\r
-       SetDlgItemText(hwnd, IDC_YEAR,    "");\r
-       SetDlgItemText(hwnd, IDC_TRACK,   "");\r
-       SetDlgItemText(hwnd, IDC_GENRE,   "");\r
-\r
-       SetTag(hwnd, data->filename, data->tags);\r
-}\r
-\r
-\r
-static INT_PTR CALLBACK InfoProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
-{\r
-       switch (msg)\r
-       {\r
-       /* init */\r
-       case WM_INITDIALOG:\r
-               SetWindowText(hwnd, infoTitle);\r
-               InitGenres(hwnd);\r
-               /* init fields */\r
-               if (!InitInfoboxInfo(hwnd, (const char*)lParam))\r
-                       PostMessage(hwnd, WM_CLOSE, 0, 0);\r
-               return TRUE;\r
-       /* destroy */\r
-       case WM_DESTROY:\r
-               {\r
-                       LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-                       FLAC_plugin__tags_destroy(&data->tags);\r
-                       LocalFree(data);\r
-                       DeinitGenres(hwnd, FALSE);\r
-               }\r
-               break;\r
-       /* commands */\r
-       case WM_COMMAND:\r
-               switch (LOWORD(wParam))\r
-               {\r
-               /* ok/cancel */\r
-               case IDOK:\r
-               case IDCANCEL:\r
-                       EndDialog(hwnd, LOWORD(wParam));\r
-                       return TRUE;\r
-               /* save */\r
-               case IDC_UPDATE:\r
-                       UpdateTag(hwnd);\r
-                       break;\r
-               /* remove */\r
-               case IDC_REMOVE:\r
-                       RemoveTag(hwnd);\r
-                       break;\r
-               }\r
-               break;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-/*\r
- *  Helpers\r
- */\r
-\r
-ULONGLONG FileSize(const char *fileName)\r
-{\r
-       LARGE_INTEGER res;\r
-       HANDLE hFile = CreateFile(fileName, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\r
-\r
-       if (hFile == INVALID_HANDLE_VALUE) return 0;\r
-       res.LowPart = GetFileSize(hFile, &res.HighPart);\r
-       CloseHandle(hFile);\r
-       return res.QuadPart;\r
-}\r
-\r
-static __inline char *GetFileName(const char *fullname)\r
-{\r
-       const char *c = fullname + strlen(fullname) - 1;\r
-\r
-       while (c > fullname)\r
-       {\r
-               if (*c=='\\' || *c=='/')\r
-               {\r
-                       c++;\r
-                       break;\r
-               }\r
-               c--;\r
-       }\r
-\r
-       return (char*)c;\r
-}\r
-\r
-void ReadTags(const char *fileName, FLAC__StreamMetadata **tags, BOOL forDisplay)\r
-{\r
-       if(FLAC_plugin__tags_get(fileName, tags)) {\r
-\r
-               /* add file name */\r
-               if (forDisplay)\r
-               {\r
-                       char *c;\r
-                       wchar_t *ucs2;\r
-                       ucs2 = AnsiToWide(fileName);\r
-                       FLAC_plugin__tags_set_tag_ucs2(*tags, "filepath", ucs2, /*replace_all=*/true);\r
-                       free(ucs2);\r
-\r
-                       strcpy(buffer, GetFileName(fileName));\r
-                       if (c = strrchr(buffer, '.')) *c = 0;\r
-                       ucs2 = AnsiToWide(buffer);\r
-                       FLAC_plugin__tags_set_tag_ucs2(*tags, "filename", ucs2, /*replace_all=*/true);\r
-                       free(ucs2);\r
-               }\r
-       }\r
-}\r
-\r
-/*\r
- *  Front-end\r
- */\r
-\r
-void InitInfobox()\r
-{\r
-       isNT = !(GetVersion() & 0x80000000);\r
-}\r
-\r
-void DeinitInfobox()\r
-{\r
-       DeinitGenres(NULL, true);\r
-}\r
-\r
-void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename)\r
-{\r
-       DialogBoxParam(inst, MAKEINTRESOURCE(IDD_INFOBOX), hwnd, InfoProc, (LONG)filename);\r
-}\r
diff --git a/src/plugin_winamp2/infobox.h b/src/plugin_winamp2/infobox.h
deleted file mode 100644 (file)
index d5a1c17..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-/*\r
- *  prototypes\r
- */\r
-\r
-ULONGLONG FileSize(const char *fileName);\r
-void ReadTags(const char *fileName, FLAC__StreamMetadata **tags, BOOL forDisplay);\r
-\r
-void InitInfobox();\r
-void DeinitInfobox();\r
-void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename);\r
diff --git a/src/plugin_winamp2/playback.c b/src/plugin_winamp2/playback.c
deleted file mode 100644 (file)
index 89bb0a4..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#if HAVE_CONFIG_H\r
-#  include <config.h>\r
-#endif\r
-\r
-#include <limits.h> /* for INT_MAX */\r
-#include <stdlib.h>\r
-#include <string.h> /* for memmove() */\r
-#include "playback.h"\r
-#include "share/grabbag.h"\r
-\r
-\r
-static FLAC__int32 reservoir_[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS][FLAC__MAX_BLOCK_SIZE * 2/*for overflow*/];\r
-static FLAC__int32 *reservoir__[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS] = { reservoir_[0], reservoir_[1] }; /*@@@ kind of a hard-coded hack */\r
-static unsigned wide_samples_in_reservoir_;\r
-static output_config_t cfg;     /* local copy */\r
-\r
-static unsigned bh_index_last_w, bh_index_last_o, written_time_last;\r
-static FLAC__int64 decode_position, decode_position_last;\r
-\r
-/*\r
- *  callbacks\r
- */\r
-\r
-static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)\r
-{\r
-       stream_data_struct *stream_data = (stream_data_struct*)client_data;\r
-       const unsigned channels = stream_data->channels, wide_samples = frame->header.blocksize;\r
-       unsigned channel;\r
-\r
-       (void)decoder;\r
-\r
-       if (stream_data->abort_flag)\r
-               return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;\r
-\r
-       for (channel = 0; channel < channels; channel++)\r
-               memcpy(&reservoir_[channel][wide_samples_in_reservoir_], buffer[channel], sizeof(buffer[0][0]) * wide_samples);\r
-\r
-       wide_samples_in_reservoir_ += wide_samples;\r
-\r
-       return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;\r
-}\r
-\r
-static void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)\r
-{\r
-       stream_data_struct *stream_data = (stream_data_struct*)client_data;\r
-       (void)decoder;\r
-\r
-       if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO)\r
-       {\r
-               stream_data->total_samples = metadata->data.stream_info.total_samples;\r
-               stream_data->bits_per_sample = metadata->data.stream_info.bits_per_sample;\r
-               stream_data->channels = metadata->data.stream_info.channels;\r
-               stream_data->sample_rate = metadata->data.stream_info.sample_rate;\r
-\r
-               if (stream_data->bits_per_sample!=8 && stream_data->bits_per_sample!=16 && stream_data->bits_per_sample!=24)\r
-               {\r
-                       FLAC_plugin__show_error("This plugin can only handle 8/16/24-bit samples.");\r
-                       stream_data->abort_flag = true;\r
-                       return;\r
-               }\r
-\r
-               {\r
-                       /* with VC++ you have to spoon feed it the casting from uint64->int64->double */\r
-                       FLAC__uint64 l = (FLAC__uint64)((double)(FLAC__int64)stream_data->total_samples / (double)stream_data->sample_rate * 1000.0 + 0.5);\r
-                       if (l > INT_MAX)\r
-                               l = INT_MAX;\r
-                       stream_data->length_in_msec = (int)l;\r
-               }\r
-       }\r
-       else if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT)\r
-       {\r
-               double reference, gain, peak;\r
-               if (grabbag__replaygain_load_from_vorbiscomment(metadata, cfg.replaygain.album_mode, /*strict=*/false, &reference, &gain, &peak))\r
-               {\r
-                       stream_data->has_replaygain = true;\r
-                       stream_data->replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)cfg.replaygain.preamp, !cfg.replaygain.hard_limit);\r
-               }\r
-       }\r
-}\r
-\r
-static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)\r
-{\r
-       stream_data_struct *stream_data = (stream_data_struct*)client_data;\r
-       (void)decoder;\r
-\r
-       if (cfg.misc.stop_err || status!=FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)\r
-               stream_data->abort_flag = true;\r
-}\r
-\r
-/*\r
- *  init/delete\r
- */\r
-\r
-FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *filename, FLAC__int64 filesize, stream_data_struct *stream_data, output_config_t *config)\r
-{\r
-       FLAC__StreamDecoderInitStatus init_status;\r
-\r
-       FLAC__ASSERT(decoder);\r
-       FLAC_plugin__decoder_finish(decoder);\r
-       /* init decoder */\r
-       FLAC__stream_decoder_set_md5_checking(decoder, false);\r
-       FLAC__stream_decoder_set_metadata_ignore_all(decoder);\r
-       FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);\r
-       FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);\r
-\r
-       if ((init_status = FLAC__stream_decoder_init_file(decoder, filename, write_callback, metadata_callback, error_callback, /*client_data=*/stream_data)) != FLAC__STREAM_DECODER_INIT_STATUS_OK)\r
-       {\r
-               FLAC_plugin__show_error("Error while initializing decoder (%s [%s]).", FLAC__StreamDecoderInitStatusString[init_status], FLAC__stream_decoder_get_resolved_state_string(decoder));\r
-               return false;\r
-       }\r
-       /* process */\r
-       cfg = *config;\r
-       wide_samples_in_reservoir_ = 0;\r
-       stream_data->is_playing = false;\r
-       stream_data->abort_flag = false;\r
-       stream_data->has_replaygain = false;\r
-\r
-       if (!FLAC__stream_decoder_process_until_end_of_metadata(decoder))\r
-       {\r
-               FLAC_plugin__show_error("Error while processing metadata (%s).", FLAC__stream_decoder_get_resolved_state_string(decoder));\r
-               return false;\r
-       }\r
-       /* check results */\r
-       if (stream_data->abort_flag) return false;                /* metadata callback already popped up the error dialog */\r
-       /* init replaygain */\r
-       stream_data->output_bits_per_sample = stream_data->has_replaygain && cfg.replaygain.enable ?\r
-               cfg.resolution.replaygain.bps_out :\r
-               cfg.resolution.normal.dither_24_to_16 ? min(stream_data->bits_per_sample, 16) : stream_data->bits_per_sample;\r
-\r
-       if (stream_data->has_replaygain && cfg.replaygain.enable && cfg.resolution.replaygain.dither)\r
-               FLAC__replaygain_synthesis__init_dither_context(&stream_data->dither_context, stream_data->bits_per_sample, cfg.resolution.replaygain.noise_shaping);\r
-       /* more inits */\r
-       stream_data->eof = false;\r
-       stream_data->seek_to = -1;\r
-       stream_data->is_playing = true;\r
-       stream_data->average_bps = (unsigned)(filesize / (125.*(double)(FLAC__int64)stream_data->total_samples/(double)stream_data->sample_rate));\r
-       \r
-       bh_index_last_w = 0;\r
-       bh_index_last_o = BITRATE_HIST_SIZE;\r
-       decode_position = 0;\r
-       decode_position_last = 0;\r
-       written_time_last = 0;\r
-\r
-       return true;\r
-}\r
-\r
-void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder)\r
-{\r
-       if (decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)\r
-               (void)FLAC__stream_decoder_finish(decoder);\r
-}\r
-\r
-void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder)\r
-{\r
-       if (decoder)\r
-       {\r
-               FLAC_plugin__decoder_finish(decoder);\r
-               FLAC__stream_decoder_delete(decoder);\r
-       }\r
-}\r
-\r
-/*\r
- *  decode\r
- */\r
-\r
-int FLAC_plugin__seek(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data)\r
-{\r
-       int pos;\r
-       FLAC__uint64 target_sample = stream_data->total_samples * stream_data->seek_to / stream_data->length_in_msec;\r
-\r
-       if (stream_data->total_samples > 0 && target_sample >= stream_data->total_samples && target_sample > 0)\r
-               target_sample = stream_data->total_samples - 1;\r
-\r
-       /* even if the seek fails we have to reset these so that we don't repeat the seek */\r
-       stream_data->seek_to = -1;\r
-       stream_data->eof = false;\r
-       wide_samples_in_reservoir_ = 0;\r
-       pos = (int)(target_sample*1000 / stream_data->sample_rate);\r
-\r
-       if (!FLAC__stream_decoder_seek_absolute(decoder, target_sample)) {\r
-               if(FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_SEEK_ERROR)\r
-                       FLAC__stream_decoder_flush(decoder);\r
-               pos = -1;\r
-       }\r
-\r
-       bh_index_last_o = bh_index_last_w = (pos/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE;\r
-       if (!FLAC__stream_decoder_get_decode_position(decoder, &decode_position))\r
-               decode_position = 0;\r
-\r
-       return pos;\r
-}\r
-\r
-unsigned FLAC_plugin__decode(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data, char *sample_buffer)\r
-{\r
-       /* fill reservoir */\r
-       while (wide_samples_in_reservoir_ < SAMPLES_PER_WRITE)\r
-       {\r
-               if (FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_END_OF_STREAM)\r
-               {\r
-                       stream_data->eof = true;\r
-                       break;\r
-               }\r
-               else if (!FLAC__stream_decoder_process_single(decoder))\r
-               {\r
-                       FLAC_plugin__show_error("Error while processing frame (%s).", FLAC__stream_decoder_get_resolved_state_string(decoder));\r
-                       stream_data->eof = true;\r
-                       break;\r
-               }\r
-               if (!FLAC__stream_decoder_get_decode_position(decoder, &decode_position))\r
-                       decode_position = 0;\r
-       }\r
-       /* output samples */\r
-       if (wide_samples_in_reservoir_ > 0)\r
-       {\r
-               const unsigned n = min(wide_samples_in_reservoir_, SAMPLES_PER_WRITE);\r
-               const unsigned channels = stream_data->channels;\r
-               unsigned i;\r
-               int bytes;\r
-\r
-               if (cfg.replaygain.enable && stream_data->has_replaygain)\r
-               {\r
-                       bytes = FLAC__replaygain_synthesis__apply_gain(\r
-                               sample_buffer,\r
-                               true, /* little_endian_data_out */\r
-                               stream_data->output_bits_per_sample == 8, /* unsigned_data_out */\r
-                               reservoir__,\r
-                               n,\r
-                               channels,\r
-                               stream_data->bits_per_sample,\r
-                               stream_data->output_bits_per_sample,\r
-                               stream_data->replay_scale,\r
-                               cfg.replaygain.hard_limit,\r
-                               cfg.resolution.replaygain.dither,\r
-                               &stream_data->dither_context\r
-                       );\r
-               }\r
-               else\r
-               {\r
-                       bytes = FLAC__plugin_common__pack_pcm_signed_little_endian(\r
-                               sample_buffer,\r
-                               reservoir__,\r
-                               n,\r
-                               channels,\r
-                               stream_data->bits_per_sample,\r
-                               stream_data->output_bits_per_sample\r
-                       );\r
-               }\r
-\r
-               wide_samples_in_reservoir_ -= n;\r
-               for (i = 0; i < channels; i++)\r
-                       memmove(&reservoir_[i][0], &reservoir_[i][n], sizeof(reservoir_[0][0]) * wide_samples_in_reservoir_);\r
-\r
-               return bytes;\r
-       }\r
-       else\r
-       {\r
-               stream_data->eof = true;\r
-               return 0;\r
-       }\r
-}\r
-\r
-int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, stream_data_struct *stream_data)\r
-{\r
-       static int bitrate_history_[BITRATE_HIST_SIZE];\r
-       unsigned bh_index_w = (written_time/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE;\r
-       unsigned bh_index_o = (output_time/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE;\r
-\r
-       /* written bitrate */\r
-       if (bh_index_w != bh_index_last_w)\r
-       {\r
-               bitrate_history_[(bh_index_w + BITRATE_HIST_SIZE-1)%BITRATE_HIST_SIZE] =\r
-                       decode_position>decode_position_last && written_time > written_time_last ?\r
-                       (unsigned)(8000*(decode_position - decode_position_last)/(written_time - written_time_last)) :\r
-                       stream_data->average_bps;\r
-\r
-               bh_index_last_w = bh_index_w;\r
-               written_time_last = written_time;\r
-               decode_position_last = decode_position;\r
-       }\r
-\r
-       /* output bitrate */\r
-       if (bh_index_o!=bh_index_last_o && bh_index_o!=bh_index_last_w)\r
-       {\r
-               bh_index_last_o = bh_index_o;\r
-               return bitrate_history_[bh_index_o];\r
-       }\r
-\r
-       return 0;\r
-}\r
diff --git a/src/plugin_winamp2/playback.h b/src/plugin_winamp2/playback.h
deleted file mode 100644 (file)
index be30ee9..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/* in_flac - Winamp2 FLAC input plugin\r
- * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- */\r
-\r
-#include "FLAC/all.h"\r
-#include "share/replaygain_synthesis.h"\r
-#include "plugin_common/all.h"\r
-\r
-/*\r
- *  constants\r
- */\r
-\r
-#define SAMPLES_PER_WRITE           576\r
-\r
-#define BITRATE_HIST_SEGMENT_MSEC   500\r
-#define BITRATE_HIST_SIZE           64\r
-\r
-/*\r
- *  common structures\r
- */\r
-\r
-typedef struct {\r
-       volatile FLAC__bool is_playing;\r
-       volatile FLAC__bool abort_flag;\r
-       volatile FLAC__bool eof;\r
-       volatile int seek_to;\r
-       FLAC__uint64 total_samples;\r
-       unsigned bits_per_sample;\r
-       unsigned output_bits_per_sample;\r
-       unsigned channels;\r
-       unsigned sample_rate;\r
-       int length_in_msec; /* int (instead of FLAC__uint64) only because that's what Winamp uses; seeking won't work right if this maxes out */\r
-       unsigned average_bps;\r
-       FLAC__bool has_replaygain;\r
-       double replay_scale;\r
-       DitherContext dither_context;\r
-} stream_data_struct;\r
-\r
-\r
-typedef struct {\r
-       struct {\r
-               FLAC__bool enable;\r
-               FLAC__bool album_mode;\r
-               int  preamp;\r
-               FLAC__bool hard_limit;\r
-       } replaygain;\r
-       struct {\r
-               struct {\r
-                       FLAC__bool dither_24_to_16;\r
-               } normal;\r
-               struct {\r
-                       FLAC__bool dither;\r
-                       int  noise_shaping; /* value must be one of NoiseShaping enum, see plugin_common/replaygain_synthesis.h */\r
-                       int  bps_out;\r
-               } replaygain;\r
-       } resolution;\r
-       struct {\r
-               FLAC__bool stop_err;\r
-       } misc;\r
-} output_config_t;\r
-\r
-/*\r
- *  protopytes\r
- */\r
-\r
-FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *filename, FLAC__int64 filesize, stream_data_struct *stream_data, output_config_t *config);\r
-void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder);\r
-void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder);\r
-\r
-int FLAC_plugin__seek(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data);\r
-unsigned FLAC_plugin__decode(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data, char *sample_buffer);\r
-int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, stream_data_struct *stream_data);\r
-\r
-/*\r
- *  these should be defined in plug-in\r
- */\r
-\r
-extern void FLAC_plugin__show_error(const char *message,...);\r
diff --git a/src/plugin_winamp2/resource.h b/src/plugin_winamp2/resource.h
deleted file mode 100644 (file)
index f09b4af..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Developer Studio generated include file.\r
-// Used by resource.rc\r
-//\r
-#define IDC_RESET                       3\r
-#define IDD_CONFIG                      101\r
-#define IDD_CONFIG_GENERAL              103\r
-#define IDD_CONFIG_OUTPUT               104\r
-#define IDD_INFOBOX                     105\r
-#define IDC_ENABLE                      1000\r
-#define IDC_ALBUM                       1001\r
-#define IDC_LIMITER                     1002\r
-#define IDC_COMMENT                     1002\r
-#define IDC_PREAMP                      1003\r
-#define IDC_YEAR                        1003\r
-#define IDC_PA                          1004\r
-#define IDC_TRACK                       1004\r
-#define IDC_DITHER                      1005\r
-#define IDC_DITHERRG                    1006\r
-#define IDC_TO                          1008\r
-#define IDC_SHAPE                       1009\r
-#define IDC_TABS                        1009\r
-#define IDC_TITLE                       1010\r
-#define IDC_TAGZ_HELP                   1011\r
-#define IDC_ARTIST                      1011\r
-#define IDC_TAGZ_DEFAULT                1012\r
-#define IDC_SEP                         1013\r
-#define IDC_NAME                        1014\r
-#define IDC_INFO                        1015\r
-#define IDC_GENRE                       1017\r
-#define IDC_REMOVE                      1020\r
-#define IDC_UPDATE                      1021\r
-#define IDC_ID3V1                       1030\r
-#define IDC_RESERVE                     1032\r
-#define IDC_BPS                         1036\r
-#define IDC_ERRORS                      1037\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        106\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1037\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
diff --git a/src/plugin_winamp2/resource.rc b/src/plugin_winamp2/resource.rc
deleted file mode 100644 (file)
index 4689e3e..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-//Microsoft Developer Studio generated resource script.\r
-//\r
-#include "resource.h"\r
-\r
-#define APSTUDIO_READONLY_SYMBOLS\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 2 resource.\r
-//\r
-#include "afxres.h"\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#undef APSTUDIO_READONLY_SYMBOLS\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// Russian resources\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)\r
-#ifdef _WIN32\r
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT\r
-#pragma code_page(1251)\r
-#endif //_WIN32\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// TEXTINCLUDE\r
-//\r
-\r
-1 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
-    "resource.h\0"\r
-END\r
-\r
-2 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
-    "#include ""afxres.h""\r\n"\r
-    "\0"\r
-END\r
-\r
-3 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
-    "\r\n"\r
-    "\0"\r
-END\r
-\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_INFOBOX DIALOG DISCARDABLE  0, 0, 292, 148\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    EDITTEXT        IDC_NAME,3,3,285,12,ES_AUTOHSCROLL | ES_READONLY | NOT \r
-                    WS_TABSTOP\r
-    GROUPBOX        " Tag  ",IDC_STATIC,3,20,182,104\r
-    RTEXT           "&Title",IDC_STATIC,8,32,31,8\r
-    EDITTEXT        IDC_TITLE,43,30,137,12,ES_AUTOHSCROLL\r
-    RTEXT           "&Artist",IDC_STATIC,8,47,31,8\r
-    EDITTEXT        IDC_ARTIST,43,45,137,12,ES_AUTOHSCROLL\r
-    RTEXT           "Albu&m",IDC_STATIC,8,62,31,8\r
-    EDITTEXT        IDC_ALBUM,43,60,137,12,ES_AUTOHSCROLL\r
-    RTEXT           "&Comment",IDC_STATIC,8,77,31,8\r
-    EDITTEXT        IDC_COMMENT,43,75,137,12,ES_AUTOHSCROLL\r
-    RTEXT           "&Date",IDC_STATIC,8,92,31,8\r
-    EDITTEXT        IDC_YEAR,43,90,40,12,ES_AUTOHSCROLL\r
-    RTEXT           "Track &number",IDC_STATIC,90,92,46,8\r
-    EDITTEXT        IDC_TRACK,141,90,39,12,ES_AUTOHSCROLL\r
-    RTEXT           "&Genre",IDC_STATIC,8,107,31,8\r
-    COMBOBOX        IDC_GENRE,43,105,137,95,CBS_DROPDOWN | CBS_SORT | \r
-                    WS_VSCROLL | WS_TABSTOP\r
-    GROUPBOX        " FLAC Info  ",IDC_STATIC,191,20,97,124\r
-    LTEXT           "",IDC_INFO,195,30,90,110\r
-    DEFPUSHBUTTON   "Close",IDOK,3,130,50,14\r
-    PUSHBUTTON      "&Update",IDC_UPDATE,69,130,50,14\r
-    PUSHBUTTON      "&Remove",IDC_REMOVE,135,130,50,14\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO DISCARDABLE \r
-BEGIN\r
-    IDD_INFOBOX, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 285\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 141\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-#endif    // Russian resources\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// English (U.S.) resources\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
-#ifdef _WIN32\r
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
-#pragma code_page(1252)\r
-#endif //_WIN32\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_CONFIG DIALOG DISCARDABLE  0, 0, 237, 212\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "FLAC Configuration"\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    DEFPUSHBUTTON   "OK",IDOK,75,195,50,14\r
-    PUSHBUTTON      "Cancel",IDCANCEL,129,195,50,14\r
-    PUSHBUTTON      "Reset",IDC_RESET,183,195,50,14\r
-    CONTROL         "Tab1",IDC_TABS,"SysTabControl32",WS_TABSTOP,3,3,230,187\r
-END\r
-\r
-IDD_CONFIG_GENERAL DIALOG DISCARDABLE  0, 0, 226, 171\r
-STYLE DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    GROUPBOX        " Title Formatting  ",IDC_STATIC,2,2,220,58\r
-    LTEXT           "&Title",IDC_STATIC,8,17,14,8\r
-    EDITTEXT        IDC_TITLE,27,15,188,12,ES_AUTOHSCROLL\r
-    PUSHBUTTON      "default",IDC_TAGZ_DEFAULT,156,28,30,10\r
-    PUSHBUTTON      "help",IDC_TAGZ_HELP,188,28,27,10\r
-    LTEXT           "Separate tag values &with",IDC_STATIC,8,43,79,8\r
-    EDITTEXT        IDC_SEP,91,41,27,12,ES_AUTOHSCROLL\r
-    CONTROL         "Read ID3v&1 tags",IDC_ID3V1,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,147,43,70,10\r
-    GROUPBOX        " Tag Editor  ",IDC_STATIC,2,63,220,30\r
-    CONTROL         "Reserve space for &FLAC tags",IDC_RESERVE,"Button",\r
-                    BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,8,76,125,10\r
-    GROUPBOX        " Miscellaneous  ",IDC_STATIC,2,96,220,72\r
-    CONTROL         "&Show instantaneous bitrate while playing",IDC_BPS,"Button",\r
-                    BS_AUTOCHECKBOX | WS_TABSTOP,8,108,125,10\r
-    CONTROL         "Stop on &all errors",IDC_ERRORS,"Button",\r
-                    BS_AUTOCHECKBOX | WS_TABSTOP,8,120,69,10\r
-END\r
-\r
-IDD_CONFIG_OUTPUT DIALOG DISCARDABLE  0, 0, 224, 171\r
-STYLE DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    GROUPBOX        " ReplayGain  ",IDC_STATIC,2,2,220,57\r
-    CONTROL         "&Enable ReplayGain",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,8,15,77,10\r
-    CONTROL         "&Album mode",IDC_ALBUM,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,8,27,55,10\r
-    CONTROL         "6dB &hard limiter",IDC_LIMITER,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,123,27,64,10\r
-    LTEXT           "&Preamp",IDC_STATIC,8,44,25,8\r
-    CONTROL         "Slider1",IDC_PREAMP,"msctls_trackbar32",TBS_NOTICKS | \r
-                    WS_TABSTOP,36,43,154,12\r
-    RTEXT           "",IDC_PA,194,44,21,8\r
-    GROUPBOX        " Resolution  ",IDC_STATIC,1,62,220,95\r
-    GROUPBOX        " Without ReplayGain ",IDC_STATIC,7,71,209,30\r
-    CONTROL         "&Dither 24bps to 16bps",IDC_DITHER,"Button",\r
-                    BS_AUTOCHECKBOX | WS_TABSTOP,16,84,85,10\r
-    GROUPBOX        " With ReplayGain ",IDC_STATIC,7,104,209,47\r
-    LTEXT           "&Output bit depth",IDC_STATIC,16,119,52,8\r
-    COMBOBOX        IDC_TO,71,116,39,43,CBS_DROPDOWNLIST | WS_VSCROLL | \r
-                    WS_TABSTOP\r
-    CONTROL         "E&nable dithering",IDC_DITHERRG,"Button",\r
-                    BS_AUTOCHECKBOX | WS_TABSTOP,16,134,67,10\r
-    LTEXT           "Noise &shaping",IDC_STATIC,113,135,46,8\r
-    COMBOBOX        IDC_SHAPE,164,132,46,48,CBS_DROPDOWNLIST | WS_VSCROLL | \r
-                    WS_TABSTOP\r
-    LTEXT           "Note: changes take effect after restarting playback",\r
-                    IDC_STATIC,2,160,161,8\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO DISCARDABLE \r
-BEGIN\r
-    IDD_CONFIG, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 230\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 205\r
-    END\r
-\r
-    IDD_CONFIG_GENERAL, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 219\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 164\r
-    END\r
-\r
-    IDD_CONFIG_OUTPUT, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 217\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 164\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-#endif    // English (U.S.) resources\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-\r
-#ifndef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 3 resource.\r
-//\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#endif    // not APSTUDIO_INVOKED\r
-\r
diff --git a/src/plugin_winamp2/tagz.cpp b/src/plugin_winamp2/tagz.cpp
deleted file mode 100644 (file)
index 475f3c2..0000000
+++ /dev/null
@@ -1,921 +0,0 @@
-#include <string.h>\r
-#include <stdio.h>\r
-#include <ctype.h>\r
-#include <stdlib.h>\r
-#include "tagz.h"\r
-\r
-#ifdef TAGZ_UNICODE\r
-\r
-#define _TX(X)      L##X\r
-#define t_strdup    wcsdup\r
-#define t_strlen    wcslen\r
-#define t_strnicmp  wcsnicmp\r
-#define t_atoi(x)   wcstol(x,0,10)\r
-#define t_stricmp   wcsicmp\r
-#define t_strstr    wcsstr\r
-#define sprintf     swprintf\r
-\r
-#else\r
-\r
-#define _TX(X)      X\r
-#define t_strdup    strdup\r
-#define t_strlen    strlen\r
-#define t_strnicmp  strnicmp\r
-#define t_atoi      atoi\r
-#define t_stricmp   stricmp\r
-#define t_strstr    strstr\r
-\r
-#endif\r
-\r
-#define TABSIZE(x) (sizeof(x)/sizeof(x[0]))\r
-\r
-\r
-class T_String\r
-{\r
-private:\r
-       T_CHAR * data;\r
-       UINT size,used;\r
-public:\r
-       T_String() {data=0;size=0;used=0;}\r
-       void AddChar(T_CHAR c)\r
-       {\r
-               if (!data)\r
-               {\r
-                       data=(T_CHAR*)malloc((size=512)*sizeof(T_CHAR));\r
-                       used=0;\r
-               }\r
-               else if (size==used)\r
-               {\r
-                       size<<=1;\r
-                       data=(T_CHAR*)realloc((char*)data,size*sizeof(T_CHAR));\r
-               }\r
-               if (data) data[used++]=c;               \r
-       }\r
-       void AddInt(int i)\r
-       {\r
-               T_CHAR foo[16];\r
-               sprintf(foo,_TX("%i"),i);\r
-               AddString(foo);\r
-       }\r
-       void AddString(const T_CHAR * z)\r
-       {\r
-               while(*z) {AddChar(*z);z++;}\r
-       }\r
-       void AddString(T_String & s)\r
-       {\r
-               AddString(s.Peek());\r
-       }\r
-       ~T_String()\r
-       {\r
-               if (data) free(data);\r
-       }\r
-       T_CHAR * GetBuf()\r
-       {\r
-               if (!data) return ::t_strdup(_TX(""));\r
-               T_CHAR * r=(T_CHAR*)realloc(data,(used+1)*sizeof(T_CHAR));\r
-               r[used]=0;\r
-               data=0;\r
-               return r;\r
-       }\r
-       T_CHAR operator[](UINT i)\r
-       {\r
-               if (!data || i>=used) return 0;\r
-               else return data[i];\r
-       }\r
-       UINT Len() {return data ? used : 0;}\r
-       void Reset()\r
-       {\r
-               if (data) {free(data);data=0;}          \r
-       }\r
-       const T_CHAR * Peek()\r
-       {\r
-               AddChar(0);\r
-               used--;\r
-               return data;\r
-       }\r
-       T_CHAR * strdup()\r
-       {\r
-               return ::t_strdup(Peek());\r
-       }\r
-};\r
-\r
-\r
-\r
-\r
-static int separator(T_CHAR x)\r
-{\r
-       if (!x || x==' ') return 1;\r
-       if (x=='\'' || x=='_') return 0;\r
-#ifdef TAGZ_UNICODE\r
-       return !iswalnum(x);\r
-#else\r
-       return !isalnum(x);\r
-#endif\r
-}\r
-\r
-static int sepcmp(T_CHAR* src,T_CHAR* val)\r
-{\r
-       UINT l=t_strlen(val);\r
-       return !t_strnicmp(src,val,l) && separator(src[l]);\r
-}\r
-\r
-static char roman_num[]=\r
-{\r
-       'I','V','X','L','C','D','M'\r
-};\r
-\r
-\r
-static int is_roman(T_CHAR * ptr)/* could be more smart i think */\r
-{\r
-       if (ptr[0]==']' && ptr[1]=='[' && separator(ptr[2])) return 1;\r
-       while(!separator(*ptr))\r
-       {\r
-               UINT n;\r
-               bool found=0;\r
-               for(n=0;n<TABSIZE(roman_num);n++)\r
-               {\r
-                       if (*ptr==roman_num[n]) {found=1;break;}\r
-               }\r
-               if (!found) return 0;\r
-               ptr++;\r
-       }\r
-       return 1;\r
-}\r
-\r
-static int need_full(T_CHAR* ptr)\r
-{\r
-       if (is_roman(ptr)) return 1;\r
-       if (sepcmp(ptr,_TX("RPG"))) return 1;\r
-       while(!separator(*ptr))\r
-       {\r
-               if (*ptr<'0' || *ptr>'9') return 0;\r
-               ptr++;\r
-       }\r
-       return 1;\r
-}\r
-\r
-typedef bool (*TEXTFUNC)(UINT n_src,T_CHAR **src,UINT*,T_String &out);\r
-\r
-#define MAKEFUNC(X) static bool X(UINT n_src,T_CHAR ** src,UINT *found_src,T_String &out)\r
-\r
-\r
-MAKEFUNC(If)\r
-{\r
-       if (n_src!=3) return false;\r
-\r
-       out.AddString(src[found_src[0] ? 1 : 2]);\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(If2)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       out.AddString(src[found_src[0] ? 0 : 1]);\r
-       return true;\r
-}\r
-\r
-\r
-MAKEFUNC(Iflonger)\r
-{\r
-       if (n_src!=4) return false;\r
-\r
-       out.AddString(src[(int)t_strlen(src[0])>t_atoi(src[1]) ? 2 : 3]);\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Ifgreater)\r
-{\r
-       if (n_src!=4) return false;\r
-\r
-       out.AddString(src[t_atoi(src[0])>t_atoi(src[1]) ? 2 : 3]);\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Upper)\r
-{\r
-       if (n_src!=1) return false;\r
-\r
-       T_CHAR * s=src[0];\r
-\r
-       while(*s)\r
-               out.AddChar(toupper(*(s++)));\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Lower)\r
-{\r
-       if (n_src!=1) return false;\r
-\r
-       T_CHAR * s=src[0];\r
-\r
-       while(*s)\r
-               out.AddChar(tolower(*(s++)));\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Pad)\r
-{\r
-       if (n_src<2 || n_src>3) return false;\r
-\r
-       T_CHAR *fill=_TX(" ");\r
-       if (n_src==3 && src[2][0])\r
-               fill = src[2];\r
-\r
-       int num = t_atoi(src[1]);\r
-       T_CHAR *p = src[0];\r
-\r
-       while (*p) { out.AddChar(*(p++)); num--; }\r
-\r
-       UINT fl = t_strlen(fill);\r
-       while (num>0)\r
-               out.AddChar(fill[(--num)%fl]);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Cut)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       UINT num = t_atoi(src[1]);\r
-       T_CHAR *p = src[0];\r
-\r
-       while (*p && num>0) {out.AddChar(*(p++));num--;}\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(PadCut)\r
-{\r
-       if (n_src<2 || n_src>3) return false;\r
-\r
-       T_CHAR *fill = _TX(" ");\r
-       if (n_src==3 && src[2][0])\r
-               fill = src[2];\r
-\r
-       int num = t_atoi(src[1]);\r
-       T_CHAR *p = src[0];\r
-\r
-       while(*p && num>0) {out.AddChar(*(p++));num--;}\r
-\r
-       UINT fl=t_strlen(fill);\r
-       while (num>0)\r
-               out.AddChar(fill[(--num)%fl]);\r
-\r
-       return true;\r
-}\r
-\r
-/* abbr(string) */\r
-/* abbr(string,len) */\r
-MAKEFUNC(Abbr)\r
-{\r
-       if (n_src==0 || n_src>2) return false;\r
-\r
-\r
-       if (n_src==2 && (int)t_strlen(src[0])<t_atoi(src[1]))\r
-       {\r
-               out.AddString(src[0]);\r
-               return true;\r
-       }\r
-\r
-       T_CHAR * meta=src[0];\r
-       bool w=0, r=0;\r
-\r
-       while(*meta)\r
-       {\r
-               bool an=!separator(*meta) || *meta==']' || *meta=='[';\r
-\r
-               if (w && !an)\r
-                       w=0;\r
-               else if (!w && an)\r
-               {\r
-                       w=1;\r
-                       r=need_full(meta)?1:0;\r
-                       out.AddChar(*meta);\r
-               }\r
-               else if (w && r)\r
-                       out.AddChar(*meta);\r
-               meta++;\r
-       }\r
-\r
-       return true;\r
-}\r
-\r
-\r
-\r
-MAKEFUNC(Caps)\r
-{\r
-       if (n_src!=1) return false;\r
-\r
-       T_CHAR* sp=src[0];\r
-       int sep = 1;\r
-\r
-       while(*sp)\r
-       {\r
-               T_CHAR c=*(sp++);\r
-               int s = separator(c);\r
-               if (!s && sep)\r
-                       c=toupper(c);\r
-               else if (!sep) c=tolower(c);\r
-               sep=s;\r
-               out.AddChar(c);\r
-       }\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Caps2)\r
-{\r
-       if (n_src!=1) return false;\r
-\r
-       T_CHAR* sp=src[0];\r
-       int sep=1;\r
-\r
-       while(*sp)\r
-       {\r
-               T_CHAR c=*(sp++);\r
-               int s = separator(c);\r
-               if (!s && sep)\r
-                       c=toupper(c);\r
-               sep=s;\r
-               out.AddChar(c);\r
-       }\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Longest)\r
-{\r
-       T_CHAR *ptr=0;\r
-       UINT n, m=0;\r
-\r
-       for(n=0;n<n_src;n++)\r
-       {\r
-               UINT l=t_strlen(src[n]);\r
-               if (l>m) {m=l;ptr=src[n];}\r
-       }\r
-\r
-       if (ptr) out.AddString(ptr);\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Shortest)\r
-{\r
-       T_CHAR * ptr=0;\r
-       UINT n,m=(UINT)(-1);\r
-\r
-       for(n=0;n<n_src;n++)\r
-       {\r
-               UINT l=t_strlen(src[n]);\r
-               if (l<m) {m=l;ptr=src[n];}\r
-       }\r
-\r
-       if (ptr) out.AddString(ptr);\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Num)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       T_CHAR tmp[16];\r
-       T_CHAR tmp1[16];\r
-       sprintf(tmp1,_TX("%%0%uu"),t_atoi(src[1]));\r
-       sprintf(tmp,tmp1,t_atoi(src[0]));\r
-       out.AddString(tmp);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Hex)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       T_CHAR tmp[16];\r
-       T_CHAR tmp1[16];\r
-       sprintf(tmp1,_TX("%%0%ux"),t_atoi(src[1]));\r
-       sprintf(tmp,tmp1,t_atoi(src[0]));\r
-       out.AddString(tmp);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(StrChr)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       T_CHAR * p=src[0];\r
-       T_CHAR s=src[1][0];\r
-\r
-       while (*p && *p!=s) p++;\r
-       if (*p==s)\r
-               out.AddInt(1+p-src[0]);\r
-       else out.AddChar('0');\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(StrRChr)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       T_CHAR * p=src[0],*p1=0;\r
-       T_CHAR s=src[1][0];\r
-\r
-       while(*p)\r
-       {\r
-               if (*p==s) p1=p;\r
-               p++;\r
-       }\r
-\r
-       if (p1)\r
-               out.AddInt(1+p1-src[0]);\r
-       else out.AddChar('0');\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(StrStr)\r
-{\r
-       if (n_src!=2) return false;\r
-\r
-       T_CHAR * p = t_strstr(src[0],src[1]);\r
-\r
-       if (p)\r
-               out.AddInt(1+p-src[0]);\r
-       else out.AddChar('0');\r
-\r
-       return true;\r
-}\r
-\r
-/* substr(string, index) */\r
-/* substr(string, index, length) */\r
-MAKEFUNC(SubStr)\r
-{\r
-       if (n_src<2 || n_src>3) return false;\r
-\r
-       int n1 = t_atoi(src[1]), n2;\r
-\r
-       if (n_src == 3)\r
-               n2 = t_atoi(src[2]);\r
-       else n2 = n1;\r
-\r
-       if (n1 < 1) n1=1;\r
-       if (n2 >= n1)\r
-       {\r
-               n1--;\r
-               n2--;\r
-               while(n1<=n2 && src[0][n1])\r
-                       out.AddChar(src[0][n1++]);\r
-       }\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Len)\r
-{\r
-       if (n_src!=1) return false;\r
-\r
-       out.AddInt(t_strlen(src[0]));\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Add)\r
-{\r
-       UINT n;\r
-       int s=0;\r
-\r
-       for (n=0;n<n_src;n++)\r
-               s+=t_atoi(src[n]);\r
-\r
-       out.AddInt(s);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Sub)\r
-{\r
-       if (n_src==0) return false;\r
-\r
-       UINT n;\r
-       int s=t_atoi(src[0]);\r
-\r
-       for (n=1;n<n_src;n++)\r
-               s-=t_atoi(src[n]);\r
-\r
-       out.AddInt(s);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Mul)\r
-{\r
-       UINT n;\r
-       int s=1;\r
-\r
-       for(n=0;n<n_src;n++)\r
-               s*=t_atoi(src[n]);\r
-\r
-       out.AddInt(s);\r
-\r
-       return true;\r
-}\r
-                               \r
-MAKEFUNC(Div)\r
-{\r
-       if (n_src==0) return false;\r
-\r
-       UINT n;\r
-       int s=t_atoi(src[0]);\r
-\r
-       for(n=1;n<n_src;n++)\r
-       {\r
-               int t=t_atoi(src[n]);\r
-               if (t) s/=t;\r
-               else t=0;\r
-       }\r
-\r
-       out.AddInt(s);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Mod)\r
-{\r
-       if (n_src==0) return false;\r
-\r
-       UINT n;\r
-       int s=t_atoi(src[0]);\r
-\r
-       for(n=1;n<n_src;n++)\r
-       {\r
-               int t=t_atoi(src[n]);\r
-               if (t) s%=t;\r
-               else t=0;\r
-       }\r
-\r
-       out.AddInt(s);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Max)\r
-{\r
-       if (!n_src) return false;\r
-\r
-       int m = t_atoi(src[0]);\r
-       UINT n;\r
-\r
-       for (n=1; n<n_src; n++)\r
-       {\r
-               int t = t_atoi(src[n]);\r
-               if (t > m) m = t;\r
-       }\r
-       out.AddInt(m);\r
-\r
-       return true;\r
-}\r
-\r
-MAKEFUNC(Min)\r
-{\r
-       if (!n_src) return false;\r
-\r
-       int m=t_atoi(src[0]);\r
-       UINT n;\r
-\r
-       for(n=1;n<n_src;n++)\r
-       {\r
-               int t=t_atoi(src[n]);\r
-               if (t<m) m=t;\r
-       }\r
-       out.AddInt(m);\r
-\r
-       return true;\r
-}\r
-\r
-/* replace(string, what_to_replace, replacement) */\r
-MAKEFUNC(Replace)\r
-{\r
-       if (n_src!=3) return false;\r
-       T_CHAR *p = src[0];\r
-\r
-       while (*p)\r
-       {\r
-               UINT n=0;\r
-\r
-               while (src[1][n] && p[n]==src[1][n]) n++;\r
-\r
-               if (!src[1][n])\r
-               {\r
-                       out.AddString(src[2]);\r
-                       p += n;\r
-               }\r
-               else out.AddChar(*p++);\r
-       }\r
-\r
-       return true;\r
-}\r
-\r
-struct\r
-{\r
-       TEXTFUNC func;\r
-       const T_CHAR * name;\r
-}\r
-FUNCS[] =\r
-{\r
-       If,_TX("if"),\r
-       If2,_TX("if2"),\r
-       Upper,_TX("upper"),\r
-       Lower,_TX("lower"),\r
-       Pad,_TX("pad"),\r
-       Cut,_TX("cut"),\r
-       PadCut,_TX("padcut"),\r
-       Abbr,_TX("abbr"),\r
-       Caps,_TX("caps"),\r
-       Caps2,_TX("caps2"),\r
-       Longest,_TX("longest"),\r
-       Shortest,_TX("shortest"),\r
-       Iflonger,_TX("iflonger"),\r
-       Ifgreater,_TX("ifgreater"),\r
-       Num,_TX("num"),Num,_TX("dec"),\r
-       Hex,_TX("hex"),\r
-       StrChr,_TX("strchr"),\r
-       StrChr,_TX("strlchr"),\r
-       StrRChr,_TX("strrchr"),\r
-       StrStr,_TX("strstr"),\r
-       SubStr,_TX("substr"),\r
-       Len,_TX("len"),\r
-       Add,_TX("add"),\r
-       Sub,_TX("sub"),\r
-       Mul,_TX("mul"),\r
-       Div,_TX("div"),\r
-       Mod,_TX("mod"),\r
-       Min,_TX("min"),\r
-       Max,_TX("max"),\r
-       Replace,_TX("replace"),\r
-};\r
-\r
-\r
-class FMT\r
-{\r
-private:\r
-       T_String str;\r
-       T_CHAR * spec;\r
-       TAGFUNC f;\r
-       TAGFREEFUNC ff;\r
-       void * fp;\r
-       T_CHAR * org_spec;\r
-       int found;\r
-\r
-       void Error(T_CHAR *e=0)\r
-       {\r
-               str.Reset();\r
-               str.AddString(e ? e : _TX("[SYNTAX ERROR IN FORMATTING STRING]"));\r
-               found++;  /* force displaying */\r
-       }\r
-\r
-       T_CHAR * _FMT(T_CHAR * s,UINT *f=0)\r
-       {\r
-               FMT fmt(this,s);\r
-               T_CHAR * c=(T_CHAR*)fmt;\r
-               if (f) *f=fmt.found;\r
-               found+=fmt.found;\r
-               return c;\r
-       }\r
-\r
-       static bool skipshit(T_CHAR** _p,T_CHAR *bl)\r
-       {\r
-               T_CHAR * p=*_p;\r
-               int bc1=0,bc2=0;\r
-               while(*p)\r
-               {\r
-                       if (!bc1 && !bc2 && bl)\r
-                       {\r
-                               T_CHAR *z=bl;\r
-                               while(*z)\r
-                               {\r
-                                       if (*z==*p) break;\r
-                                       z++;\r
-                               }\r
-                               if (*z) break;                          \r
-                       }\r
-                       if (*p=='\'')\r
-                       {\r
-                               p++;\r
-                               while(*p && *p!='\'') p++;\r
-                               if (!*p) return 0;\r
-                       }\r
-                       else if (*p=='(') bc1++;\r
-                       else if (*p==')')\r
-                       {\r
-                               if (--bc1<0) return 0;\r
-                       }\r
-                       else if (*p=='[') bc2++;\r
-                       else if (*p==']')\r
-                       {\r
-                               if (--bc2<0) return 0;\r
-                       }\r
-                       p++;\r
-               }\r
-               *_p=p;\r
-               return *p && !bc1 && !bc2;\r
-       }\r
-\r
-       void run()\r
-       {\r
-               if (!spec) {Error();return;}\r
-               while(*spec)\r
-               {\r
-                       if (*spec=='%')\r
-                       {\r
-                               spec++;\r
-                               if (*spec=='%') {str.AddChar('%');spec++;continue;}\r
-                               T_CHAR* s1=spec+1;\r
-                               while(*s1 && *s1!='%') s1++;\r
-                               if (!*s1) {Error();break;}\r
-                               *s1=0;\r
-                               T_CHAR * tag=f(spec,fp);\r
-                               *s1='%';\r
-                               /*if (!tag) tag=tag_unknown; */\r
-                               if (tag && tag[0])\r
-                               {\r
-                                       found++;\r
-                                       str.AddString(tag);\r
-                               }\r
-                               else\r
-                               {\r
-                                       str.AddString(_TX("?"));\r
-                               }\r
-                               if (tag && ff) ff(tag,fp);\r
-                               spec=s1+1;\r
-                       }\r
-                       else if (*spec=='$')\r
-                       {\r
-                               spec++;\r
-                               if (*spec=='$') {str.AddChar('$');spec++;continue;}\r
-                               T_CHAR * s1=spec+1;\r
-                               while(*s1 && *s1!='(') s1++;\r
-                               if (!*s1) {Error();break;}\r
-                               T_CHAR * s2=s1+1;\r
-                               if (!skipshit(&s2,_TX(")"))) {Error();break;}\r
-                               if (!*s2) {Error();break;};\r
-                               T_CHAR * p=s1+1;\r
-                               T_CHAR* temp[64];\r
-                               UINT temp_f[64];\r
-                               UINT nt=0;\r
-                               T_CHAR * p1=s1+1;\r
-                               while(p<=s2 && nt<64)\r
-                               {\r
-                                       if (!skipshit(&p,_TX(",)"))) {Error();return;}\r
-                                       if (p>s2 || (*p!=',' && *p!=')')) {Error(_TX("internal error"));return;}\r
-                                       T_CHAR bk=*p;\r
-                                       *p=0;\r
-                                       temp[nt]=_FMT(p1,&temp_f[nt]);\r
-                                       nt++;\r
-                                       *p=bk;;\r
-                                       p1=p+1;\r
-                                       p++;\r
-                               }\r
-                               *s1=0;\r
-                               UINT n;\r
-\r
-                               for (n=0; n<TABSIZE(FUNCS); n++)\r
-                                       if (!t_stricmp(spec, FUNCS[n].name))\r
-                                               break;\r
-\r
-                               *s1='(';\r
-\r
-                               if (n != TABSIZE(FUNCS))\r
-                               {\r
-                                       if (!FUNCS[n].func(nt, temp, temp_f, str))\r
-                                       {\r
-                                               Error(_TX("[INVALID $"));\r
-                                               str.AddString(FUNCS[n].name);\r
-                                               str.AddString(_TX(" SYNTAX]"));\r
-                                               return;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       Error(_TX("[UNKNOWN FUNCTION]"));\r
-                                       return;\r
-                               }\r
-\r
-                               for(n=0;n<nt;n++) free(temp[n]);\r
-                               spec=s2+1;\r
-                       }\r
-                       else if (*spec=='\'')\r
-                       {\r
-                               spec++;\r
-                               if (*spec=='\'') {str.AddChar('\'');spec++;continue;}\r
-                               T_CHAR * s1=spec+1;\r
-                               while(*s1 && *s1!='\'') s1++;\r
-                               if (!*s1) {Error();break;}\r
-                               *s1=0;\r
-                               str.AddString(spec);\r
-                               *s1='\'';\r
-                               spec=s1+1;\r
-                       }\r
-                       else if (*spec=='[')\r
-                       {\r
-                               spec++;\r
-                               T_CHAR * s1=spec;\r
-                               UINT bc=0;\r
-                               if (!skipshit(&s1,_TX("]"))) {Error();break;}\r
-                               T_CHAR bk=*s1;\r
-                               *s1=0;\r
-                               FMT fmt(this,spec);\r
-                               fmt.run();\r
-                               if (fmt.found)\r
-                               {\r
-                                       str.AddString(fmt.str);\r
-                                       found+=fmt.found;\r
-                               }\r
-                               *s1=bk;\r
-                               spec=s1+1;\r
-                       }\r
-                       else if (*spec == ']') {Error();break;}\r
-                       else\r
-                       {\r
-                               str.AddChar(*spec);\r
-                               spec++;\r
-                       }\r
-               }\r
-       }\r
-\r
-       FMT(FMT* base,T_CHAR * _spec)\r
-       {\r
-               found=0;\r
-               org_spec=0;\r
-               f=base->f;\r
-               ff=base->ff;\r
-               fp=base->fp;\r
-               spec=_spec;\r
-       }\r
-public:\r
-       FMT(const T_CHAR * p_spec,TAGFUNC _f,TAGFREEFUNC _ff,void * _fp)\r
-       {\r
-               found=0;\r
-               org_spec=spec=t_strdup(p_spec);\r
-               f=_f;\r
-               ff=_ff;\r
-               fp=_fp;\r
-       }\r
-       operator T_CHAR*()\r
-       {\r
-               run();\r
-               return str.GetBuf();\r
-       }\r
-       ~FMT()\r
-       {\r
-               if (org_spec) free(org_spec);\r
-       }\r
-};\r
-\r
-extern "C"\r
-{\r
-\r
-UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR* out,UINT max)\r
-{\r
-       T_CHAR * zz=tagz_format_r(spec,f,ff,fp);\r
-       UINT r=0;\r
-       while(r<max-1 && zz[r])\r
-       {\r
-               out[r]=zz[r];\r
-               r++;\r
-       }\r
-       out[r]=0;\r
-       free(zz);\r
-       return r;\r
-}      \r
-\r
-T_CHAR * tagz_format_r(const T_CHAR* spec,TAGFUNC f,TAGFREEFUNC ff,void * fp)\r
-{\r
-       return FMT(spec,f,ff,fp);\r
-}\r
-\r
-const char tagz_manual[]="Syntax reference: \n"\r
-       "\n"\r
-       "* %tagname% - inserts field named <tagname>, eg. \"%artist%\"\n"\r
-       "* $abbr(x) - inserts abbreviation of x, eg. \"$abbr(%album%)\" - will convert album name of \"Final Fantasy VI\" to \"FFVI\"\n"\r
-       "* $abbr(x,y) - inserts abbreviation of x if x is longer than y characters; otherwise inserts full value of x, eg. \"$abbr(%album%,10)\"\n"\r
-       "* $lower(x), $upper(x) - converts x to in lower/uppercase, eg. \"$upper(%title%)\"\n"\r
-       "* $num(x,y) - displays x number and pads with zeros up to y characters (useful for track numbers), eg. $num(%tracknumber%,2)\n"\r
-       "* $caps(x) - converts first letter in every word of x to uppercase, and all other letters to lowercase, eg. \"blah BLAH\" -> \"Blah Blah\"\n"\r
-       "* $caps2(x) - similar to $caps, but leaves uppercase letters as they are, eg. \"blah BLAH\" -> \"Blah BLAH\"\n"\r
-       "* $if(A,B,C) - if A contains at least one valid tag, displays B, otherwise displays C; eg. \"$if(%artist%,%artist%,unknown artist)\" will display artist name if present; otherwise will display \"unknown artist\"; note that \"$if(A,A,)\" is equivalent to \"[A]\" (see below)\n"\r
-       "* $if2(A,B) - equals to $if(A,A,B)\n"\r
-       "* $longest(A,B,C,....) - compares lengths of output strings produced by A,B,C... and displays the longest one, eg. \"$longest(%title%,%comment%)\" will display either title if it's longer than comment; otherwise it will display comment\n"\r
-       "* $pad(x,y) - pads x with spaces up to y characters\n"\r
-       "* $cut(x,y) - truncates x to y characters\n"\r
-       "* $padcut(x,y) - pads x to y characters and truncates to y if longer\n"\r
-       "* [ .... ] - displays contents of brackets only if at least one of fields referenced inside has been found, eg. \"%artist% - [%album% / ]%title%\" will hide [] block if album field is not present\n"\r
-       "* \' (single quotation mark) - outputs raw text without parsing, eg, \'blah$blah%blah[][]\' will output the contained string and ignore all reserved characters (%,$,[,]) in it; you can use this feature to insert square brackets for an example.\n"\r
-       "\n"\r
-       "eg. \"[%artist% - ][$abbr(%album%,10)[ %tracknumber%] / ]%title%[ %streamtitle%]\"\n";\r
-\r
-\r
-}\r
diff --git a/src/plugin_winamp2/tagz.h b/src/plugin_winamp2/tagz.h
deleted file mode 100644 (file)
index 0862293..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once\r
-\r
-#ifdef  __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#ifndef UINT\r
-typedef unsigned int UINT;\r
-#endif\r
-\r
-#ifdef TAGZ_UNICODE\r
-#if _MSC_VER <= 1200\r
-typedef unsigned short T_CHAR;\r
-#else\r
-typedef wchar_t T_CHAR;\r
-#endif\r
-#else\r
-#define T_CHAR char\r
-#endif\r
-\r
-typedef T_CHAR* (*TAGFUNC)(const T_CHAR *tag,void *p);    /* return 0 if not found */\r
-typedef void (*TAGFREEFUNC)(T_CHAR *tag,void *p);\r
-\r
-\r
-UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR * out,UINT max);\r
-T_CHAR * tagz_format_r(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void * fp);\r
-\r
-extern const char tagz_manual[];\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r