aboutsummaryrefslogtreecommitdiff
path: root/dfx-library/TempoRateTable.h
diff options
context:
space:
mode:
authorN.N. <martin_pi@users.sourceforge.net>2003-02-17 14:12:16 +0000
committerN.N. <martin_pi@users.sourceforge.net>2003-02-17 14:12:16 +0000
commite7b24dd7da9de84e218f7d7be623f0cf8b9d1b9c (patch)
treed6f37e159464589e9c5c3dea8b38e4d03631794c /dfx-library/TempoRateTable.h
This commit was generated by cvs2svn to compensate for changes in r415,svn2git-root
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/dfx/; revision=416
Diffstat (limited to 'dfx-library/TempoRateTable.h')
-rwxr-xr-xdfx-library/TempoRateTable.h47
1 files changed, 47 insertions, 0 deletions
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