Changeset View
Changeset View
Standalone View
Standalone View
extern/audaspace/include/fx/BaseIIRFilterReader.h
- This file was moved from intern/audaspace/FX/AUD_BaseIIRFilterReader.h.
| /* | /******************************************************************************* | ||||
| * ***** BEGIN GPL LICENSE BLOCK ***** | * Copyright 2009-2016 Jörg Müller | ||||
| * | * | ||||
| * Copyright 2009-2011 Jörg Hermann Müller | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | * | ||||
| * This file is part of AudaSpace. | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
| * | * | ||||
| * Audaspace is free software; you can redistribute it and/or modify | * Unless required by applicable law or agreed to in writing, software | ||||
| * it under the terms of the GNU General Public License as published by | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
| * the Free Software Foundation; either version 2 of the License, or | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * (at your option) any later version. | * See the License for the specific language governing permissions and | ||||
| * | * limitations under the License. | ||||
| * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation, | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||||
| * | |||||
| * ***** END GPL LICENSE BLOCK ***** | |||||
| */ | |||||
| /** \file audaspace/FX/AUD_BaseIIRFilterReader.h | #pragma once | ||||
| * \ingroup audfx | |||||
| */ | |||||
| /** | |||||
| * @file BaseIIRFilterReader.h | |||||
| * @ingroup fx | |||||
| * The BaseIIRFilterReader class. | |||||
| */ | |||||
| #ifndef __AUD_BASEIIRFILTERREADER_H__ | #include "fx/EffectReader.h" | ||||
| #define __AUD_BASEIIRFILTERREADER_H__ | |||||
| #include "AUD_EffectReader.h" | AUD_NAMESPACE_BEGIN | ||||
| #include "AUD_Buffer.h" | |||||
| /** | /** | ||||
| * This class is a base class for infinite impulse response filters. | * This class is a base class for infinite impulse response filters. | ||||
| */ | */ | ||||
| class AUD_BaseIIRFilterReader : public AUD_EffectReader | class AUD_API BaseIIRFilterReader : public EffectReader | ||||
| { | { | ||||
| private: | private: | ||||
| /** | /** | ||||
| * Specs. | * Specs. | ||||
| */ | */ | ||||
| AUD_Specs m_specs; | Specs m_specs; | ||||
| /** | /** | ||||
| * Length of input samples needed. | * Length of input samples needed. | ||||
| Context not available. | |||||
| */ | */ | ||||
| int m_channel; | int m_channel; | ||||
| // hide copy constructor and operator= | // delete copy constructor and operator= | ||||
| AUD_BaseIIRFilterReader(const AUD_BaseIIRFilterReader&); | BaseIIRFilterReader(const BaseIIRFilterReader&) = delete; | ||||
| AUD_BaseIIRFilterReader& operator=(const AUD_BaseIIRFilterReader&); | BaseIIRFilterReader& operator=(const BaseIIRFilterReader&) = delete; | ||||
| protected: | protected: | ||||
| /** | /** | ||||
| Context not available. | |||||
| * \param in The count of past input samples needed. | * \param in The count of past input samples needed. | ||||
| * \param out The count of past output samples needed. | * \param out The count of past output samples needed. | ||||
| */ | */ | ||||
| AUD_BaseIIRFilterReader(boost::shared_ptr<AUD_IReader> reader, int in, int out); | BaseIIRFilterReader(std::shared_ptr<IReader> reader, int in, int out); | ||||
| /** | |||||
| * Sets the length for the required input and output samples of the IIR filter. | |||||
| * @param in The amount of past input samples needed, including the current one. | |||||
| * @param out The amount of past output samples needed. | |||||
| */ | |||||
| void setLengths(int in, int out); | void setLengths(int in, int out); | ||||
| public: | public: | ||||
| Context not available. | |||||
| return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_specs.channels + m_channel]; | return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_specs.channels + m_channel]; | ||||
| } | } | ||||
| virtual ~AUD_BaseIIRFilterReader(); | virtual ~BaseIIRFilterReader(); | ||||
| virtual void read(int& length, bool& eos, sample_t* buffer); | virtual void read(int& length, bool& eos, sample_t* buffer); | ||||
| Context not available. | |||||
| * Notifies the filter about a sample rate change. | * Notifies the filter about a sample rate change. | ||||
| * \param rate The new sample rate. | * \param rate The new sample rate. | ||||
| */ | */ | ||||
| virtual void sampleRateChanged(AUD_SampleRate rate); | virtual void sampleRateChanged(SampleRate rate); | ||||
| }; | }; | ||||
| #endif //__AUD_BASEIIRFILTERREADER_H__ | AUD_NAMESPACE_END | ||||
| Context not available. | |||||