CLAM-Development
1.1
|
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 #include "Processing.hxx" 00023 00024 namespace CLAM { 00025 00029 class PrintControlConfig: public ProcessingConfig 00030 { 00031 public: 00032 DYNAMIC_TYPE_USING_INTERFACE (PrintControlConfig, 2,ProcessingConfig); 00033 00035 DYN_ATTRIBUTE (0, public, std::string, Name); 00036 00038 DYN_ATTRIBUTE (1, public, std::string, Message); 00039 protected: 00040 00042 void DefaultInit() 00043 { 00044 AddName(); 00045 AddMessage(); 00046 UpdateData(); 00047 SetMessage("print:"); 00048 } 00049 }; 00050 00051 00055 class PrintControl:public Processing 00056 { 00057 private: 00058 PrintControlConfig mConfig; 00059 00060 public: 00061 InControlTmpl<PrintControl> mInput; 00062 00066 PrintControl(const PrintControlConfig& cfg) 00067 :mInput("input",this,&PrintControl::DoPrint) { 00068 Configure(cfg); 00069 } 00070 00071 const char * GetClassName() const {return "PrintControl";} 00072 00078 bool ConcreteConfigure(const ProcessingConfig& c) 00079 { 00080 CopyAsConcreteConfig(mConfig, c); 00081 return true; 00082 } 00083 00087 const ProcessingConfig &GetConfig() const { return mConfig;}; 00088 00093 int DoPrint(TControlData val) 00094 { 00095 printf("%s %f\n",mConfig.GetMessage().c_str(),val); 00096 return 1; 00097 } 00098 00100 bool Do(void) { return true; } 00101 }; 00102 00103 } 00104