Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/Talk.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2005 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_TALK_H
00020 #define MARSYAS_TALK_H
00021 
00022 #include <marsyas/marsystems/AbsMax.h>
00023 #include <marsyas/marsystems/SoundFileSource.h>
00024 #include <marsyas/marsystems/Series.h>
00025 #include <marsyas/marsystems/Accumulator.h>
00026 #include <marsyas/marsystems/AudioSink.h>
00027 #include <marsyas/TimeLine.h>
00028 #include "Communicator.h"
00029 
00030 #include <string.h>
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <string>
00034 
00035 #define SEPCHARS " \t\n"
00036 #define UNSPECIFIED -1
00037 #define WIN_SIZE 512
00038 
00039 #ifdef WIN32
00040 #define MARSYAS_MFDIR ""
00041 #endif
00042 
00043 namespace Marsyas
00044 {
00055 class Talk
00056 {
00057 private:
00058   Communicator* communicator_;
00059   void cmd_load(std::string fname, mrs_natural lineSize);
00060   void cmd_play(mrs_natural start, mrs_natural end, mrs_natural lineSize);
00061 
00062   void cmd_merge(std::string systemName, unsigned int pstart, unsigned int pend,
00063                  unsigned int start,  unsigned int end,
00064                  unsigned int winSize);
00065   void cmd_classify(std::string system, std::string classifier, unsigned int start, unsigned int end, unsigned int winSize);
00066   void cmd_extract(std::string systemName, std::string fileName, TimeLine tline);
00067   void cmd_segment(std::string systemName, unsigned int memSize, unsigned int numPeaks, unsigned int peakSpacing, unsigned int start, unsigned int end, unsigned int winSize);
00068 
00069   void cmd_fullfft(unsigned int winSize);
00070   void cmd_fft(unsigned int start, unsigned int winSize);
00071   void cmd_colorgram(std::string collection, std::string system, unsigned int start, unsigned int end, unsigned int win_size);
00072   SoundFileSource *src_;
00073   AudioSink *dest_;
00074 
00075   std::string fname_;
00076 
00077 public:
00078   Talk();
00079   ~Talk();
00080   void init(Communicator* communicator);
00081   void process(char *message);
00082 };
00083 
00084 }//namespace Marsyas
00085 
00086 
00087 
00088 
00089 #endif
00090 
00091 
00092 
00093 
00094