mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 04:20:13 +02:00
Unify handling for *::{get,set}State
Since these functions are exactly the same, and for whatever reason they didn't just add them to the `IPluginBase` both `IComponent` and `IEditController`. inherit from
This commit is contained in:
@@ -171,22 +171,23 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setActive(TBool state) {
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::setState(Steinberg::IBStream* state) {
|
||||
return bridge.send_message(YaComponent::SetState{
|
||||
// Since both interfaces contain this function, this is used for both
|
||||
// `IComponent::setState()` as well as `IEditController::setState()`
|
||||
return bridge.send_message(Vst3PluginProxy::SetState{
|
||||
.instance_id = arguments.instance_id, .state = state});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::getState(Steinberg::IBStream* state) {
|
||||
// Since both interfaces contain this function, this is used for both
|
||||
// `IComponent::getState()` as well as `IEditController::getState()`
|
||||
const GetStateResponse response = bridge.send_message(
|
||||
YaComponent::GetState{.instance_id = arguments.instance_id});
|
||||
Vst3PluginProxy::GetState{.instance_id = arguments.instance_id});
|
||||
|
||||
assert(response.updated_state.write_back(state) == Steinberg::kResultOk);
|
||||
|
||||
return response.result;
|
||||
}
|
||||
|
||||
// FIXME: Fix `{set,get}State()` for `IEditController` as mentioned in the
|
||||
// header
|
||||
|
||||
tresult PLUGIN_API
|
||||
Vst3PluginProxyImpl::setComponentState(Steinberg::IBStream* state) {
|
||||
// TODO: Implement
|
||||
|
||||
Reference in New Issue
Block a user