mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IEditController::plainParamToNormalized
This commit is contained in:
@@ -344,6 +344,17 @@ void Vst3Logger::log_request(
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const YaEditController2::PlainParamToNormalized& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": IEditController::plainParamToNormalized(id = "
|
||||
<< request.id << ", plainValue = " << request.plain_value
|
||||
<< ")";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginBase::Initialize& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
|
||||
@@ -92,6 +92,8 @@ class Vst3Logger {
|
||||
const YaEditController2::GetParamValueByString&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaEditController2::NormalizedParamToPlain&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaEditController2::PlainParamToNormalized&);
|
||||
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&);
|
||||
|
||||
@@ -82,6 +82,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
||||
YaEditController2::GetParamStringByValue,
|
||||
YaEditController2::GetParamValueByString,
|
||||
YaEditController2::NormalizedParamToPlain,
|
||||
YaEditController2::PlainParamToNormalized,
|
||||
YaPluginBase::Initialize,
|
||||
YaPluginBase::Terminate,
|
||||
YaPluginFactory::Construct,
|
||||
|
||||
@@ -275,6 +275,28 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
||||
virtual Steinberg::Vst::ParamValue PLUGIN_API normalizedParamToPlain(
|
||||
Steinberg::Vst::ParamID id,
|
||||
Steinberg::Vst::ParamValue valueNormalized) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IEditController::plainParamToNormalized(id, plain_value)` to the Wine
|
||||
* plugin host.
|
||||
*/
|
||||
struct PlainParamToNormalized {
|
||||
using Response = PrimitiveWrapper<Steinberg::Vst::ParamValue>;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::ParamID id;
|
||||
Steinberg::Vst::ParamValue plain_value;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(id);
|
||||
s.value8b(plain_value);
|
||||
}
|
||||
};
|
||||
|
||||
virtual Steinberg::Vst::ParamValue PLUGIN_API
|
||||
plainParamToNormalized(Steinberg::Vst::ParamID id,
|
||||
Steinberg::Vst::ParamValue plainValue) override = 0;
|
||||
|
||||
@@ -286,9 +286,8 @@ Steinberg::Vst::ParamValue PLUGIN_API
|
||||
Vst3PluginProxyImpl::plainParamToNormalized(
|
||||
Steinberg::Vst::ParamID id,
|
||||
Steinberg::Vst::ParamValue plainValue) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO IEditController::plainParamToNormalized()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaEditController2::PlainParamToNormalized{
|
||||
.instance_id = instance_id(), .id = id, .plain_value = plainValue});
|
||||
}
|
||||
|
||||
Steinberg::Vst::ParamValue PLUGIN_API
|
||||
|
||||
@@ -313,6 +313,11 @@ void Vst3Bridge::run() {
|
||||
.edit_controller->normalizedParamToPlain(
|
||||
request.id, request.value_normalized);
|
||||
},
|
||||
[&](const YaEditController2::PlainParamToNormalized& request) {
|
||||
return object_instances[request.instance_id]
|
||||
.edit_controller->plainParamToNormalized(
|
||||
request.id, request.plain_value);
|
||||
},
|
||||
[&](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