CLAM-Development  1.4.0
Envelope.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef _Envelope_
23 #define _Envelope_
24 
25 #include <typeinfo>
26 #include "DynamicType.hxx"
27 #include "Array.hxx"
28 #include "BPF.hxx"
29 #include "DataTypes.hxx"
30 #include "OSDefines.hxx"
31 #include "Err.hxx"
32 #include "ProcessingDataConfig.hxx"
33 #include "ProcessingData.hxx"
34 #include "GlobalEnums.hxx"
35 
36 
37 namespace CLAM{
38 
43  {
44  public:
45 
48  DYN_ATTRIBUTE (0, public, EScale, Scale);
50  DYN_ATTRIBUTE (1, public, int, BPFSize);
52  DYN_ATTRIBUTE (2, public, EInterpolation, InterpolationType);
53 
55  protected:
56  void DefaultInit();
57 
58  };
59 
67  class Envelope : public ProcessingData
68  {
69  public:
70 
72 
74 
77  DYN_ATTRIBUTE (0, public, EnvelopeConfig, Config);
78 
81  DYN_ATTRIBUTE (1, public, TEnvelopeBPF , AmplitudeBPF);
82  public:
83 
88  Envelope(const EnvelopeConfig &newConfig);
89 
94  inline const ProcessingDataConfig &GetProcessingDataConfig() const;
95 
100  void Configure(const EnvelopeConfig &newConfig);
101 
104  protected:
105  void DefaultInit();
106 
107  public:
108  // Config shortcut interface.
109 
114  inline int GetBPFSize() const;
115 
120  inline void SetBPFSize(int s);
121 
122 
127  inline int GetScale() const;
128 
133  inline void SetScale(int s);
134 
135  };
136 
138 
140  {
141  return GetConfig();
142  };
143 
145  {
146  return GetConfig().GetBPFSize();
147  }
148 
150  {
151  GetConfig().SetBPFSize(s);
152  }
153 
154  int Envelope::GetScale() const
155  {
156  return GetConfig().GetScale();
157  }
158  void Envelope::SetScale(int s)
159  {
160  GetConfig().SetScale(s);
161  }
162 
163 
164 }; // namespace CLAM
165 
166 #endif
167