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_VIRTUAL_TIME_H 00020 #define MARSYAS_TM_VIRTUAL_TIME_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 TmVirtualTime : public TmTimer { 00040 protected: 00042 MarSystem* read_src_; 00045 MarControlPtr nsamples_; 00048 MarControlPtr srate_; 00051 mrs_real error_term_; 00053 mrs_natural previous_tick_interval_; 00054 00055 public: 00060 TmVirtualTime(); 00066 TmVirtualTime(std::string name); 00071 TmVirtualTime(std::string name, MarSystem* ms); 00075 TmVirtualTime(const TmVirtualTime& s); 00076 00077 virtual ~TmVirtualTime(); 00078 00087 void setSource(MarSystem* ms); 00092 mrs_natural readTimeSrc(); 00101 mrs_natural intervalsize(std::string interval); 00109 virtual void updtimer(std::string cname, TmControlValue value); 00110 }; 00111 00112 }//namespace Marsyas 00113 00114 #endif