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_EV_EXPR_H 00020 #define MARSYAS_EV_EXPR_H 00021 00022 #include <marsyas/sched/EvEvent.h> 00023 #include <marsyas/sched/TmControlValue.h> 00024 #include <marsyas/expr/Expr.h> 00025 #include <marsyas/system/MarControl.h> 00026 00027 #include <string> 00028 #include <iostream> 00029 00030 namespace Marsyas 00031 { 00041 class MarSystem; // forward declaration 00042 class Scheduler; 00043 00044 class EvExpr : public EvEvent { 00045 protected: 00046 Scheduler* sched_; 00047 MarSystem* target_; 00048 Expr* expr_; 00049 00050 public: 00051 EvExpr(MarSystem* target, std::string e, std::string nm="Expr"); 00052 EvExpr(MarSystem* target, Ex e, Rp r, std::string nm="Expr"); 00053 EvExpr(MarSystem* target, ExFile ef, std::string nm="Expr"); 00054 virtual ~EvExpr(); 00055 00056 void setTimer(TmTimer* t); 00057 00058 // Event dispatch 00059 void dispatch(); 00060 void updctrl(std::string cname, TmControlValue value); 00061 00062 virtual EvExpr* clone(); 00063 Expr* getExpression() { return expr_; } 00064 00065 virtual bool repeat(); 00066 virtual std::string repeat_interval(); 00067 virtual void set_repeat(Repeat r) { repeat_=r; } 00068 00069 // the usual stream IO 00070 friend std::ostream& operator<<(std::ostream&, EvEvent&); 00071 friend std::istream& operator>>(std::istream&, EvEvent&); 00072 }; 00073 00074 }//namespace Marsyas 00075 00076 #endif