![]() |
Mixxx
|
00001 /*************************************************************************** 00002 controlbeat.h - description 00003 ------------------- 00004 begin : Mon Apr 7 2003 00005 copyright : (C) 2003 by Tue & Ken Haste Andersen 00006 email : haste@diku.dk 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef CONTROLBEAT_H 00019 #define CONTROLBEAT_H 00020 00021 #include "controlobject.h" 00022 #include "configobject.h" 00023 #include "defs.h" 00024 #include "midi/midimessage.h" 00025 #include <qdatetime.h> 00026 00034 const int minBPM = 30; 00036 const int maxBPM = 240; 00038 const int maxInterval = (int)(1000.*(60./(CSAMPLE)minBPM)); 00040 const int filterLength = 5; 00041 00042 class ControlBeat : public ControlObject { 00043 public: 00044 ControlBeat(ConfigKey key, bool bMidiSimulateLatching=false); 00045 virtual ~ControlBeat(); 00046 00047 protected: 00048 void setValueFromMidi(MidiCategory c, double v); 00049 void setValueFromThread(double dValue); 00050 private: 00051 void beatTap(); 00052 00053 QTime time; 00054 CSAMPLE *buffer; 00055 bool m_bMidiSimulateLatching; 00056 bool m_bPressed; 00057 int m_iValidPresses; 00058 }; 00059 00060 #endif