VST3: assume left-only is Mono (#9229)
VST3 speaker arrangements (ie port is connected) can distinguish between left only pin (of stereo pair) and Mono.
This commit is contained in:
parent
4429697799
commit
445e5162fd
@ -2064,10 +2064,12 @@ VST3PI::enable_io (std::vector<bool> const& ins, std::vector<bool> const& outs)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool was_active = false;
|
/* some plugins, notably JUCE based ones, require the plugin to be
|
||||||
if (_is_processing) {
|
* inactive to change bus arrangements.
|
||||||
was_active = true;
|
*/
|
||||||
deactivate ();
|
bool was_active = _is_processing;
|
||||||
|
if (!deactivate ()) {
|
||||||
|
DEBUG_TRACE (DEBUG::VST3Config, "VST3PI::enable_io failed to deactivate plugin\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: ins = %1 == %3 outs = %2 == %4\n", ins.size (), outs.size (), n_audio_inputs (), n_audio_outputs ()));
|
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: ins = %1 == %3 outs = %2 == %4\n", ins.size (), outs.size (), n_audio_inputs (), n_audio_outputs ()));
|
||||||
@ -2098,6 +2100,10 @@ VST3PI::enable_io (std::vector<bool> const& ins, std::vector<bool> const& outs)
|
|||||||
enable = true;
|
enable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* special case for Left only == Mono */
|
||||||
|
if (sa == 1 /*Vst::SpeakerArr::kSpeakerL */) {
|
||||||
|
sa = Vst::SpeakerArr::kMono; /* 1 << 19 */
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: activateBus (kAudio, kInput, %1, %2, %3%4)\n", sa_in.size (), enable, std::hex, sa));
|
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: activateBus (kAudio, kInput, %1, %2, %3%4)\n", sa_in.size (), enable, std::hex, sa));
|
||||||
_component->activateBus (Vst::kAudio, Vst::kInput, sa_in.size (), enable);
|
_component->activateBus (Vst::kAudio, Vst::kInput, sa_in.size (), enable);
|
||||||
@ -2114,16 +2120,21 @@ VST3PI::enable_io (std::vector<bool> const& ins, std::vector<bool> const& outs)
|
|||||||
enable = true;
|
enable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* special case for Left only == Mono */
|
||||||
|
if (sa == 1 /*Vst::SpeakerArr::kSpeakerL */) {
|
||||||
|
sa = Vst::SpeakerArr::kMono; /* 1 << 19 */
|
||||||
|
}
|
||||||
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: activateBus (kAudio, kOutput, %1, %2, %3%4)\n", sa_out.size (), enable, std::hex, sa));
|
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: activateBus (kAudio, kOutput, %1, %2, %3%4)\n", sa_out.size (), enable, std::hex, sa));
|
||||||
_component->activateBus (Vst::kAudio, Vst::kOutput, sa_out.size (), enable);
|
_component->activateBus (Vst::kAudio, Vst::kOutput, sa_out.size (), enable);
|
||||||
sa_out.push_back (sa);
|
sa_out.push_back (sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vst::SpeakerArrangement null_arrangement = {};
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
tresult rv =
|
tresult rv =
|
||||||
#endif
|
#endif
|
||||||
_processor->setBusArrangements (sa_in.size () > 0 ? &sa_in[0] : NULL, sa_in.size (),
|
_processor->setBusArrangements (sa_in.size () > 0 ? &sa_in[0] : &null_arrangement, sa_in.size (),
|
||||||
sa_out.size () > 0 ? &sa_out[0] : NULL, sa_out.size ());
|
sa_out.size () > 0 ? &sa_out[0] : &null_arrangement, sa_out.size ());
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: setBusArrangements ins = %1 outs = %2 | rv = %3\n", sa_in.size (), sa_out.size (), rv));
|
DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::enable_io: setBusArrangements ins = %1 outs = %2 | rv = %3\n", sa_in.size (), sa_out.size (), rv));
|
||||||
|
Loading…
Reference in New Issue
Block a user