From d09a5d8d847ac137e87c886de1069e660fc52f2d Mon Sep 17 00:00:00 2001 From: Randy Jones Date: Wed, 17 Jul 2024 12:43:11 -0700 Subject: [PATCH] more Procs cleanup --- CMakeLists.txt | 3 +-- source/procs/MLProcMultiply.h | 48 ----------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 source/procs/MLProcMultiply.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ac1c252..ae3f5d7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -384,11 +384,10 @@ endif() if(BUILD_TESTS) # NOTE: madronalib procs need to be included in projects as source. - file(GLOB PROC_SOURCES "source/procs/*.*") file(GLOB TEST_SOURCES "tests/*.*") - add_executable(tests ${PROC_SOURCES} ${TEST_SOURCES}) + add_executable(tests ${TEST_SOURCES}) set_target_properties(tests PROPERTIES EXCLUDE_FROM_ALL TRUE) add_dependencies(tests madronalib) diff --git a/source/procs/MLProcMultiply.h b/source/procs/MLProcMultiply.h deleted file mode 100644 index 641d60c1..00000000 --- a/source/procs/MLProcMultiply.h +++ /dev/null @@ -1,48 +0,0 @@ - - -// work in progress - for testing only - -#pragma once - -#include "MLProcFactory.h" -#include "MLValue.h" - -namespace ml -{ -class ProcMultiply : public Proc -{ - public: - static constexpr constStr paramNames[]{"a", "b", "c"}; - static constexpr constStr inputNames[]{"foo", "bar"}; - static constexpr constStr outputNames[]{"baz"}; - - // Proc boilerplate - static constexpr constStrArray pn_{paramNames}; - static constexpr constStrArray in_{inputNames}; - static constexpr constStrArray on_{outputNames}; - - virtual const constStrArray& getParamNames() override { return pn_; } - virtual const constStrArray& getInputNames() override { return in_; } - virtual const constStrArray& getOutputNames() override { return on_; } - - // + 1 leaves room for setting without a branch when keys are not found. - Value params[constCount(paramNames) + 1]; - DSPVector* inputs[constCount(inputNames) + 1]; - DSPVector* outputs[constCount(outputNames) + 1]; - - inline Value& param(constStr str) { return params[constFind(paramNames, str)]; } - - inline DSPVector& input(constStr str) { return *inputs[constFind(inputNames, str)]; } - - inline DSPVector& output(constStr str) { return *outputs[constFind(outputNames, str)]; } - - // TODO remove and make non-const versions for external use - // MLProc implementation (more boilerplate) - virtual void setParam(constStr str, float v) override { params[constFind(paramNames, str)] = v; } - void setInput(constStr str, DSPVector& v) override { inputs[constFind(inputNames, str)] = &v; } - void setOutput(constStr str, DSPVector& v) override { outputs[constFind(outputNames, str)] = &v; } - - void process() override; -}; - -} // namespace ml