Marsyas
0.6.0-alpha
|
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_TM_SAMPLECOUNT_H 00020 #define MARSYAS_TM_SAMPLECOUNT_H 00021 00022 #include <marsyas/sched/TmTimer.h> 00023 #include <marsyas/system/MarControlValue.h> 00024 #include <marsyas/system/MarSystem.h> 00025 00026 namespace Marsyas 00027 { 00035 // forward declaration of MarSystem allows Scheduler.getctrl("insamples") 00036 // for scheduler count 00037 class MarSystem; // forward declaration 00038 00039 class TmSampleCount : public TmTimer { 00040 protected: 00042 MarSystem* read_src_; 00044 std::string read_cname_; 00046 MarControlPtr read_ctrl_; 00047 00048 public: 00053 TmSampleCount(); 00059 TmSampleCount(std::string name); 00064 TmSampleCount(MarSystem* ms, std::string cname); 00068 TmSampleCount(const TmSampleCount& s); 00069 00070 virtual ~TmSampleCount(); 00071 00081 void setReadCtrl(MarSystem* ms, std::string cname); 00090 void setSource(MarSystem* ms); 00099 void setSourceCtrl(std::string cname); 00104 mrs_natural readTimeSrc(); 00113 mrs_natural intervalsize(std::string interval); 00121 virtual void updtimer(std::string cname, TmControlValue value); 00122 }; 00123 00124 }//namespace Marsyas 00125 00126 #endif