Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param To/From string correct in VST3 #107

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/wrapasvst3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,13 @@ tresult PLUGIN_API ClapAsVst3::getParamStringByValue(Vst::ParamID id, Vst::Param
auto val = param->asClapValue(valueNormalized);

char outbuf[128];
memset(outbuf, 0, sizeof(outbuf));
if (this->_plugin->_ext._params->value_to_text(_plugin->_plugin, param->id, val, outbuf, 127))
{
UString wrapper(&string[0], str16BufferSize(Steinberg::Vst::String128));

wrapper.assign(outbuf,sizeof(outbuf));
return true;
return kResultOk;
}
return super::getParamStringByValue(id, valueNormalized, string);
}
Expand All @@ -255,14 +256,14 @@ tresult PLUGIN_API ClapAsVst3::getParamValueByString(Vst::ParamID id, Vst::TChar
auto param = (Vst3Parameter*)this->getParameterObject(id);
Steinberg::String m(string);
char inbuf[128];
auto l = m.copyTo8(inbuf);
m.copyTo8(inbuf, 0, 128);
double out = 0.;
if (this->_plugin->_ext._params->text_to_value(_plugin->_plugin, param->id, inbuf, &out))
{
valueNormalized = out;
return true;
valueNormalized = param->asVst3Value(out);
defiantnerd marked this conversation as resolved.
Show resolved Hide resolved
return kResultOk;
}
return false;
return Steinberg::kResultFalse;

}

Expand Down