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 00023 #ifndef _SegmentSMSTimeStretch_ 00024 #define _SegmentSMSTimeStretch_ 00025 00026 #include "SegmentTransformation.hxx" 00027 #include "FrameInterpolator.hxx" 00028 #include "SegmentSMSTimeStretchConfig.hxx" 00029 00030 namespace CLAM{ 00031 00032 00033 00036 class SegmentSMSTimeStretch: public SegmentTransformation 00037 { 00038 00039 public: 00041 SegmentSMSTimeStretch(); 00045 SegmentSMSTimeStretch(const SegmentTransformationConfig &c); 00046 00050 const char *GetClassName() const {return "SegmentSMSTimeStretch";} 00051 00052 bool ConcreteConfigure(const ProcessingConfig& c); 00053 bool ConcreteStart(); 00054 bool ConcreteStop(); 00055 00057 ~SegmentSMSTimeStretch(){}; 00058 00059 bool Do() 00060 { 00061 CLAM_ASSERT(false, "Do with ports not implemented"); 00062 return false; 00063 } 00064 00065 bool Do(const Frame& in, Frame& out); 00066 bool Do(const Segment& in, Segment& out); 00067 bool CanProcessInplace() {return false;} 00068 bool IsLastFrame(); 00069 00070 Frame& GetCurrentFrame(Segment& out); 00071 const Frame& GetCurrentFrame(const Segment& in); 00072 00073 FloatInControl mAmount; 00074 protected: 00075 bool HaveFinished(); 00076 void UpdateTimeAndIndex(const Segment& in); 00077 00078 TTime mSynthesisTime; 00079 TTime mAnalysisTime; 00080 TIndex mnSynthesisFrames; 00081 00082 Frame mLeftFrame; 00083 00084 SegmentSMSTimeStretchConfig mConcreteConfig; 00085 00087 FrameInterpolator mPO_FrameInterpolator; 00088 00089 }; 00090 };//namespace CLAM 00091 00092 #endif // _SegmentSMSTimeStretch_ 00093