mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IEditController::getParamStringByValue()
This commit is contained in:
@@ -295,6 +295,17 @@ void Vst3Logger::log_request(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Vst3Logger::log_request(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaEditController2::GetParamStringByValue& request) {
|
||||||
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << "<IEditController* #" << request.instance_id
|
||||||
|
<< ">::getParamStringByValue(id = " << request.id
|
||||||
|
<< ", valueNormalized = " << request.value_normalized
|
||||||
|
<< ", &string)";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
@@ -459,6 +470,18 @@ void Vst3Logger::log_response(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Vst3Logger::log_response(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaEditController2::GetParamStringByValueResponse& response) {
|
||||||
|
log_response_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << response.result.string();
|
||||||
|
if (response.result == Steinberg::kResultOk) {
|
||||||
|
std::string title = VST3::StringConvert::convert(response.string);
|
||||||
|
message << ", \"" << title << "\"";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_response(bool is_host_vst,
|
void Vst3Logger::log_response(bool is_host_vst,
|
||||||
const YaPluginFactory::ConstructArgs& args) {
|
const YaPluginFactory::ConstructArgs& args) {
|
||||||
log_response_base(is_host_vst, [&](auto& message) {
|
log_response_base(is_host_vst, [&](auto& message) {
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ class Vst3Logger {
|
|||||||
const YaEditController2::GetParameterCount&);
|
const YaEditController2::GetParameterCount&);
|
||||||
void log_request(bool is_host_vst,
|
void log_request(bool is_host_vst,
|
||||||
const YaEditController2::GetParameterInfo&);
|
const YaEditController2::GetParameterInfo&);
|
||||||
|
void log_request(bool is_host_vst,
|
||||||
|
const YaEditController2::GetParamStringByValue&);
|
||||||
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&);
|
||||||
@@ -106,6 +108,8 @@ class Vst3Logger {
|
|||||||
const YaComponent::GetRoutingInfoResponse&);
|
const YaComponent::GetRoutingInfoResponse&);
|
||||||
void log_response(bool is_host_vst,
|
void log_response(bool is_host_vst,
|
||||||
const YaEditController2::GetParameterInfoResponse&);
|
const YaEditController2::GetParameterInfoResponse&);
|
||||||
|
void log_response(bool is_host_vst,
|
||||||
|
const YaEditController2::GetParamStringByValueResponse&);
|
||||||
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
|
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
|
||||||
void log_response(bool is_host_vst, const Configuration&);
|
void log_response(bool is_host_vst, const Configuration&);
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
|||||||
YaEditController2::SetComponentState,
|
YaEditController2::SetComponentState,
|
||||||
YaEditController2::GetParameterCount,
|
YaEditController2::GetParameterCount,
|
||||||
YaEditController2::GetParameterInfo,
|
YaEditController2::GetParameterInfo,
|
||||||
|
YaEditController2::GetParamStringByValue,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The response code and returned parameter information for a call to
|
* The response code and returned parameter information for a call to
|
||||||
* `IEditController::getParameterINfo(param_index, &info)`.
|
* `IEditController::getParameterInfo(param_index, &info)`.
|
||||||
*/
|
*/
|
||||||
struct GetParameterInfoResponse {
|
struct GetParameterInfoResponse {
|
||||||
UniversalTResult result;
|
UniversalTResult result;
|
||||||
@@ -142,7 +142,7 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Message to pass through a call to
|
* Message to pass through a call to
|
||||||
* `IEditController::getParameterINfo(param_index, &info)` to the Wine
|
* `IEditController::getParameterInfo(param_index, &info)` to the Wine
|
||||||
* plugin host.
|
* plugin host.
|
||||||
*/
|
*/
|
||||||
struct GetParameterInfo {
|
struct GetParameterInfo {
|
||||||
@@ -164,6 +164,45 @@ class YaEditController2 : public Steinberg::Vst::IEditController,
|
|||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
getParameterInfo(int32 paramIndex,
|
getParameterInfo(int32 paramIndex,
|
||||||
Steinberg::Vst::ParameterInfo& info /*out*/) override = 0;
|
Steinberg::Vst::ParameterInfo& info /*out*/) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The response code and returned parameter information for a call to
|
||||||
|
* `IEditController::getParamStringByValue(id, value_normalized,
|
||||||
|
* &string)`.
|
||||||
|
*/
|
||||||
|
struct GetParamStringByValueResponse {
|
||||||
|
UniversalTResult result;
|
||||||
|
|
||||||
|
std::u16string string;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.object(result);
|
||||||
|
s.container2b(string, std::extent_v<Steinberg::Vst::String128>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to
|
||||||
|
* `IEditController::getParamStringByValue(id, value_normalized, &string)`
|
||||||
|
* to the Wine plugin host.
|
||||||
|
*/
|
||||||
|
struct GetParamStringByValue {
|
||||||
|
using Response = GetParamStringByValueResponse;
|
||||||
|
|
||||||
|
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 tresult PLUGIN_API getParamStringByValue(
|
virtual tresult PLUGIN_API getParamStringByValue(
|
||||||
Steinberg::Vst::ParamID id,
|
Steinberg::Vst::ParamID id,
|
||||||
Steinberg::Vst::ParamValue valueNormalized /*in*/,
|
Steinberg::Vst::ParamValue valueNormalized /*in*/,
|
||||||
|
|||||||
@@ -217,9 +217,16 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getParamStringByValue(
|
|||||||
Steinberg::Vst::ParamID id,
|
Steinberg::Vst::ParamID id,
|
||||||
Steinberg::Vst::ParamValue valueNormalized /*in*/,
|
Steinberg::Vst::ParamValue valueNormalized /*in*/,
|
||||||
Steinberg::Vst::String128 string /*out*/) {
|
Steinberg::Vst::String128 string /*out*/) {
|
||||||
// TODO: Implement
|
const GetParamStringByValueResponse response =
|
||||||
bridge.logger.log("TODO IEditController::getParamStringByValue()");
|
bridge.send_message(YaEditController2::GetParamStringByValue{
|
||||||
return Steinberg::kNotImplemented;
|
.instance_id = arguments.instance_id,
|
||||||
|
.id = id,
|
||||||
|
.value_normalized = valueNormalized});
|
||||||
|
|
||||||
|
std::copy(response.string.begin(), response.string.end(), string);
|
||||||
|
string[response.string.size()] = 0;
|
||||||
|
|
||||||
|
return response.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PluginProxyImpl::getParamValueByString(
|
tresult PLUGIN_API Vst3PluginProxyImpl::getParamValueByString(
|
||||||
|
|||||||
@@ -252,6 +252,18 @@ void Vst3Bridge::run() {
|
|||||||
return YaEditController2::GetParameterInfoResponse{
|
return YaEditController2::GetParameterInfoResponse{
|
||||||
.result = result, .updated_info = request.info};
|
.result = result, .updated_info = request.info};
|
||||||
},
|
},
|
||||||
|
[&](YaEditController2::GetParamStringByValue& request)
|
||||||
|
-> YaEditController2::GetParamStringByValue::Response {
|
||||||
|
Steinberg::Vst::String128 string{0};
|
||||||
|
const tresult result =
|
||||||
|
object_instances[request.instance_id]
|
||||||
|
.edit_controller->getParamStringByValue(
|
||||||
|
request.id, request.value_normalized, string);
|
||||||
|
|
||||||
|
return YaEditController2::GetParamStringByValueResponse{
|
||||||
|
.result = result,
|
||||||
|
.string = tchar_pointer_to_u16string(string)};
|
||||||
|
},
|
||||||
[&](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