MCPcopy Create free account
hub / github.com/DISTRHO/DPF / query_interface_component

Method query_interface_component

distrho/src/DistrhoPluginVST3.cpp:4217–4302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4215 // v3_funknown
4216
4217 static v3_result V3_API query_interface_component(void* const self, const v3_tuid iid, void** const iface)
4218 {
4219 dpf_component* const component = *static_cast<dpf_component**>(self);
4220
4221 if (v3_tuid_match(iid, v3_funknown_iid) ||
4222 v3_tuid_match(iid, v3_plugin_base_iid) ||
4223 v3_tuid_match(iid, v3_component_iid))
4224 {
4225 d_debug("query_interface_component => %p %s %p | OK", self, tuid2str(iid), iface);
4226 ++component->refcounter;
4227 *iface = self;
4228 return V3_OK;
4229 }
4230
4231 if (v3_tuid_match(iid, v3_midi_mapping_iid))
4232 {
4233 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
4234 d_debug("query_interface_component => %p %s %p | OK convert static", self, tuid2str(iid), iface);
4235 static dpf_midi_mapping midi_mapping;
4236 static dpf_midi_mapping* midi_mapping_ptr = &midi_mapping;
4237 *iface = &midi_mapping_ptr;
4238 return V3_OK;
4239 #else
4240 d_debug("query_interface_component => %p %s %p | reject unused", self, tuid2str(iid), iface);
4241 *iface = nullptr;
4242 return V3_NO_INTERFACE;
4243 #endif
4244 }
4245
4246 if (v3_tuid_match(iid, v3_audio_processor_iid))
4247 {
4248 d_debug("query_interface_component => %p %s %p | OK convert %p",
4249 self, tuid2str(iid), iface, component->processor.get());
4250
4251 if (component->processor == nullptr)
4252 component->processor = new dpf_audio_processor(component->vst3);
4253 else
4254 ++component->processor->refcounter;
4255 *iface = &component->processor;
4256 return V3_OK;
4257 }
4258
4259 if (v3_tuid_match(iid, v3_connection_point_iid))
4260 {
4261 #if DPF_VST3_USES_SEPARATE_CONTROLLER
4262 d_debug("query_interface_component => %p %s %p | OK convert %p",
4263 self, tuid2str(iid), iface, component->connectionComp2Ctrl.get());
4264
4265 if (component->connectionComp2Ctrl == nullptr)
4266 component->connectionComp2Ctrl = new dpf_comp2ctrl_connection_point(component->vst3);
4267 else
4268 ++component->connectionComp2Ctrl->refcounter;
4269 *iface = &component->connectionComp2Ctrl;
4270 return V3_OK;
4271 #else
4272 d_debug("query_interface_component => %p %s %p | reject unwanted", self, tuid2str(iid), iface);
4273 *iface = nullptr;
4274 return V3_NO_INTERFACE;

Callers

nothing calls this directly

Calls 3

v3_tuid_matchFunction · 0.85
d_debugFunction · 0.85
tuid2strFunction · 0.85

Tested by

no test coverage detected