00001 #ifndef _INCONTROL_PUBLISHER_HXX_ 00002 #define _INCONTROL_PUBLISHER_HXX_ 00003 00004 #include "InControl.hxx" 00005 #include <string> 00006 00007 // TODO: Refactoring... 00008 // Extract common interface from InControlPublisher, InControl and create a common base class 00009 namespace CLAM 00010 { 00011 class InControlPublisher : public FloatInControl 00012 { 00013 FloatInControl* mPublished; //TODO should be a list, in the future 00014 00015 public: 00016 InControlPublisher() 00017 : FloatInControl( "InControlPublisher", 0 ) 00018 { 00019 mPublished=NULL; 00020 } 00021 00022 InControlPublisher( const std::string& name, Processing* father ) 00023 : FloatInControl( name, father ) 00024 { 00025 mPublished=NULL; 00026 } 00027 00028 void PublishInControl( FloatInControl& in ) 00029 { 00030 mPublished = ∈ 00031 } 00032 void DoControl(const TControlData & val) 00033 { 00034 if(mPublished) 00035 mPublished->DoControl(val); 00036 else 00037 FloatInControl::DoControl(val); 00038 } 00039 const TControlData& GetLastValue() const 00040 { 00041 if(mPublished) 00042 return mPublished->GetLastValue(); 00043 return mLastValue; 00044 } 00045 00046 }; 00047 00048 } // namespace CLAM 00049 00050 #endif 00051