aboutsummaryrefslogtreecommitdiffstats
path: root/source/device_formula.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/device_formula.cpp')
-rw-r--r--source/device_formula.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/source/device_formula.cpp b/source/device_formula.cpp
index 9a3372f..e21d374 100644
--- a/source/device_formula.cpp
+++ b/source/device_formula.cpp
@@ -10,6 +10,15 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
+#include "stmdsp.hpp"
+
+#include <algorithm>
+#include <random>
+#include <string_view>
+#include <vector>
+
+#ifndef STMDSP_DISABLE_FORMULAS
+
#define exprtk_disable_comments
#define exprtk_disable_break_continue
#define exprtk_disable_sc_andor
@@ -22,13 +31,6 @@
//#define exprtk_disable_caseinsensitivity
#include "exprtk.hpp"
-#include "stmdsp.hpp"
-
-#include <algorithm>
-#include <random>
-#include <string_view>
-#include <vector>
-
static std::random_device randomDevice;
std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string& formulaString)
@@ -73,3 +75,12 @@ std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string& for
return samples;
}
+#else // no formula support
+
+std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string&)
+{
+ return {};
+}
+
+#endif // STMDSP_DISABLE_FORMULAS
+