CLAM-Development  1.4.0
FrameInterpolator.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 _Frame_Interpolator_
23 #define _Frame_Interpolator_
24 
25 #include "ProcessingComposite.hxx"
26 #include "DynamicType.hxx"
27 #include "Frame.hxx"
28 #include "InPort.hxx"
29 #include "OutPort.hxx"
30 #include "SpectrumInterpolator.hxx"
32 
33 namespace CLAM {
34 
35 
37  {
38  public:
40  DYN_ATTRIBUTE(0, public, TData, MagInterpolationFactor);
41  DYN_ATTRIBUTE(1, public, TData, FreqInterpolationFactor);
42  DYN_ATTRIBUTE(2, public, TData, PitchInterpolationFactor);
43  DYN_ATTRIBUTE(3, public, TData, ResidualInterpolationFactor);
44  DYN_ATTRIBUTE(4, public, bool, Harmonic);
45  DYN_ATTRIBUTE(5, public, bool, UseSpectralShape);
46  protected:
47  void DefaultInit();
48  void DefaultValues();
49 
50  };
51 
61  typedef FrameInterpConfig Config;
62  Config mConfig;
63 
64 
65  const char *GetClassName() const {return "FrameInterpolator";}
66 
67 
71  bool ConcreteConfigure(const ProcessingConfig&);
72 
73  void AttachChildren();
74 
75  public:
77 
79 
80  const ProcessingConfig &GetConfig() const { return mConfig;}
81 
82  bool Do(void);
83 
84  bool Do(const Frame& in1, const Frame& in2, Frame& out);
85 
86 
89 
94 
99 
102 
107 
109 
111  private:
113  SpectrumInterpolator mPO_SpectrumInterpolator;
114  SpectralPeakArrayInterpolator mPO_PeaksInterpolator;
115 
117  void DoFrameFactorControl(TControlData value);
118 
119  void DoMagFactorControl(TControlData value);
120  void DoFreqFactorControl(TControlData value);
121  void DoPitchFactorControl(TControlData value);
122  void DoResidualFactorControl(TControlData value);
123 
124  void DoPitch1Control(TControlData value);
125  void DoPitch2Control(TControlData value);
126 
127  void DoHarmonicControl(TControlData value);
128 
129  };
130 
131 }
132 
133 #endif // _Frame_Interpolator_
134