From 8b808d05c574b46cdf3243c15c39407ff19a91d4 Mon Sep 17 00:00:00 2001 From: Matthew Firth Date: Mon, 26 Feb 2024 15:17:20 +0000 Subject: [PATCH] Asserts on bus reconfig and general tidy --- .../src/binaural_monitoring_plugin_processor.cpp | 3 +++ .../plugins/monitoring/src/monitoring_plugin_processor.cpp | 3 +++ .../plugins/scene/src/scene_plugin_processor.cpp | 5 ++++- reaper-adm-export-source-plugin/src/PluginProcessor.cpp | 4 +--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ear-production-suite-plugins/plugins/binaural_monitoring/src/binaural_monitoring_plugin_processor.cpp b/ear-production-suite-plugins/plugins/binaural_monitoring/src/binaural_monitoring_plugin_processor.cpp index da458d808..aca7cdb82 100644 --- a/ear-production-suite-plugins/plugins/binaural_monitoring/src/binaural_monitoring_plugin_processor.cpp +++ b/ear-production-suite-plugins/plugins/binaural_monitoring/src/binaural_monitoring_plugin_processor.cpp @@ -9,6 +9,8 @@ #include "reaper_vst3_interfaces.h" #include "reaper_integration.hpp" +#include + #define DEFAULT_OSC_PORT 8000 namespace ear { @@ -508,6 +510,7 @@ void EarBinauralMonitoringAudioProcessor::setIHostApplication( true, 0, AudioChannelSet::discreteChannels(numDawChannels_)); auto retO = setChannelLayoutOfBus( false, 0, AudioChannelSet::discreteChannels(numDawChannels_)); + assert(retI && retO); backend_ = std::make_unique( nullptr, numDawChannels_); connector_->setListenerOrientationInstance(backend_->listenerOrientation); diff --git a/ear-production-suite-plugins/plugins/monitoring/src/monitoring_plugin_processor.cpp b/ear-production-suite-plugins/plugins/monitoring/src/monitoring_plugin_processor.cpp index c339758d1..a791e4a88 100644 --- a/ear-production-suite-plugins/plugins/monitoring/src/monitoring_plugin_processor.cpp +++ b/ear-production-suite-plugins/plugins/monitoring/src/monitoring_plugin_processor.cpp @@ -5,6 +5,8 @@ #include "reaper_vst3_interfaces.h" #include "reaper_integration.hpp" +#include + namespace ear { namespace plugin { template <> @@ -63,6 +65,7 @@ void EarMonitoringAudioProcessor::setIHostApplication( true, 0, AudioChannelSet::discreteChannels(numDawChannels_)); auto retO = setChannelLayoutOfBus( false, 0, AudioChannelSet::discreteChannels(numDawChannels_)); + assert(retI && retO); backend_ = std::make_unique( nullptr, layout(), numDawChannels_); } diff --git a/ear-production-suite-plugins/plugins/scene/src/scene_plugin_processor.cpp b/ear-production-suite-plugins/plugins/scene/src/scene_plugin_processor.cpp index 883dcf51e..56f2961bb 100644 --- a/ear-production-suite-plugins/plugins/scene/src/scene_plugin_processor.cpp +++ b/ear-production-suite-plugins/plugins/scene/src/scene_plugin_processor.cpp @@ -2,7 +2,6 @@ #include "scene_plugin_editor.hpp" #include #include "programme_store_adm_serializer.hpp" -#include #include #include "scene_backend.hpp" #include "metadata_event_dispatcher.hpp" @@ -11,6 +10,9 @@ #include "reaper_vst3_interfaces.h" #include "reaper_integration.hpp" +#include +#include + SceneAudioProcessor::SceneAudioProcessor() : AudioProcessor( // MAX_DAW_CHANNELS of input supports the largest track width in REAPER. @@ -302,6 +304,7 @@ void SceneAudioProcessor::setIHostApplication(Steinberg::FUnknown* unknown) { numDawChannels_ = DetermineChannelCount(reaperHost); auto ret = setChannelLayoutOfBus( true, 0, AudioChannelSet::discreteChannels(numDawChannels_)); + assert(ret); levelMeter_->setup(numDawChannels_, samplerate_); } } diff --git a/reaper-adm-export-source-plugin/src/PluginProcessor.cpp b/reaper-adm-export-source-plugin/src/PluginProcessor.cpp index 62599e656..f20ba1d04 100644 --- a/reaper-adm-export-source-plugin/src/PluginProcessor.cpp +++ b/reaper-adm-export-source-plugin/src/PluginProcessor.cpp @@ -371,9 +371,7 @@ void AdmStemPluginAudioProcessor::processBlock (AudioBuffer& buffer, Midi bool AdmStemPluginAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const { auto i = layouts.getMainInputChannels(); - if (i != numDawChannels_) return false; - - return true; + return i == numDawChannels_; } #endif