2
* $Id: AUD_EnvelopeFactory.h 25643 2010-01-01 05:09:30Z nexyon $
4
* ***** BEGIN LGPL LICENSE BLOCK *****
6
* Copyright 2009 Jörg Hermann Müller
2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* Copyright 2009-2011 Jörg Hermann Müller
8
6
* 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 Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
8
* Audaspace is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
13
11
* (at your option) any later version.
15
13
* AudaSpace is distributed in the hope that it will be useful,
16
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
23
* ***** END LGPL LICENSE BLOCK *****
26
#ifndef AUD_ENVELOPEFACTORY
27
#define AUD_ENVELOPEFACTORY
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Audaspace; if not, write to the Free Software Foundation,
20
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
* ***** END GPL LICENSE BLOCK *****
25
/** \file audaspace/FX/AUD_EnvelopeFactory.h
30
#ifndef __AUD_ENVELOPEFACTORY_H__
31
#define __AUD_ENVELOPEFACTORY_H__
29
33
#include "AUD_EffectFactory.h"
34
class AUD_CallbackIIRFilterReader;
35
struct EnvelopeParameters;
32
38
* This factory creates an envelope follower reader.
38
44
* The attack value in seconds.
43
49
* The release value in seconds.
51
const float m_release;
48
54
* The threshold value.
56
const float m_threshold;
53
59
* The attack/release threshold value.
61
const float m_arthreshold;
63
// hide copy constructor and operator=
64
AUD_EnvelopeFactory(const AUD_EnvelopeFactory&);
65
AUD_EnvelopeFactory& operator=(const AUD_EnvelopeFactory&);
63
73
* \param threshold The threshold value.
64
74
* \param arthreshold The attack/release threshold value.
66
AUD_EnvelopeFactory(AUD_IFactory* factory, float attack, float release,
76
AUD_EnvelopeFactory(AUD_Reference<AUD_IFactory> factory, float attack, float release,
67
77
float threshold, float arthreshold);
70
* Creates a new envelope factory.
71
* \param attack The attack value in seconds.
72
* \param release The release value in seconds.
73
* \param threshold The threshold value.
74
* \param arthreshold The attack/release threshold value.
76
AUD_EnvelopeFactory(float attack, float release, float threshold,
79
virtual AUD_Reference<AUD_IReader> createReader();
79
virtual AUD_IReader* createReader();
81
static sample_t envelopeFilter(AUD_CallbackIIRFilterReader* reader, EnvelopeParameters* param);
82
static void endEnvelopeFilter(EnvelopeParameters* param);
82
#endif //AUD_ENVELOPEFACTORY
85
#endif //__AUD_ENVELOPEFACTORY_H__