CLAM-Development
1.1
|
00001 /* 00002 * Copyright (c) 2001-2005 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 _EXTERN_IN_CONTROL_ 00023 #define _EXTERN_IN_CONTROL_ 00024 00025 #include "Processing.hxx" 00026 #include "OutControl.hxx" 00027 00028 namespace CLAM{ 00029 00030 class ControlSourceConfig : public ProcessingConfig 00031 { 00032 public: 00033 DYNAMIC_TYPE_USING_INTERFACE ( ControlSourceConfig, 4, ProcessingConfig); 00034 DYN_ATTRIBUTE(0,public,TData, MinValue); 00035 DYN_ATTRIBUTE(1,public,TData, MaxValue); 00036 DYN_ATTRIBUTE(2,public,TData, Step); 00037 DYN_ATTRIBUTE(3,public, std::string, UnitName); 00038 protected: 00039 void DefaultInit() 00040 { 00041 AddAll(); 00042 UpdateData(); 00043 SetMinValue(0.0); 00044 SetMaxValue(100.0); 00045 SetStep(1.0); 00046 SetUnitName("-"); 00047 } 00048 }; 00049 00050 class ControlSource : public Processing 00051 { 00052 private: 00053 ControlSourceConfig mConf; 00054 OutControl mOutput; 00055 00056 public: 00057 ControlSource() 00058 : mOutput("output",this) 00059 { 00060 } 00061 00062 ControlSource(const ControlSourceConfig & c) 00063 : mOutput("output",this) 00064 { 00065 ConcreteConfigure(c); 00066 } 00067 00068 ~ControlSource() {} 00069 00070 bool Do() 00071 { 00072 return true; 00073 } 00074 00075 bool Do( const float value ); 00076 00077 const char* GetClassName() const { return "ControlSource";} 00078 00079 bool ConcreteConfigure(const ProcessingConfig &c); 00080 00081 const ProcessingConfig& GetConfig() const 00082 { 00083 return mConf; 00084 } 00085 }; 00086 } //namespace CLAM 00087 00088 #endif 00089