mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IEditController::normalizedValueToPlain
This commit is contained in:
@@ -333,6 +333,17 @@ void Vst3Logger::log_request(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Vst3Logger::log_request(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaEditController2::NormalizedParamToPlain& request) {
|
||||||
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.instance_id
|
||||||
|
<< ": IEditController::normalizedParamToPlain(id = "
|
||||||
|
<< request.id
|
||||||
|
<< ", valueNormalized = " << request.value_normalized << ")";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ class Vst3Logger {
|
|||||||
const YaEditController2::GetParamStringByValue&);
|
const YaEditController2::GetParamStringByValue&);
|
||||||
void log_request(bool is_host_vst,
|
void log_request(bool is_host_vst,
|
||||||
const YaEditController2::GetParamValueByString&);
|
const YaEditController2::GetParamValueByString&);
|
||||||
|
void log_request(bool is_host_vst,
|
||||||
|
const YaEditController2::NormalizedParamToPlain&);
|
||||||
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&);
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
|||||||
YaEditController2::GetParameterInfo,
|
YaEditController2::GetParameterInfo,
|
||||||
YaEditController2::GetParamStringByValue,
|
YaEditController2::GetParamStringByValue,
|
||||||
YaEditController2::GetParamValueByString,
|
YaEditController2::GetParamValueByString,
|
||||||
|
YaEditController2::NormalizedParamToPlain,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -250,6 +250,28 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
|||||||
Steinberg::Vst::ParamID id,
|
Steinberg::Vst::ParamID id,
|
||||||
Steinberg::Vst::TChar* string /*in*/,
|
Steinberg::Vst::TChar* string /*in*/,
|
||||||
Steinberg::Vst::ParamValue& valueNormalized /*out*/) override = 0;
|
Steinberg::Vst::ParamValue& valueNormalized /*out*/) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to
|
||||||
|
* `IEditController::normalizedParamToPlain(id, value_normalized)` to the
|
||||||
|
* Wine plugin host.
|
||||||
|
*/
|
||||||
|
struct NormalizedParamToPlain {
|
||||||
|
using Response = PrimitiveWrapper<Steinberg::Vst::ParamValue>;
|
||||||
|
|
||||||
|
native_size_t instance_id;
|
||||||
|
|
||||||
|
Steinberg::Vst::ParamID id;
|
||||||
|
Steinberg::Vst::ParamValue value_normalized;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(instance_id);
|
||||||
|
s.value4b(id);
|
||||||
|
s.value8b(value_normalized);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual Steinberg::Vst::ParamValue PLUGIN_API normalizedParamToPlain(
|
virtual Steinberg::Vst::ParamValue PLUGIN_API normalizedParamToPlain(
|
||||||
Steinberg::Vst::ParamID id,
|
Steinberg::Vst::ParamID id,
|
||||||
Steinberg::Vst::ParamValue valueNormalized) override = 0;
|
Steinberg::Vst::ParamValue valueNormalized) override = 0;
|
||||||
|
|||||||
@@ -276,9 +276,10 @@ Steinberg::Vst::ParamValue PLUGIN_API
|
|||||||
Vst3PluginProxyImpl::normalizedParamToPlain(
|
Vst3PluginProxyImpl::normalizedParamToPlain(
|
||||||
Steinberg::Vst::ParamID id,
|
Steinberg::Vst::ParamID id,
|
||||||
Steinberg::Vst::ParamValue valueNormalized) {
|
Steinberg::Vst::ParamValue valueNormalized) {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaEditController2::NormalizedParamToPlain{
|
||||||
bridge.logger.log("TODO IEditController::normalizedParamToPlain()");
|
.instance_id = instance_id(),
|
||||||
return Steinberg::kNotImplemented;
|
.id = id,
|
||||||
|
.value_normalized = valueNormalized});
|
||||||
}
|
}
|
||||||
|
|
||||||
Steinberg::Vst::ParamValue PLUGIN_API
|
Steinberg::Vst::ParamValue PLUGIN_API
|
||||||
@@ -339,10 +340,10 @@ tresult PLUGIN_API Vst3PluginProxyImpl::openAboutBox(TBool onlyCheck) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PluginProxyImpl::initialize(FUnknown* context) {
|
tresult PLUGIN_API Vst3PluginProxyImpl::initialize(FUnknown* context) {
|
||||||
// This `context` will likely be an `IHostApplication`. If it is, we will
|
// This `context` will likely be an `IHostApplication`. If it is, we
|
||||||
// store it here, and we'll proxy through all calls to it made from the Wine
|
// will store it here, and we'll proxy through all calls to it made from
|
||||||
// side. Otherwise we'll still call `IPluginBase::initialize()` but with a
|
// the Wine side. Otherwise we'll still call `IPluginBase::initialize()`
|
||||||
// null pointer instead.
|
// but with a null pointer instead.
|
||||||
host_application_context = context;
|
host_application_context = context;
|
||||||
|
|
||||||
std::optional<YaHostApplication::ConstructArgs>
|
std::optional<YaHostApplication::ConstructArgs>
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ void Vst3Bridge::run() {
|
|||||||
return YaEditController2::GetParameterInfoResponse{
|
return YaEditController2::GetParameterInfoResponse{
|
||||||
.result = result, .updated_info = request.info};
|
.result = result, .updated_info = request.info};
|
||||||
},
|
},
|
||||||
[&](YaEditController2::GetParamStringByValue& request)
|
[&](const YaEditController2::GetParamStringByValue& request)
|
||||||
-> YaEditController2::GetParamStringByValue::Response {
|
-> YaEditController2::GetParamStringByValue::Response {
|
||||||
Steinberg::Vst::String128 string{0};
|
Steinberg::Vst::String128 string{0};
|
||||||
const tresult result =
|
const tresult result =
|
||||||
@@ -293,7 +293,7 @@ void Vst3Bridge::run() {
|
|||||||
.result = result,
|
.result = result,
|
||||||
.string = tchar_pointer_to_u16string(string)};
|
.string = tchar_pointer_to_u16string(string)};
|
||||||
},
|
},
|
||||||
[&](YaEditController2::GetParamValueByString& request)
|
[&](const YaEditController2::GetParamValueByString& request)
|
||||||
-> YaEditController2::GetParamValueByString::Response {
|
-> YaEditController2::GetParamValueByString::Response {
|
||||||
Steinberg::Vst::ParamValue value_normalized;
|
Steinberg::Vst::ParamValue value_normalized;
|
||||||
const tresult result =
|
const tresult result =
|
||||||
@@ -308,6 +308,11 @@ void Vst3Bridge::run() {
|
|||||||
return YaEditController2::GetParamValueByStringResponse{
|
return YaEditController2::GetParamValueByStringResponse{
|
||||||
.result = result, .value_normalized = value_normalized};
|
.result = result, .value_normalized = value_normalized};
|
||||||
},
|
},
|
||||||
|
[&](const YaEditController2::NormalizedParamToPlain& request) {
|
||||||
|
return object_instances[request.instance_id]
|
||||||
|
.edit_controller->normalizedParamToPlain(
|
||||||
|
request.id, request.value_normalized);
|
||||||
|
},
|
||||||
[&](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