00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_BEATTIMESSINK_H
00020 #define MARSYAS_BEATTIMESSINK_H
00021
00022
00023 #ifdef _WIN32
00024 #include <windows.h>
00025 #endif
00026
00027 #include "MarSystem.h"
00028
00029 namespace Marsyas
00030 {
00050 class BeatTimesSink: public MarSystem
00051 {
00052 private:
00053
00054 void addControls();
00055 MarControlPtr ctrl_hopSize_;
00056 MarControlPtr ctrl_winSize_;
00057 MarControlPtr ctrl_srcFs_;
00058 MarControlPtr ctrl_destFileName_;
00059 MarControlPtr ctrl_mode_;
00060 MarControlPtr ctrl_tickCount_;
00061 MarControlPtr ctrl_tempo_;
00062 MarControlPtr ctrl_adjustment_;
00063 MarControlPtr ctrl_bestFinalAgentHistory_;
00064 MarControlPtr ctrl_soundFileSize_;
00065 MarControlPtr ctrl_nonCausal_;
00066 MarControlPtr ctrl_socketsPort_;
00067
00068 mrs_real beatTimeTmp_;
00069 mrs_real lastIbi_;
00070 mrs_natural soundFileSize_;
00071 mrs_bool nonCausal_;
00072 mrs_realvec bestFinalAgentHistory_;
00073 mrs_realvec ibiBPMVec_;
00074 mrs_natural inc_;
00075 mrs_string destFile_;
00076 mrs_string destFile2_;
00077 mrs_string destFile3_;
00078 mrs_string mode_;
00079 mrs_real lastBeatTime_;
00080 mrs_real ibiBPM_;
00081 mrs_bool initialOut_;
00082 mrs_bool initialOut2_;
00083 mrs_bool initialOut3_;
00084 mrs_real beatTime_;
00085 mrs_real srcFs_;
00086 mrs_real adjustment_;
00087 mrs_natural hopSize_;
00088 mrs_natural winSize_;
00089 mrs_natural timeElapsed_;
00090 mrs_real ibiBPMSum_;
00091 mrs_natural beatCount_;
00092 mrs_real tempo_;
00093
00094 mrs_natural socketsPort_;
00095
00096 mrs_real *data_;
00097
00098 void myUpdate(MarControlPtr sender);
00099
00100 public:
00101 BeatTimesSink(std::string name);
00102 BeatTimesSink(const BeatTimesSink& a);
00103 ~BeatTimesSink();
00104 MarSystem* clone() const;
00105
00106 void myProcess(realvec& in, realvec& out);
00107 mrs_realvec addMedianVector(mrs_real ibiBPM);
00108 mrs_natural refreshSocket();
00109 };
00110
00111 }
00112
00113 #endif