CLAM-Development  1.4.0
AudioWindowing.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 __AudioWindowing__
23 #define __AudioWindowing__
24 
25 #include "WindowGenerator.hxx"
26 #include "CircularShift.hxx"
27 #include "AudioWindowingConfig.hxx"
28 #include "Audio.hxx"
29 #include "AudioMultiplier.hxx"
30 #include "ProcessingComposite.hxx"
31 #include "AudioInPort.hxx"
32 #include "OutPort.hxx"
33 
34 namespace CLAM {
35 
36 class ProcessingConfig;
37 
43 {
44 
45 public:
47 // Processing Object compliance methods.
48 
49  const char *GetClassName() const {return "AudioWindowing";}
50 
51  AudioWindowing(const Config& config=Config())
52  : mInput("Input",this)
53  , mOutput("Output",this)
54  {
55  AttachChildren();
56  Configure(config);
57  }
59 
60  const ProcessingConfig &GetConfig() const {return mConfig;}
61  bool Do(void);
62  bool Do(const Audio & in,Audio & out);
63 
64 private:
65  // Internal configuration data
66  Config mConfig;
67 
68  // The internal Processing Objects
69  WindowGenerator mWindowGenerator;
70  AudioMultiplier mAudioProduct;
71  CircularShift mCircularShift;
72 
73  // Internal Data objects
74 
77  Audio mWindow;
78 
79  // Internal convenience methods.
80  void AttachChildren();
81  bool ConfigureChildren();
82  void ConfigureData();
83 
84  // Redefined methods
85  bool ConcreteConfigure(const ProcessingConfig&);
86 
87  // Ports
88  AudioInPort mInput;
89  OutPort<Audio> mOutput;
90 };
91 
92 } //namespace
93 
94 #endif
95