From 1e9cb9bfc0f370d087cd3e470c44a96fc3c434fb Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Sat, 25 Aug 2012 22:01:35 -0300 Subject: [PATCH] Generalize filters as DSP effects Add DSP flags to mixer and generalize the existing lowpass filter as a DSP effect. Reverb and chorus effects (used in e.g. IMF) can be added to the list later. Signed-off-by: Claudio Matsuoka --- src/common.h | 1 + src/main.c | 2 ++ src/options.c | 5 +---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common.h b/src/common.h index 25e177d..9b70406 100644 --- a/src/common.h +++ b/src/common.h @@ -11,6 +11,7 @@ struct options { int max_time; /* max. replay time */ int mix; /* channel separation */ int interp; /* interpolation type */ + int dsp; /* dsp effects */ int loop; /* loop module */ int random; /* play in random order */ int verbose; diff --git a/src/main.c b/src/main.c index 280ae6d..76cf984 100644 --- a/src/main.c +++ b/src/main.c @@ -174,6 +174,7 @@ int main(int argc, char **argv) options.mix = -1; options.driver_id = NULL; options.interp = XMP_INTERP_LINEAR; + options.dsp = XMP_DSP_LOWPASS; get_options(argc, argv, &options); @@ -301,6 +302,7 @@ int main(int argc, char **argv) if (xmp_player_start(handle, options.rate, options.format) == 0) { xmp_mixer_set(handle, XMP_MIXER_INTERP, options.interp); + xmp_mixer_set(handle, XMP_MIXER_DSP, options.dsp); xmp_set_position(handle, options.start); diff --git a/src/options.c b/src/options.c index 4ac2015..1dc750a 100644 --- a/src/options.c +++ b/src/options.c @@ -157,11 +157,8 @@ void get_options(int argc, char **argv, struct options *options) options->driver_id = optarg; break; case 'F': -/* FIXME */ -#if 0 - options->format |= XMP_FORMAT_NOFILTER; + options->dsp &= ~XMP_DSP_LOWPASS;; break; -#endif case 'f': options->rate = strtoul(optarg, NULL, 0); break;