Index: include/libroardsp/libroardsp.h
===================================================================
--- include/libroardsp/libroardsp.h	(revision 874)
+++ include/libroardsp/libroardsp.h	(revision 882)
@@ -77,4 +77,9 @@
 };
 
+struct roardsp_amp {
+ int32_t  mul;
+ int32_t  div;
+};
+
 // funcs:
 int    roardsp_filter_str2id(char * str);
@@ -103,4 +108,10 @@
 int roardsp_highp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
 
+int roardsp_amp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
+int roardsp_amp_uninit(struct roardsp_filter * filter);
+int roardsp_amp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
+int roardsp_amp_calc8 (struct roardsp_filter * filter, void * data, size_t samples);
+int roardsp_amp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+
 // codecs:
 int roardsp_conv_alaw2pcm16 (int16_t * out, char * in, size_t len);
Index: libroardsp/Makefile
===================================================================
--- libroardsp/Makefile	(revision 734)
+++ libroardsp/Makefile	(revision 882)
@@ -4,5 +4,5 @@
 OBJS=libroardsp.o filter.o filterchain.o alaw.o
 OLDROAR=midi.o
-FILTER=lowp.o highp.o
+FILTER=lowp.o highp.o amp.o
 
 #DEFINES        = -DDEBUG
Index: libroardsp/filter.c
===================================================================
--- libroardsp/filter.c	(revision 683)
+++ libroardsp/filter.c	(revision 882)
@@ -33,6 +33,6 @@
  int (*calc  [5][3])(struct roardsp_filter * filter, void * data, size_t samples);
 } _roardsp_filterlist[] = {
- {ROARDSP_FILTER_AMP, "AMP", NULL, NULL, NULL, {
-           {NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
+ {ROARDSP_FILTER_AMP, "AMP", roardsp_amp_init, roardsp_amp_uninit, roardsp_amp_ctl, {
+           {NULL, NULL, NULL},{roardsp_amp_calc8, NULL, NULL},{roardsp_amp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
  {ROARDSP_FILTER_LOWP, "Lowpass", roardsp_lowp_init, roardsp_lowp_uninit, roardsp_lowp_ctl, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_lowp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
Index: libroardsp/filter_amp.c
===================================================================
--- libroardsp/filter_amp.c	(revision 882)
+++ libroardsp/filter_amp.c	(revision 882)
@@ -0,0 +1,105 @@
+//amp.c:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - August 2008
+ *
+ *  This file is part of libroardsp a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  libroardsp 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 software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "libroardsp.h"
+
+int roardsp_amp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
+ struct roardsp_amp * self = malloc(sizeof(struct roardsp_amp));
+ int32_t fac;
+
+ if ( self == NULL )
+  return -1;
+
+ memset(self, 0, sizeof(struct roardsp_amp));
+
+ filter->inst = (void*) self;
+
+ fac = 1;
+ roardsp_amp_ctl(filter, ROARDSP_FCTL_MUL, &fac);
+ fac = 1;
+ roardsp_amp_ctl(filter, ROARDSP_FCTL_DIV, &fac);
+
+ return 0;
+}
+
+int roardsp_amp_uninit(struct roardsp_filter * filter) {
+
+ free(filter->inst);
+ return 0;
+}
+
+int roardsp_amp_calc8  (struct roardsp_filter * filter, void * data, size_t samples) {
+ struct roardsp_amp * self = (struct roardsp_amp *) filter->inst;
+ int8_t * samp = (int8_t *) data;
+ register int_least32_t s;
+ size_t i;
+
+ for (i = 0; i < samples; i++) {
+  s        = samp[i];
+  s       *= self->mul;
+  s       /= self->div;
+  samp[i]  = s;
+ };
+
+ return 0;
+}
+
+int roardsp_amp_calc16  (struct roardsp_filter * filter, void * data, size_t samples) {
+ struct roardsp_amp * self = (struct roardsp_amp *) filter->inst;
+ int16_t * samp = (int16_t *) data;
+ register int_least32_t s;
+ size_t i;
+
+ for (i = 0; i < samples; i++) {
+  s        = samp[i];
+  s       *= self->mul;
+  s       /= self->div;
+//  ROAR_DBG("roardsp_amp_calc16(*): samp[i=%u] = %i, s=%i, self->mul=%i, self->div=%i", i, samp[i], s, self->mul, self->div);
+  samp[i]  = s;
+ };
+
+ return 0;
+}
+
+int roardsp_amp_ctl   (struct roardsp_filter * filter, int cmd, void * data) {
+ struct roardsp_amp * self = (struct roardsp_amp *) filter->inst;
+ int32_t old;
+
+ if ( cmd == ROARDSP_FCTL_MUL ) {
+  old = self->div;
+  self->mul = *(int32_t*)data;
+  *(int32_t*)data = old;
+ } else if ( cmd == ROARDSP_FCTL_DIV ) {
+  old = self->div;
+  self->div = *(int32_t*)data;
+  *(int32_t*)data = old;
+ } else {
+  return -1;
+ }
+
+
+ return 0;
+}
+
+//ll
