# HG changeset patch # User nenolod # Date 1141960181 28800 # Node ID f9a1ddb7243285beb3d958ecc6aeee4755e4f025 # Parent 86ca43d8a8451a04dd96961defc057fbb8225955 [svn] - add voice_removal plugin. Ported by: Thomas Cort , tcort @ #audacious. diff -r 86ca43d8a845 -r f9a1ddb72432 Plugins/Effect/Makefile.in --- a/Plugins/Effect/Makefile.in Thu Mar 09 19:03:27 2006 -0800 +++ b/Plugins/Effect/Makefile.in Thu Mar 09 19:09:41 2006 -0800 @@ -1,4 +1,4 @@ include ../../mk/rules.mk include ../../mk/objective.mk -SUBDIRS = ladspa +SUBDIRS = ladspa voice_removal diff -r 86ca43d8a845 -r f9a1ddb72432 Plugins/Effect/voice_removal/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Effect/voice_removal/Makefile.in Thu Mar 09 19:09:41 2006 -0800 @@ -0,0 +1,15 @@ +include ../../../mk/rules.mk +include ../../../mk/objective.mk + +OBJECTIVE_LIBS = libvoice_removal.so + +LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR) + +LIBADD = $(GTK_LIBS) + +SOURCES = voice_removal.c + +CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) -I../../../intl -I../../.. + +OBJECTS = ${SOURCES:.c=.o} + diff -r 86ca43d8a845 -r f9a1ddb72432 Plugins/Effect/voice_removal/voice_removal.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Effect/voice_removal/voice_removal.c Thu Mar 09 19:09:41 2006 -0800 @@ -0,0 +1,73 @@ +/* + * libxmmsstandard - XMMS plugin. + * Copyright (C) 2000-2001 Konstantin Laevsky + * + * audacious port of the voice removal code from libxmmsstandard + * by Thomas Cort + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + */ + +#include +#include +#include + +#include "../../../config.h" + +#define PLUGIN_NAME "voice_removal " PACKAGE_VERSION + +static int apply_effect (gpointer *d, gint length, AFormat afmt, + gint srate, gint nch); + +static EffectPlugin xmms_plugin = { + NULL, + NULL, + PLUGIN_NAME, + NULL, + NULL, + NULL, + NULL, + apply_effect, + NULL +}; + +EffectPlugin *get_eplugin_info (void) { + return &xmms_plugin; +} + +static int apply_effect (gpointer *d, gint length, AFormat afmt, + gint srate, gint nch) { + int x; + int left, right; + gint16 *dataptr = (gint16 *) * d; + + if (!((afmt == FMT_S16_NE) || + (afmt == FMT_S16_LE && G_BYTE_ORDER == G_LITTLE_ENDIAN) || + (afmt == FMT_S16_BE && G_BYTE_ORDER == G_BIG_ENDIAN)) || + (nch != 2)) { + return length; + } + + for (x = 0; x < length; x += 4) { + left = CLAMP(dataptr[1] - dataptr[0], -32768, 32767); + right = CLAMP(dataptr[0] - dataptr[1], -32768, 32767); + dataptr[0] = left; + dataptr[1] = right; + dataptr += 2; + } + + return (length); +} diff -r 86ca43d8a845 -r f9a1ddb72432 configure.ac --- a/configure.ac Thu Mar 09 19:03:27 2006 -0800 +++ b/configure.ac Thu Mar 09 19:09:41 2006 -0800 @@ -116,7 +116,7 @@ dnl These plugins are always built. INPUT_PLUGINS="cdaudio tonegen console sexypsf wav" -EFFECT_PLUGINS="ladspa" +EFFECT_PLUGINS="ladspa voice_removal" GENERAL_PLUGINS="song_change" VISUALIZATION_PLUGINS="blur_scope" @@ -902,6 +902,7 @@ Plugins/General/scrobbler/tags/Makefile Plugins/Effect/Makefile Plugins/Effect/ladspa/Makefile + Plugins/Effect/voice_removal/Makefile po/Makefile.in intl/Makefile icons/Makefile @@ -975,6 +976,7 @@ echo " Effect" echo " ------" echo " LADSPA effects host (ladspa): yes" +echo " Voice Removal: yes" echo echo " Visualization" echo " -------------"