Merge from trunk -r 25003:25745.
[blender.git] / intern / audaspace / FX / AUD_EnvelopeFactory.cpp
1 /*
2  * $Id$
3  *
4  * ***** BEGIN LGPL LICENSE BLOCK *****
5  *
6  * Copyright 2009 Jörg Hermann Müller
7  *
8  * This file is part of AudaSpace.
9  *
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
13  * (at your option) any later version.
14  *
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 Lesser General Public License for more details.
19  *
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/>.
22  *
23  * ***** END LGPL LICENSE BLOCK *****
24  */
25
26 #include "AUD_EnvelopeFactory.h"
27 #include "AUD_EnvelopeReader.h"
28
29 AUD_EnvelopeFactory::AUD_EnvelopeFactory(AUD_IFactory* factory, float attack,
30                                                                                  float release, float threshold,
31                                                                                  float arthreshold) :
32                 AUD_EffectFactory(factory),
33                 m_attack(attack),
34                 m_release(release),
35                 m_threshold(threshold),
36                 m_arthreshold(arthreshold) {}
37
38 AUD_EnvelopeFactory::AUD_EnvelopeFactory(float attack, float release,
39                                                                                  float threshold, float arthreshold) :
40                 AUD_EffectFactory(0),
41                 m_attack(attack),
42                 m_release(release),
43                 m_threshold(threshold),
44                 m_arthreshold(arthreshold) {}
45
46 AUD_IReader* AUD_EnvelopeFactory::createReader()
47 {
48         AUD_IReader* reader = getReader();
49
50         if(reader != 0)
51         {
52                 reader = new AUD_EnvelopeReader(reader, m_attack, m_release,
53                                                                                 m_threshold, m_arthreshold);
54                 AUD_NEW("reader")
55         }
56
57         return reader;
58 }