ControlSink.hxx

Go to the documentation of this file.
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_OUT_CONTROL_
00023 #define _EXTERN_OUT_CONTROL_
00024 
00025 #include "Processing.hxx"
00026 #include "InControl.hxx"
00027 
00028 namespace CLAM{
00029         
00030         class ControlSinkConfig : public ProcessingConfig
00031         {
00032         public:
00033                 DYNAMIC_TYPE_USING_INTERFACE (ControlSinkConfig,3,ProcessingConfig);
00034                 DYN_ATTRIBUTE(0,public,TData, MinValue);
00035                 DYN_ATTRIBUTE(1,public,TData, MaxValue);
00036                 DYN_ATTRIBUTE(2,public,TData, Step);
00037         protected:
00038                 void DefaultInit()
00039                 {
00040                         AddAll();
00041                         UpdateData();
00042                         SetMinValue(0.0);
00043                         SetMaxValue(100.0);
00044                         SetStep(1.0);
00045                 }
00046         };
00047 
00048         class ControlSink : public Processing
00049         {
00050         private:
00051                 ControlSinkConfig mConf;
00052                 FloatInControl mInput;
00053                 
00054         public:
00055                 ControlSink() 
00056                 : mInput("input",this)
00057                 {
00058                 }
00059                 
00060                 ControlSink(const ControlSinkConfig & c)
00061                 : mInput("input",this)
00062                 {
00063                         ConcreteConfigure(c);
00064                 }
00065                 
00066                 ~ControlSink() {}
00067         
00068                 bool Do();
00069                 float GetControlValue();
00070                 
00071                 const char* GetClassName() const { return "ControlSink";}
00072                 
00073                 bool ConcreteConfigure(const ProcessingConfig &c);
00074                 
00075                 const ProcessingConfig& GetConfig() const
00076                 {
00077                         return mConf;
00078                 }
00079         };
00080 } //namespace CLAM
00081 
00082 #endif
00083 
Generated by  doxygen 1.6.3