Implement IComponent::setIoMode()

This commit is contained in:
Robbert van der Helm
2020-12-13 16:12:30 +01:00
parent 3f3759e5fc
commit 116b618ac5
6 changed files with 38 additions and 3 deletions
+8
View File
@@ -72,6 +72,14 @@ void Vst3Logger::log_request(bool is_host_vst,
}); });
} }
void Vst3Logger::log_request(bool is_host_vst,
const YaComponent::SetIoMode& request) {
log_request_base(is_host_vst, [&](auto& message) {
message << "<IComponent* #" << request.instance_id << ">::setIoMode("
<< request.mode << ")";
});
}
void Vst3Logger::log_request(bool is_host_vst, void Vst3Logger::log_request(bool is_host_vst,
const YaPluginFactory::Construct&) { const YaPluginFactory::Construct&) {
log_request_base(is_host_vst, log_request_base(is_host_vst,
+1
View File
@@ -60,6 +60,7 @@ class Vst3Logger {
void log_request(bool is_host_vst, const YaComponent::Destruct&); void log_request(bool is_host_vst, const YaComponent::Destruct&);
void log_request(bool is_host_vst, const YaComponent::Initialize&); void log_request(bool is_host_vst, const YaComponent::Initialize&);
void log_request(bool is_host_vst, const YaComponent::Terminate&); void log_request(bool is_host_vst, const YaComponent::Terminate&);
void log_request(bool is_host_vst, const YaComponent::SetIoMode&);
void log_request(bool is_host_vst, const YaPluginFactory::Construct&); void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&); void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
void log_request(bool is_host_vst, const WantsConfiguration&); void log_request(bool is_host_vst, const WantsConfiguration&);
+1
View File
@@ -61,6 +61,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
YaComponent::Destruct, YaComponent::Destruct,
YaComponent::Initialize, YaComponent::Initialize,
YaComponent::Terminate, YaComponent::Terminate,
YaComponent::SetIoMode,
YaPluginFactory::Construct, YaPluginFactory::Construct,
YaPluginFactory::SetHostContext>; YaPluginFactory::SetHostContext>;
+19
View File
@@ -171,6 +171,25 @@ class YaComponent : public Steinberg::Vst::IComponent {
// From `IComponent` // From `IComponent`
tresult PLUGIN_API getControllerClassId(Steinberg::TUID classId) override; tresult PLUGIN_API getControllerClassId(Steinberg::TUID classId) override;
/**
* Message to pass through a call to `IComponent::setIoMode(IoMode)` to the
* Wine plugin host.
*/
struct SetIoMode {
using Response = UniversalTResult;
native_size_t instance_id;
Steinberg::Vst::IoMode mode;
template <typename S>
void serialize(S& s) {
s.value8b(instance_id);
s.value4b(mode);
}
};
virtual tresult PLUGIN_API virtual tresult PLUGIN_API
setIoMode(Steinberg::Vst::IoMode mode) override = 0; setIoMode(Steinberg::Vst::IoMode mode) override = 0;
virtual int32 PLUGIN_API virtual int32 PLUGIN_API
+4 -3
View File
@@ -74,9 +74,10 @@ tresult PLUGIN_API YaComponentPluginImpl::terminate() {
tresult PLUGIN_API tresult PLUGIN_API
YaComponentPluginImpl::setIoMode(Steinberg::Vst::IoMode mode) { YaComponentPluginImpl::setIoMode(Steinberg::Vst::IoMode mode) {
// TODO: Implement return bridge
bridge.logger.log("TODO: IComponent::setIoMode()"); .send_message(YaComponent::SetIoMode{
return Steinberg::kNotImplemented; .instance_id = arguments.instance_id, .mode = mode})
.native();
} }
int32 PLUGIN_API int32 PLUGIN_API
+5
View File
@@ -107,6 +107,11 @@ void Vst3Bridge::run() {
-> YaComponent::Terminate::Response { -> YaComponent::Terminate::Response {
return component_instances[request.instance_id]->terminate(); return component_instances[request.instance_id]->terminate();
}, },
[&](const YaComponent::SetIoMode& request)
-> YaComponent::SetIoMode::Response {
return component_instances[request.instance_id]->setIoMode(
request.mode);
},
[&](const YaPluginFactory::Construct&) [&](const YaPluginFactory::Construct&)
-> YaPluginFactory::Construct::Response { -> YaPluginFactory::Construct::Response {
return YaPluginFactory::ConstructArgs( return YaPluginFactory::ConstructArgs(