Envelope.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef _Envelope_
00023 #define _Envelope_
00024 
00025 #include <typeinfo>
00026 #include "DynamicType.hxx"
00027 #include "Array.hxx"
00028 #include "BPF.hxx"
00029 #include "DataTypes.hxx"
00030 #include "OSDefines.hxx"
00031 #include "Err.hxx"
00032 #include "ProcessingDataConfig.hxx"
00033 #include "ProcessingData.hxx"
00034 #include "GlobalEnums.hxx"
00035 
00036 
00037 namespace CLAM{
00038 
00042         class EnvelopeConfig : public ProcessingDataConfig
00043         {
00044         public:
00045 
00046                 DYNAMIC_TYPE_USING_INTERFACE (EnvelopeConfig, 3, ProcessingDataConfig);
00048                 DYN_ATTRIBUTE (0, public, EScale, Scale);
00050                 DYN_ATTRIBUTE (1, public, int,    BPFSize);
00052                 DYN_ATTRIBUTE (2, public, EInterpolation, InterpolationType);
00053 
00054                 ~EnvelopeConfig(){};
00055         protected:
00056                 void DefaultInit();
00057                 
00058         };
00059 
00067         class Envelope : public ProcessingData
00068         {
00069         public:
00070 
00071                 typedef BPFTmpl<TTime,TData> TEnvelopeBPF;
00072 
00073                 DYNAMIC_TYPE_USING_INTERFACE (Envelope, 2, ProcessingData);
00074 
00077                 DYN_ATTRIBUTE (0, public, EnvelopeConfig, Config);
00078 
00081                 DYN_ATTRIBUTE (1, public, TEnvelopeBPF , AmplitudeBPF); 
00082         public:
00083 
00088                 Envelope(const EnvelopeConfig &newConfig);
00089 
00094                 inline const ProcessingDataConfig &GetProcessingDataConfig() const;
00095 
00100                 void Configure(const EnvelopeConfig &newConfig);
00101 
00104         protected:
00105                 void DefaultInit();
00106 
00107         public:
00108                 // Config shortcut interface.
00109 
00114                 inline int GetBPFSize() const;
00115 
00120                 inline void SetBPFSize(int s);
00121 
00122 
00127                 inline int GetScale() const;
00128 
00133                 inline void SetScale(int s);
00134         
00135         };
00136 
00138 
00139         const ProcessingDataConfig &Envelope::GetProcessingDataConfig() const
00140         { 
00141                 return GetConfig();
00142         };
00143 
00144         int Envelope::GetBPFSize() const
00145         {
00146                 return GetConfig().GetBPFSize();
00147         }
00148 
00149         void Envelope::SetBPFSize(int s)
00150         {
00151                 GetConfig().SetBPFSize(s);
00152         }
00153 
00154         int Envelope::GetScale() const
00155         {
00156                 return GetConfig().GetScale();
00157         }
00158         void Envelope::SetScale(int s)
00159         {
00160                 GetConfig().SetScale(s);
00161         }
00162 
00163 
00164 }; // namespace CLAM
00165 
00166 #endif
00167 
Generated by  doxygen 1.6.3