mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 12:30:00 +02:00
Implement IComponent::setIoMode()
This commit is contained in:
@@ -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,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
|
||||
@@ -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::Initialize&);
|
||||
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::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
@@ -61,6 +61,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::Destruct,
|
||||
YaComponent::Initialize,
|
||||
YaComponent::Terminate,
|
||||
YaComponent::SetIoMode,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -171,6 +171,25 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
|
||||
// From `IComponent`
|
||||
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
|
||||
setIoMode(Steinberg::Vst::IoMode mode) override = 0;
|
||||
virtual int32 PLUGIN_API
|
||||
|
||||
@@ -74,9 +74,10 @@ tresult PLUGIN_API YaComponentPluginImpl::terminate() {
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaComponentPluginImpl::setIoMode(Steinberg::Vst::IoMode mode) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IComponent::setIoMode()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge
|
||||
.send_message(YaComponent::SetIoMode{
|
||||
.instance_id = arguments.instance_id, .mode = mode})
|
||||
.native();
|
||||
}
|
||||
|
||||
int32 PLUGIN_API
|
||||
|
||||
@@ -107,6 +107,11 @@ void Vst3Bridge::run() {
|
||||
-> YaComponent::Terminate::Response {
|
||||
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&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user