From 4419dfdb92b18733c1ba1900bd948c023effba58 Mon Sep 17 00:00:00 2001 From: David Braun <2096055+DBraun@users.noreply.github.com> Date: Sun, 19 Feb 2023 12:09:43 -0800 Subject: [PATCH] minor updates --- Source/AddProcessor.h | 7 +++++-- Source/PluginProcessor.cpp | 2 +- Source/RenderEngine.cpp | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/AddProcessor.h b/Source/AddProcessor.h index 47d64b9a..a326e24d 100644 --- a/Source/AddProcessor.h +++ b/Source/AddProcessor.h @@ -25,8 +25,11 @@ class AddProcessor : public ProcessorBase { // and the size of myGainLevels isn't zero. If it were zero, // getSafeGainLevel(index) will know to use 1.0f for every gain. - // todo: throw graceful error - return; + throw std::runtime_error( + "AddProcessor: The incoming audio buffer has " + numInputs + + std::string( + " channels, but the number of specified gain levels is ") + + std::to_string(myGainLevels.size())); } const int numTimesToSum = numInputs - 1; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index b0ce347f..7d3b271c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -509,7 +509,7 @@ const PluginPatch PluginProcessor::getPatch() { for (auto& uncastedParameter : this->getParameters()) { auto parameter = (AutomateParameterFloat*)uncastedParameter; float val = parameter->sample(posInfo); - params.push_back(std::make_pair(i, val)); + params.emplace_back(i, val); i++; } diff --git a/Source/RenderEngine.cpp b/Source/RenderEngine.cpp index f78d0a12..12a86362 100644 --- a/Source/RenderEngine.cpp +++ b/Source/RenderEngine.cpp @@ -414,7 +414,10 @@ void RenderEngine::transportRewind() {} void RenderEngine::prepareProcessor(ProcessorBase* processor, const std::string& name) { if (this->removeProcessor(name)) { - // todo: maybe warn the user that a processor was removed. + std::cerr << "Warning: a processor with the name \"" << name + << "\" already exists and was removed to make room for the new " + "processor." + << std::endl; }; auto node = m_mainProcessorGraph->addNode(