VST3: initially only enable default-active busses
This works around a problem with some JUCE plugins, notably https://github.com/surge-synthesizer/surge/issues/6847
This commit is contained in:
parent
31a3c3c6f3
commit
edbcaa24fb
|
@ -143,10 +143,11 @@ public:
|
||||||
uint32_t n_audio_aux_out () const { return _n_aux_outputs; }
|
uint32_t n_audio_aux_out () const { return _n_aux_outputs; }
|
||||||
|
|
||||||
struct AudioBusInfo {
|
struct AudioBusInfo {
|
||||||
AudioBusInfo (Vst::BusType t, int32_t c) : type (t), n_chn (c) {}
|
AudioBusInfo (Vst::BusType t, int32_t c, bool a) : type (t), n_chn (c), dflt (a) {}
|
||||||
AudioBusInfo () : type (Vst::kMain), n_chn (0) {}
|
AudioBusInfo () : type (Vst::kMain), n_chn (0) {}
|
||||||
Vst::BusType type;
|
Vst::BusType type;
|
||||||
int32_t n_chn;
|
int32_t n_chn;
|
||||||
|
bool dflt; // kDefaultActive
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<int, AudioBusInfo> const& bus_info_in () const { return _bus_info_in; }
|
std::map<int, AudioBusInfo> const& bus_info_in () const { return _bus_info_in; }
|
||||||
|
|
|
@ -96,13 +96,19 @@ VST3Plugin::init ()
|
||||||
_plug->OnResizeView.connect_same_thread (_connections, boost::bind (&VST3Plugin::forward_resize_view, this, _1, _2));
|
_plug->OnResizeView.connect_same_thread (_connections, boost::bind (&VST3Plugin::forward_resize_view, this, _1, _2));
|
||||||
_plug->OnParameterChange.connect_same_thread (_connections, boost::bind (&VST3Plugin::parameter_change_handler, this, _1, _2, _3));
|
_plug->OnParameterChange.connect_same_thread (_connections, boost::bind (&VST3Plugin::parameter_change_handler, this, _1, _2, _3));
|
||||||
|
|
||||||
/* assume all I/O is connected by default */
|
/* assume only default active busses are connected */
|
||||||
for (int32_t i = 0; i < (int32_t)_plug->n_audio_inputs (); ++i) {
|
for (auto const& abi : _plug->bus_info_in ()) {
|
||||||
_connected_inputs.push_back (true);
|
for (int32_t i = 0; i < abi.second.n_chn; ++i) {
|
||||||
|
_connected_inputs.push_back (abi.second.dflt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < (int32_t)_plug->n_audio_outputs (); ++i) {
|
|
||||||
_connected_outputs.push_back (true);
|
for (auto const& abi : _plug->bus_info_out ()) {
|
||||||
|
for (int32_t i = 0; i < abi.second.n_chn; ++i) {
|
||||||
|
_connected_outputs.push_back (abi.second.dflt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pre-configure from GUI thread */
|
/* pre-configure from GUI thread */
|
||||||
_plug->enable_io (_connected_inputs, _connected_outputs);
|
_plug->enable_io (_connected_inputs, _connected_outputs);
|
||||||
}
|
}
|
||||||
|
@ -1747,9 +1753,9 @@ VST3PI::count_channels (Vst::MediaType media, Vst::BusDirection dir, Vst::BusTyp
|
||||||
n_channels += bus.channelCount;
|
n_channels += bus.channelCount;
|
||||||
|
|
||||||
if (dir == Vst::kInput) {
|
if (dir == Vst::kInput) {
|
||||||
_bus_info_in.insert (std::make_pair(i, AudioBusInfo (type, bus.channelCount)));
|
_bus_info_in.insert (std::make_pair(i, AudioBusInfo (type, bus.channelCount, bus.flags & Vst::BusInfo::kDefaultActive)));
|
||||||
} else {
|
} else {
|
||||||
_bus_info_out.insert (std::make_pair(i, AudioBusInfo (type, bus.channelCount)));
|
_bus_info_out.insert (std::make_pair(i, AudioBusInfo (type, bus.channelCount, bus.flags & Vst::BusInfo::kDefaultActive)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user