00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "FlowCutSource.h"
00021
00022 using std::ostringstream;
00023 using namespace Marsyas;
00024
00025 FlowCutSource::FlowCutSource(mrs_string name):MarSystem("FlowCutSource", name)
00026 {
00027
00028 addControls();
00029 }
00030
00031 FlowCutSource::FlowCutSource(const FlowCutSource& a) : MarSystem(a)
00032 {
00033
00034 }
00035
00036 FlowCutSource::~FlowCutSource()
00037 {
00038 }
00039
00040 MarSystem*
00041 FlowCutSource::clone() const
00042 {
00043 return new FlowCutSource(*this);
00044 }
00045
00046 void
00047 FlowCutSource::addControls()
00048 {
00049
00050 addctrl("mrs_natural/setSamples", 0);
00051 addctrl("mrs_natural/setObservations", 0);
00052 addctrl("mrs_real/setRate", 0.0);
00053 setctrlState("mrs_natural/setSamples", true);
00054 setctrlState("mrs_natural/setObservations", true);
00055 setctrlState("mrs_real/setRate", true);
00056 }
00057
00058 void
00059 FlowCutSource::myUpdate(MarControlPtr sender)
00060 {
00061 MarSystem::myUpdate(sender);
00062
00063 if(getctrl("mrs_natural/setSamples")->to<mrs_natural>())
00064 setctrl("mrs_natural/onSamples", getctrl("mrs_natural/setSamples")->to<mrs_natural>());
00065 if(getctrl("mrs_natural/setObservations")->to<mrs_natural>())
00066 setctrl("mrs_natural/onObservations", getctrl("mrs_natural/setObservations")->to<mrs_natural>());
00067 if(getctrl("mrs_real/setRate")->to<mrs_real>())
00068 setctrl("mrs_real/osrate", getctrl("mrs_real/setRate")->to<mrs_real>());
00069 }
00070
00071
00072 void
00073 FlowCutSource::myProcess(realvec& in, realvec& out)
00074 {
00075 mrs_natural o,t;
00076 (void) in;
00077 for (o=0; o < onObservations_; o++)
00078 {
00079 for (t = 0; t < onSamples_; t++)
00080 {
00081 out(o,t) =0;
00082 }
00083 }
00084 }
00085
00086
00087
00088
00089
00090
00091
00092