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 __AudioWindowing__ 00023 #define __AudioWindowing__ 00024 00025 #include "WindowGenerator.hxx" 00026 #include "CircularShift.hxx" 00027 #include "AudioWindowingConfig.hxx" 00028 #include "Audio.hxx" 00029 #include "AudioMultiplier.hxx" 00030 #include "ProcessingComposite.hxx" 00031 #include "AudioInPort.hxx" 00032 #include "OutPort.hxx" 00033 00034 namespace CLAM { 00035 00036 class ProcessingConfig; 00037 00042 class AudioWindowing : public ProcessingComposite 00043 { 00044 00045 public: 00046 typedef AudioWindowingConfig Config; 00047 // Processing Object compliance methods. 00048 00049 const char *GetClassName() const {return "AudioWindowing";} 00050 00051 AudioWindowing(const Config& config=Config()) 00052 : mInput("Input",this) 00053 , mOutput("Output",this) 00054 { 00055 AttachChildren(); 00056 Configure(config); 00057 } 00058 ~AudioWindowing(); 00059 00060 const ProcessingConfig &GetConfig() const {return mConfig;} 00061 bool Do(void); 00062 bool Do(const Audio & in,Audio & out); 00063 00064 private: 00065 // Internal configuration data 00066 Config mConfig; 00067 00068 // The internal Processing Objects 00069 WindowGenerator mWindowGenerator; 00070 AudioMultiplier mAudioProduct; 00071 CircularShift mCircularShift; 00072 00073 // Internal Data objects 00074 00077 Audio mWindow; 00078 00079 // Internal convenience methods. 00080 void AttachChildren(); 00081 bool ConfigureChildren(); 00082 void ConfigureData(); 00083 00084 // Redefined methods 00085 bool ConcreteConfigure(const ProcessingConfig&); 00086 00087 // Ports 00088 AudioInPort mInput; 00089 OutPort<Audio> mOutput; 00090 }; 00091 00092 } //namespace 00093 00094 #endif 00095