4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * Copyright 2009-2011 Jörg Hermann Müller
8 * This file is part of AudaSpace.
10 * Audaspace is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * AudaSpace is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Audaspace; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file audaspace/FX/AUD_CallbackIIRFilterReader.h
32 #ifndef AUD_CALLBACKIIRFILTERREADER
33 #define AUD_CALLBACKIIRFILTERREADER
35 #include "AUD_BaseIIRFilterReader.h"
36 #include "AUD_Buffer.h"
38 class AUD_CallbackIIRFilterReader;
40 typedef sample_t (*doFilterIIR)(AUD_CallbackIIRFilterReader*, void*);
41 typedef void (*endFilterIIR)(void*);
44 * This class provides an interface for infinite impulse response filters via a
45 * callback filter function.
47 class AUD_CallbackIIRFilterReader : public AUD_BaseIIRFilterReader
53 const doFilterIIR m_filter;
56 * End filter function.
58 const endFilterIIR m_endFilter;
65 // hide copy constructor and operator=
66 AUD_CallbackIIRFilterReader(const AUD_CallbackIIRFilterReader&);
67 AUD_CallbackIIRFilterReader& operator=(const AUD_CallbackIIRFilterReader&);
71 * Creates a new callback IIR filter reader.
72 * \param reader The reader to read from.
73 * \param in The count of past input samples needed.
74 * \param out The count of past output samples needed.
75 * \param doFilter The filter callback.
76 * \param endFilter The finishing callback.
77 * \param data Data pointer for the callbacks.
79 AUD_CallbackIIRFilterReader(AUD_IReader* reader, int in, int out,
81 endFilterIIR endFilter = 0,
84 virtual ~AUD_CallbackIIRFilterReader();
86 virtual sample_t filter();
89 #endif //AUD_CALLBACKIIRFILTERREADER