Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/marsystems/MarFileSink.cpp
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2010 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 #include "MarFileSink.h"
00020 
00021 
00022 using std::ostringstream;
00023 using std::cout;
00024 using std::endl;
00025 
00026 using namespace Marsyas;
00027 
00028 MarFileSink::MarFileSink(mrs_string name):MarSystem("MarFileSink",name)
00029 {
00030   //type_ = "MarFileSink";
00031   //name_ = name;
00032 }
00033 
00034 MarFileSink::~MarFileSink()
00035 {
00036 }
00037 
00038 
00039 MarSystem*
00040 MarFileSink::clone() const
00041 {
00042   return new MarFileSink(*this);
00043 }
00044 
00045 void
00046 MarFileSink::myProcess(realvec& in, realvec& out)
00047 {
00048   mrs_natural t,o;
00049   mrs_natural nObservations = getctrl("mrs_natural/inObservations")->to<mrs_natural>();
00050   mrs_natural nSamples = getctrl("mrs_natural/inSamples")->to<mrs_natural>();
00051 
00052   checkFlow(in, out);
00053 
00054   for (o=0; o < nObservations; o++)
00055     for (t = 0; t < nSamples; t++)
00056     {
00057       out(o,t) = in(o,t);
00058       cout << out(o,t) << " ";
00059     }
00060   cout << endl;
00061 }
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080