mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Implement IEditController::getParamNormalized()
This commit is contained in:
@@ -355,6 +355,16 @@ void Vst3Logger::log_request(
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const YaEditController2::GetParamNormalized& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": IEditController::getParamNormalized(id = " << request.id
|
||||
<< ")";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginBase::Initialize& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
|
||||
@@ -94,6 +94,8 @@ class Vst3Logger {
|
||||
const YaEditController2::NormalizedParamToPlain&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaEditController2::PlainParamToNormalized&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaEditController2::GetParamNormalized&);
|
||||
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 YaPluginFactory::Construct&);
|
||||
|
||||
@@ -83,6 +83,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
||||
YaEditController2::GetParamValueByString,
|
||||
YaEditController2::NormalizedParamToPlain,
|
||||
YaEditController2::PlainParamToNormalized,
|
||||
YaEditController2::GetParamNormalized,
|
||||
YaPluginBase::Initialize,
|
||||
YaPluginBase::Terminate,
|
||||
YaPluginFactory::Construct,
|
||||
|
||||
@@ -300,8 +300,48 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
||||
virtual Steinberg::Vst::ParamValue PLUGIN_API
|
||||
plainParamToNormalized(Steinberg::Vst::ParamID id,
|
||||
Steinberg::Vst::ParamValue plainValue) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IEditController::getParamNormalized(id)` to the Wine plugin host.
|
||||
*/
|
||||
struct GetParamNormalized {
|
||||
using Response = PrimitiveWrapper<Steinberg::Vst::ParamValue>;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::ParamID id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(id);
|
||||
}
|
||||
};
|
||||
|
||||
virtual Steinberg::Vst::ParamValue PLUGIN_API
|
||||
getParamNormalized(Steinberg::Vst::ParamID id) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IEditController::setParamNormalized(id, value)` to the Wine plugin host.
|
||||
*/
|
||||
struct SetParamNormalized {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::ParamID id;
|
||||
Steinberg::Vst::ParamValue value;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(id);
|
||||
s.value8b(value);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
setParamNormalized(Steinberg::Vst::ParamID id,
|
||||
Steinberg::Vst::ParamValue value) override = 0;
|
||||
|
||||
@@ -292,9 +292,8 @@ Vst3PluginProxyImpl::plainParamToNormalized(
|
||||
|
||||
Steinberg::Vst::ParamValue PLUGIN_API
|
||||
Vst3PluginProxyImpl::getParamNormalized(Steinberg::Vst::ParamID id) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO IEditController::getParamNormalized()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaEditController2::GetParamNormalized{
|
||||
.instance_id = instance_id(), .id = id});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -318,6 +318,10 @@ void Vst3Bridge::run() {
|
||||
.edit_controller->plainParamToNormalized(
|
||||
request.id, request.plain_value);
|
||||
},
|
||||
[&](const YaEditController2::GetParamNormalized& request) {
|
||||
return object_instances[request.instance_id]
|
||||
.edit_controller->getParamNormalized(request.id);
|
||||
},
|
||||
[&](YaPluginBase::Initialize& request)
|
||||
-> YaPluginBase::Initialize::Response {
|
||||
// If we got passed a host context, we'll create a proxy object
|
||||
|
||||
Reference in New Issue
Block a user