From e7b24dd7da9de84e218f7d7be623f0cf8b9d1b9c Mon Sep 17 00:00:00 2001 From: "N.N." Date: Mon, 17 Feb 2003 14:12:16 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r415, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/dfx/; revision=416 --- dfx-library/TempoRateTable.h | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 dfx-library/TempoRateTable.h (limited to 'dfx-library/TempoRateTable.h') diff --git a/dfx-library/TempoRateTable.h b/dfx-library/TempoRateTable.h new file mode 100755 index 0000000..00f8cc7 --- /dev/null +++ b/dfx-library/TempoRateTable.h @@ -0,0 +1,47 @@ +#ifndef __TempoRateTable +#define __TempoRateTable + + +//-------------------------------------------------------------------------- +// the number of tempo beat division options +#ifdef USE_SLOW_TEMPO_RATES + #define NUM_TEMPO_RATES 25 +#else + #ifdef USE_BUFFER_OVERRIDE_TEMPO_RATES + #define NUM_TEMPO_RATES 21 + #else + #define NUM_TEMPO_RATES 24 + #endif +#endif + + + +//-------------------------------------------------------------------------- +// this holds the beat scalar values & textual displays for the tempo rates +class TempoRateTable +{ +public: + TempoRateTable(); + ~TempoRateTable(); + + float getScalar(float paramValue) + { return scalars[float2index(paramValue)]; } + char * getDisplay(float paramValue) + { return displays[float2index(paramValue)]; } + +protected: + int float2index(float f) + { + if (f < 0.0f) + f = 0.0f; + else if (f > 1.0f) + f = 1.0f; + return (int) (f * ((float)NUM_TEMPO_RATES-0.9f)); + } + + float *scalars; + char **displays; +}; + + +#endif \ No newline at end of file -- cgit v1.2.1