commit 4237d18d735eb0176d71ae50cc3bf697290ad861
parent a65b407cb85e94c4017d98642b93db951baca808
Author: Hans Petter Selasky <hps@selasky.org>
Date: Sun, 5 Apr 2020 01:50:28 +0200
Build fix for Linux.
Move function depending on powf() to C++ file,
which include "cmath" which in turn should define powf().
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/Misc/Microtonal.cpp b/src/Misc/Microtonal.cpp
@@ -383,6 +383,17 @@ failure:
return false;
}
+/*
+ * Get the note frequency in Hz, -1.0f if invalid.
+ */
+float Microtonal::getnotefreq(float note_log2_freq, int keyshift) const
+{
+ if (updatenotefreq_log2(note_log2_freq, keyshift))
+ return powf(2.0f, note_log2_freq);
+ else
+ return -1.0f;
+}
+
bool Microtonal::operator==(const Microtonal µ) const
{
return !(*this != micro);
diff --git a/src/Misc/Microtonal.h b/src/Misc/Microtonal.h
@@ -74,12 +74,7 @@ class Microtonal
bool updatenotefreq_log2(float ¬e_log2_freq, int keyshift) const;
/**Calculates the frequency for a given note
*/
- float getnotefreq(float note_log2_freq, int keyshift) const {
- if (updatenotefreq_log2(note_log2_freq, keyshift))
- return powf(2.0f, note_log2_freq);
- else
- return -1.0f;
- };
+ float getnotefreq(float note_log2_freq, int keyshift) const;
//Parameters
/**if the keys are inversed (the pitch is lower to keys from the right direction)*/