mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-23 04:17:30 +02:00
Partially implement IHostApplication
For now only works for directly connected components.
This commit is contained in:
@@ -16,9 +16,9 @@ This branch is still very far removed from being in a usable state. Below is an
|
|||||||
incomplete list of things that still have to be done before this can be used:
|
incomplete list of things that still have to be done before this can be used:
|
||||||
|
|
||||||
- Interfaces left to implement:
|
- Interfaces left to implement:
|
||||||
- `IHostApplication::createComponent()`
|
- `IHostApplication::createComponent()` for indirectly connected objects
|
||||||
- `IConnectionPoint::notify()`, and support for indirectly connecting
|
- `IConnectionPoint::notify()`, and support for indirectly connecting objects
|
||||||
components through message passing proxies
|
through connction proxies
|
||||||
- `IEditController2`
|
- `IEditController2`
|
||||||
- All other mandatory interfaces
|
- All other mandatory interfaces
|
||||||
- All other optional interfaces
|
- All other optional interfaces
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <public.sdk/source/vst/hosting/hostclasses.h>
|
||||||
|
|
||||||
Vst3HostContextProxyImpl::Vst3HostContextProxyImpl(
|
Vst3HostContextProxyImpl::Vst3HostContextProxyImpl(
|
||||||
Vst3Bridge& bridge,
|
Vst3Bridge& bridge,
|
||||||
Vst3HostContextProxy::ConstructArgs&& args)
|
Vst3HostContextProxy::ConstructArgs&& args)
|
||||||
@@ -54,10 +56,48 @@ Vst3HostContextProxyImpl::getName(Steinberg::Vst::String128 name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
Vst3HostContextProxyImpl::createInstance(Steinberg::TUID cid,
|
Vst3HostContextProxyImpl::createInstance(Steinberg::TUID /*cid*/,
|
||||||
Steinberg::TUID _iid,
|
Steinberg::TUID _iid,
|
||||||
void** obj) {
|
void** obj) {
|
||||||
// TODO: Implement
|
// Class IDs don't have a meaning here, they just mirrored the interface
|
||||||
std::cerr << "TODO: IHostApplication::createInstance()" << std::endl;
|
// from `IPlugFactory::createInstance()`
|
||||||
return Steinberg::kNotImplemented;
|
constexpr size_t uid_size = sizeof(Steinberg::TUID);
|
||||||
|
if (!_iid || strnlen(_iid, uid_size) < uid_size) {
|
||||||
|
return Steinberg::kInvalidArgument;
|
||||||
|
}
|
||||||
|
|
||||||
|
Steinberg::FUID iid = Steinberg::FUID::fromTUID(_iid);
|
||||||
|
// If an objects wants to create an `IMessage` object to send it to some
|
||||||
|
// object it is directly connected to, then we can keep everything local
|
||||||
|
// on the Wine side. This is mostly an optimization, because it saves a
|
||||||
|
// lot of unnecessary back and forth communication.
|
||||||
|
if (are_objects_directly_connected) {
|
||||||
|
if (iid == Steinberg::Vst::IMessage::iid) {
|
||||||
|
// TODO: Add logging for this on verbosity level 1
|
||||||
|
*obj = new Steinberg::Vst::HostMessage{};
|
||||||
|
return Steinberg::kResultTrue;
|
||||||
|
} else if (iid == Steinberg::Vst::IAttributeList::iid) {
|
||||||
|
// TODO: Add logging for this on verbosity level 1
|
||||||
|
*obj = new Steinberg::Vst::HostAttributeList{};
|
||||||
|
return Steinberg::kResultTrue;
|
||||||
|
} else {
|
||||||
|
// When the host requests an interface we do not (yet) implement,
|
||||||
|
// we'll print a recognizable log message
|
||||||
|
const Steinberg::FUID uid = Steinberg::FUID::fromTUID(_iid);
|
||||||
|
std::cerr
|
||||||
|
<< "TODO: Implement unknown interface logging on Wine side "
|
||||||
|
"for Vst3HostContextProxyImpl::createInstance"
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
|
return Steinberg::kNotImplemented;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// TODO: Implement for objects that are not directly connected
|
||||||
|
std::cerr
|
||||||
|
<< "TODO: Creating <IMessage*> and <IAttributeList*> instances in "
|
||||||
|
"IHostApplication::createInstance() for indirectly "
|
||||||
|
"connected objects has not yet been implemented"
|
||||||
|
<< std::endl;
|
||||||
|
return Steinberg::kNotImplemented;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user