![]() |
Mixxx
|
00001 /*************************************************************************** 00002 rotary.h - description 00003 ------------------- 00004 begin : Tue Sep 21 2004 00005 copyright : (C) 2004 by Tue 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 ROTARY_H 00019 #define ROTARY_H 00020 00021 #include <qstring.h> 00022 00030 const int kiRotaryFilterMaxLen = 50; 00031 00032 class Rotary 00033 { 00034 public: 00035 Rotary(); 00036 ~Rotary(); 00037 00039 void calibrateStart(); 00041 double calibrateEnd(); 00043 void setCalibration(double c); 00045 double getCalibration(); 00047 double filter(double dValue); 00049 double fillBuffer(double dValue); 00051 void calibrate(double dValue); 00053 void setFilterLength(int i); 00055 int getFilterLength(); 00056 protected: 00058 int m_iFilterLength; 00060 int m_iFilterPos; 00062 double *m_pFilter; 00064 double m_dCalibration; 00066 double m_dLastValue; 00067 int m_iCalibrationCount; 00068 }; 00069 00070 #endif