Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/sched/TmRealTime.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_TM_REAL_TIME_H
00020 #define MARSYAS_TM_REAL_TIME_H
00021 
00022 #include <marsyas/sched/TmTimer.h>
00023 #include <marsyas/system/MarControlValue.h>
00024 
00025 #ifndef WIN32
00026 #include <sys/time.h>
00027 #include <unistd.h>
00028 #endif
00029 
00030 namespace Marsyas
00031 {
00040 class TmRealTime : public TmTimer {
00041 protected:
00043   int last_usecs_;
00044 
00045 public:
00048   TmRealTime();
00052   TmRealTime(std::string name);
00056   TmRealTime(const TmRealTime& t);
00057   ~TmRealTime();
00058 
00062   mrs_natural getMicroSeconds();
00066   void updtime();
00067 
00073   mrs_natural readTimeSrc();
00080   mrs_natural intervalsize(std::string interval);
00081 };
00082 
00083 }//namespace Marsyas
00084 
00085 #endif