@@ -93,7 +93,6 @@ void ProcessorBase::setState(const juce::ValueTree& newState)
9393 return ;
9494 }
9595
96- // Load send/return levels
9796 setSendLevel (newState.getProperty (IDs::sendLevel, 1 .0f ));
9897 setReturnLevel (newState.getProperty (IDs::returnLevel, 1 .0f ));
9998
@@ -128,55 +127,16 @@ void ProcessorBase::setState(const juce::ValueTree& newState)
128127
129128 if (auto instance = pluginManager.createPluginInstance (desc, processSpec))
130129 {
131- instance->suspendProcessing (true );
132-
133- const auto pluginName = instance->getName ().toLowerCase ();
134- const bool isPickyPlugin = pluginName.contains (" auto-tune" ) || pluginName.contains (" antares" );
135- bool layoutSet = false ;
136-
137- if (isPickyPlugin)
138- {
139- DBG (" Picky plugin detected on preset load: " << instance->getName () << " . Skipping explicit layout negotiation." );
140- layoutSet = true ;
141- }
142- else
143- {
144- if (instance->getBusCount (true ) > 1 )
145- instance->getBus (true , 1 )->enable (false );
146-
147- const auto stereoToStereo = juce::AudioProcessor::BusesLayout{ { juce::AudioChannelSet::stereo () }, { juce::AudioChannelSet::stereo () } };
148- if (instance->checkBusesLayoutSupported (stereoToStereo))
149- {
150- layoutSet = instance->setBusesLayout (stereoToStereo);
151- }
152-
153- if (!layoutSet)
154- {
155- const auto monoToStereo = juce::AudioProcessor::BusesLayout{ { juce::AudioChannelSet::mono () }, { juce::AudioChannelSet::stereo () } };
156- if (instance->checkBusesLayoutSupported (monoToStereo))
157- {
158- layoutSet = instance->setBusesLayout (monoToStereo);
159- }
160- }
161- }
162-
163- if (!layoutSet)
164- {
165- DBG (" ERROR: Plugin from preset failed layout negotiation: " << instance->getName ());
166- continue ;
167- }
168-
130+ // <<< FIX: REMOVED ALL I/O NEGOTIATION LOGIC >>>
131+ // We just prepare the plugin and then set its internal state.
169132 instance->prepareToPlay (processSpec.sampleRate , (int )processSpec.maximumBlockSize );
170- instance->reset ();
171133
172134 try
173135 {
174136 auto base64State = pluginState.getProperty (IDs::state).toString ();
175137 juce::MemoryBlock internalState;
176138 if (internalState.fromBase64Encoding (base64State))
177- {
178139 instance->setStateInformation (internalState.getData (), (int )internalState.getSize ());
179- }
180140 }
181141 catch (...)
182142 {
@@ -189,11 +149,6 @@ void ProcessorBase::setState(const juce::ValueTree& newState)
189149 pluginBypassState.insert (pluginChain.size ());
190150
191151 pluginChain.add (std::move (instance));
192-
193- if (auto * addedInstance = pluginChain.getLast ())
194- {
195- addedInstance->suspendProcessing (false );
196- }
197152 }
198153 }
199154
@@ -311,46 +266,11 @@ void ProcessorBase::addPlugin(std::unique_ptr<juce::AudioPluginInstance> newPlug
311266
312267 if (processSpec.sampleRate > 0 )
313268 {
314- newPlugin->suspendProcessing (true );
315-
316- const auto pluginName = newPlugin->getName ().toLowerCase ();
317- const bool isPickyPlugin = pluginName.contains (" auto-tune" ) || pluginName.contains (" antares" );
318-
319- bool layoutSet = false ;
320-
321- if (isPickyPlugin)
322- {
323- DBG (" Picky plugin detected: " << newPlugin->getName () << " . Skipping layout negotiation." );
324- layoutSet = true ;
325- }
326- else
327- {
328- if (newPlugin->getBusCount (true ) > 1 )
329- newPlugin->getBus (true , 1 )->enable (false );
330-
331- const auto stereoToStereo = juce::AudioProcessor::BusesLayout{ { juce::AudioChannelSet::stereo () }, { juce::AudioChannelSet::stereo () } };
332- const auto monoToStereo = juce::AudioProcessor::BusesLayout{ { juce::AudioChannelSet::mono () }, { juce::AudioChannelSet::stereo () } };
333-
334- if (newPlugin->checkBusesLayoutSupported (stereoToStereo))
335- layoutSet = newPlugin->setBusesLayout (stereoToStereo);
336-
337- if (!layoutSet && newPlugin->checkBusesLayoutSupported (monoToStereo))
338- layoutSet = newPlugin->setBusesLayout (monoToStereo);
339- }
340-
341- if (!layoutSet)
342- {
343- juce::AlertWindow::showMessageBoxAsync (juce::AlertWindow::WarningIcon,
344- " Plugin Load Failed" ,
345- " The selected plugin has an I/O configuration that is not compatible with this application: " + newPlugin->getName ());
346-
347- newPlugin->suspendProcessing (false );
348- return ;
349- }
350-
269+ // <<< FIX: REMOVED ALL I/O NEGOTIATION LOGIC >>>
270+ // We simply prepare the plugin and trust it to use its default layout.
271+ // The process() method is already robust enough to handle channel differences.
351272 newPlugin->prepareToPlay (processSpec.sampleRate , (int )processSpec.maximumBlockSize );
352273 newPlugin->reset ();
353- newPlugin->suspendProcessing (false );
354274 }
355275
356276 pluginChain.add (std::move (newPlugin));
0 commit comments