00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MARSYAS_EV_EVENT_H
00021 #define MARSYAS_EV_EVENT_H
00022
00023 #include "Repeat.h"
00024
00025 #include "TmControlValue.h"
00026 #include <iostream>
00027
00028 namespace Marsyas
00029 {
00036 class TmTimer;
00037
00038 class marsyas_EXPORT EvEvent {
00039 protected:
00041 std::string type_;
00045 std::string name_;
00046
00048 mrs_natural time_;
00050 Repeat repeat_;
00052 TmTimer* timer_;
00053
00054 public:
00055 EvEvent();
00056 EvEvent(std::string t, std::string n);
00057
00058 virtual ~EvEvent();
00059
00063 std::string getType() const;
00067 std::string getName() const;
00071 std::string getPrefix() const;
00075 void setName(std::string n);
00076
00081 virtual void dispatch()=0;
00082
00087 virtual EvEvent* clone()=0;
00088
00094 virtual void setTimer(TmTimer* t);
00098 mrs_natural getTime() const;
00102 void setTime(mrs_natural t);
00103
00104
00108 virtual bool repeat();
00112 virtual void setRepeat(Repeat r);
00116 virtual mrs_natural getRepeatCount();
00124 virtual std::string getRepeatInterval();
00128 Repeat getRepeat();
00129
00137 virtual std::string repeat_interval(std::string interval);
00138
00144 void doRepeat();
00145
00146
00154 virtual void updctrl(std::string cname, TmControlValue value);
00174 bool checkupd(std::string c1, std::string c2, TmControlValue v, mrs_natural t);
00175
00176 friend class EvEventDispatchComparator;
00177
00178
00179 friend std::ostream& operator<<(std::ostream&, EvEvent&);
00180 friend std::istream& operator>>(std::istream&, EvEvent&);
00181 };
00182
00189 class EvEventDispatchComparator {
00190 public:
00191 bool operator()(EvEvent* a, EvEvent* b) {
00192 return (a->getTime()) < (b->getTime());
00193 }
00194 };
00195
00196 }
00197
00198 #endif