00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "EvExpr.h"
00020 #include "MarSystem.h"
00021 #include "Scheduler.h"
00022
00023 using std::ostringstream;
00024 using namespace Marsyas;
00025
00026 EvExpr::EvExpr(MarSystem* target, std::string e, std::string nm) : EvEvent("EvExpr",nm)
00027 {
00028 expr_=new Expr(target,Ex(e));
00029 }
00030
00031 EvExpr::EvExpr(MarSystem* target, Ex e, Rp r, std::string nm) : EvEvent("EvExpr",nm)
00032 {
00033 expr_=new Expr(target,e,r);
00034 }
00035
00036 EvExpr::EvExpr(MarSystem* target, ExFile ef, std::string nm) : EvEvent("EvExpr",nm)
00037 {
00038 expr_=new Expr(target,ef);
00039 }
00040
00041 EvExpr::~EvExpr()
00042 {
00043 delete expr_;
00044 }
00045
00046 void
00047 EvExpr::setTimer(TmTimer* t)
00048 {
00049 EvEvent::setTimer(t);
00050
00051
00052
00053
00054 if (expr_!=NULL) {
00055 expr_->setTimer(timer_);
00056 expr_->post();
00057 }
00058
00059
00060 }
00061
00062 void
00063 EvExpr::dispatch()
00064 {
00065 expr_->eval();
00066 }
00067
00068 EvExpr*
00069 EvExpr::clone()
00070 {
00071 return new EvExpr(*this);
00072 }
00073
00074 bool
00075 EvExpr::repeat()
00076 {
00077 return expr_->repeat();
00078 }
00079
00080 std::string
00081 EvExpr::repeat_interval()
00082 {
00083 if (expr_->has_rate()) return expr_->repeat_interval();
00084 return repeat_.getInterval();
00085 }
00086
00087 void
00088 EvExpr::updctrl(std::string cname, TmControlValue value)
00089 {
00090 (void) cname; (void) value;
00091 MRSWARN("EvExpr:updControl(string,TmControlValue) updctrl not supported");
00092 }