Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/system/MarSystemManager.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_MARSYSTEMMANAGER_H
00020 #define MARSYAS_MARSYSTEMMANAGER_H
00021 
00022 #include <marsyas/system/MarSystem.h>
00023 
00024 #include <string>
00025 #include <map>
00026 #include <vector>
00027 
00028 namespace Marsyas
00029 {
00030 class MarSystem;
00031 
00037 class marsyas_EXPORT MarSystemManager
00038 {
00039 protected:
00040   std::map<std::string, MarSystem*> registry_;
00041   std::map<std::string, MarSystem*> workingSet_;
00042   std::map<std::string, int       > compositesMap_;
00043 
00044   enum compositePrototypes_
00045   {
00046     STUB,
00047     MULTIPITCH,
00048     DEVIBOT,
00049     STEREO2MONO,
00050     TEXTURESTATS,
00051     LPCNET,
00052     POWERSPECTRUMNET,
00053     POWERSPECTRUMNET1,
00054     STFT_FEATURES,
00055     TIMBREFEATURES,
00056     STEREOPANNINGSPECTRUMFEATURES,
00057     STEREOFEATURES,
00058     PHASEVOCODER,
00059     PHASEVOCODEROSCBANK,
00060     PITCHSACF,
00061     PITCHPRAAT,
00062     PEAKANALYSE,
00063     WHASPNET,
00064     STEREOFEATURES2,
00065     CLASSIFIER,
00066     PIPE_BLOCK,
00067     AFB_BLOCK_A,
00068     AFB_BLOCK_B,
00069     AFB_BLOCK_C,
00070     DECIMATING_QMF
00071   };
00072 
00073   void registerComposite(std::string);
00074 
00075 public:
00076   MarSystemManager();
00077   ~MarSystemManager();
00078   void registerPrototype(std::string type, MarSystem *);
00079   MarSystem* getPrototype(std::string type);
00080   MarSystem* create(std::string type, std::string name);
00081   MarSystem* create(std::string fullname);
00082   MarSystem* getMarSystem(std::istream& is, MarSystem *parent=NULL);
00083   MarSystem* loadFromFile(std::string fname);
00084   std::map<std::string, MarSystem*> getWorkingSet(std::istream& is);
00085   const std::map<std::string, MarSystem*> & registry() { return registry_; }
00086 
00087   bool isRegistered (std::string name);
00088 
00089   std::vector <std::string> registeredPrototypes();
00090 };
00091 
00092 }//namespace Marsyas
00093 
00094 #endif