mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IEditController::setComponentState()
This commit is contained in:
@@ -264,6 +264,16 @@ void Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Vst3Logger::log_request(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaEditController2::SetComponentState& request) {
|
||||||
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << "<IEditController* #" << request.instance_id
|
||||||
|
<< ">::setComponentState(state = <IBStream* containing "
|
||||||
|
<< request.state.size() << "bytes>)";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_request(bool is_host_vst,
|
void Vst3Logger::log_request(bool is_host_vst,
|
||||||
const YaPluginBase::Initialize& request) {
|
const YaPluginBase::Initialize& request) {
|
||||||
log_request_base(is_host_vst, [&](auto& message) {
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ class Vst3Logger {
|
|||||||
void log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&);
|
void log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&);
|
||||||
void log_request(bool is_host_vst, const YaComponent::ActivateBus&);
|
void log_request(bool is_host_vst, const YaComponent::ActivateBus&);
|
||||||
void log_request(bool is_host_vst, const YaComponent::SetActive&);
|
void log_request(bool is_host_vst, const YaComponent::SetActive&);
|
||||||
|
void log_request(bool is_host_vst,
|
||||||
|
const YaEditController2::SetComponentState&);
|
||||||
void log_request(bool is_host_vst, const YaPluginBase::Initialize&);
|
void log_request(bool is_host_vst, const YaPluginBase::Initialize&);
|
||||||
void log_request(bool is_host_vst, const YaPluginBase::Terminate&);
|
void log_request(bool is_host_vst, const YaPluginBase::Terminate&);
|
||||||
void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
|||||||
YaComponent::GetRoutingInfo,
|
YaComponent::GetRoutingInfo,
|
||||||
YaComponent::ActivateBus,
|
YaComponent::ActivateBus,
|
||||||
YaComponent::SetActive,
|
YaComponent::SetActive,
|
||||||
|
YaEditController2::SetComponentState,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -78,6 +78,24 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
|||||||
|
|
||||||
// From `IEditController`
|
// From `IEditController`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to
|
||||||
|
* `IEditController::setComponentState(state)` to the Wine plugin host.
|
||||||
|
*/
|
||||||
|
struct SetComponentState {
|
||||||
|
using Response = UniversalTResult;
|
||||||
|
|
||||||
|
native_size_t instance_id;
|
||||||
|
|
||||||
|
VectorStream state;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(instance_id);
|
||||||
|
s.object(state);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
setComponentState(Steinberg::IBStream* state) override = 0;
|
setComponentState(Steinberg::IBStream* state) override = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -190,9 +190,8 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getState(Steinberg::IBStream* state) {
|
|||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
Vst3PluginProxyImpl::setComponentState(Steinberg::IBStream* state) {
|
Vst3PluginProxyImpl::setComponentState(Steinberg::IBStream* state) {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaEditController2::SetComponentState{
|
||||||
bridge.logger.log("TODO IEditController::setComponentState()");
|
.instance_id = arguments.instance_id, .state = state});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 PLUGIN_API Vst3PluginProxyImpl::getParameterCount() {
|
int32 PLUGIN_API Vst3PluginProxyImpl::getParameterCount() {
|
||||||
|
|||||||
@@ -232,6 +232,11 @@ void Vst3Bridge::run() {
|
|||||||
return object_instances[request.instance_id]
|
return object_instances[request.instance_id]
|
||||||
.component->setActive(request.state);
|
.component->setActive(request.state);
|
||||||
},
|
},
|
||||||
|
[&](YaEditController2::SetComponentState& request)
|
||||||
|
-> YaEditController2::SetComponentState::Response {
|
||||||
|
return object_instances[request.instance_id]
|
||||||
|
.edit_controller->setComponentState(&request.state);
|
||||||
|
},
|
||||||
[&](YaPluginBase::Initialize& request)
|
[&](YaPluginBase::Initialize& request)
|
||||||
-> YaPluginBase::Initialize::Response {
|
-> YaPluginBase::Initialize::Response {
|
||||||
// If we got passed a host context, we'll create a proxy object
|
// If we got passed a host context, we'll create a proxy object
|
||||||
|
|||||||
Reference in New Issue
Block a user