00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_REPEAT_H
00020 #define MARSYAS_REPEAT_H
00021
00022 #include "common_header.h"
00023 #include "Conversions.h"
00024
00025 #include <string>
00026
00027 namespace Marsyas
00028 {
00036 class marsyas_EXPORT Repeat {
00037 private:
00038 bool infinite_;
00039 std::string interval_;
00040 mrs_natural count_;
00041
00042 public:
00044 Repeat();
00048 Repeat(std::string time_interval);
00053 Repeat(std::string time_interval, mrs_natural rep_count);
00054
00055 virtual ~Repeat();
00056
00062 void set(bool inf, std::string time_interval, mrs_natural rep_count);
00063
00069 mrs_natural interval2samples(mrs_real srate);
00070
00074 virtual bool repeat();
00075
00076 bool isInfinite() {return infinite_;}
00077 mrs_natural getCount() {return count_;}
00078 std::string getInterval() {return interval_;}
00079
00080 void setInfinite(bool inf) {infinite_=inf;}
00081 void setCount(mrs_natural count) {count_=count;}
00082 void setInterval(std::string interval) {interval_=interval;}
00083
00084 void operator++() {++count_;}
00085 void operator++(int) {count_++;};
00086 void operator--() {if(count_>0){--count_;}}
00087 void operator--(int) {if(count_>0){count_--;}};
00088
00089
00090
00091 };
00092
00093 }
00094
00095 #endif