Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/marsystems/Combinator.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2006 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 #ifndef MARSYAS_Combinator_H
00020 #define MARSYAS_Combinator_H
00021 
00022 #include <marsyas/system/MarSystem.h>
00023 
00024 namespace Marsyas
00025 {
00037 class marsyas_EXPORT Combinator: public MarSystem
00038 {
00039 private:
00040 
00042   void addControls();
00043 
00045   void myUpdate(MarControlPtr sender);
00046 
00047   // Pointers to controls allow efficient access to their
00048   // values.  For clarity, we use the ctrl_ prefix so these
00049   // pointers can be easily identified throughout the code...
00050   // but this is not mandatory, just recommended)
00051 
00052   enum Combinators_t
00053   {
00054     kAdd,
00055     kMult,
00056     kMax,
00057     kMin,
00058 
00059     kNumCombinators
00060   };
00061   Combinators_t GetCombinatorIdx (const mrs_string ctrlString);
00062 
00063   static const mrs_string combinatorStrings[kNumCombinators];
00064 
00066   MarControlPtr ctrl_weights_,
00067                 ctrl_combinator_,
00068                 ctrl_numInputs_;
00069 
00070 public:
00072   Combinator(std::string name);
00073 
00075   Combinator(const Combinator& a);
00076 
00078   ~Combinator();
00079 
00081   MarSystem* clone() const;
00082 
00084   void myProcess(realvec& in, realvec& out);
00085 };
00086 
00087 }
00088 //namespace Marsyas
00089 
00090 #endif
00091 //MARSYAS_Combinator_H
00092