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 _CIRCULAR_SHIFT_H_ 00023 #define _CIRCULAR_SHIFT_H_ 00024 00025 #include "DataTypes.hxx" 00026 #include "Processing.hxx" 00027 #include "CircularShiftConfig.hxx" 00028 #include "InControl.hxx" 00029 #include "AudioInPort.hxx" 00030 #include "AudioOutPort.hxx" 00031 00032 namespace CLAM { 00033 00034 class Spectrum; 00035 class Audio; 00036 class Storage; 00037 class ProcessingConfig; 00038 00042 class CircularShift 00043 : public Processing { 00044 protected: 00045 CircularShiftConfig mConfig; 00046 00047 AudioInPort mInput; 00048 AudioOutPort mOutput; 00049 00050 FloatInControl mSteps; 00051 protected: 00052 00053 const char *GetClassName() const {return "CircularShift";} 00054 00057 bool ConcreteConfigure(const ProcessingConfig&); 00058 00059 public: 00060 CircularShift(); 00061 00062 CircularShift(const CircularShiftConfig &c); 00063 00064 ~CircularShift(); 00065 00066 const ProcessingConfig &GetConfig() const { return mConfig;} 00067 00068 bool Do(void); 00069 00070 bool Do( const DataArray& input, DataArray& out); 00071 bool Do(Spectrum& input, Spectrum& out); 00072 bool Do( const Audio& input, Audio& out); 00073 00074 // Port interfaces. 00075 00077 bool SetPrototypes(Spectrum& inputs,const Spectrum& out); 00079 bool SetPrototypes(); 00081 bool UnsetPrototypes(); 00083 bool MayDisableExecution() const {return true;} 00084 00085 void SetAmount(TSize amount) { mSteps.DoControl(TControlData(amount)); } 00086 }; 00087 00088 } 00089 00090 #endif // _CIRCULAR_SHIFT_H_ 00091