Lv2Proc: Check def in [min,max] when creating port

This commit is contained in:
Johannes Lorenz
2020-11-15 17:27:06 +01:00
committed by Johannes Lorenz
parent 3a74bad0c9
commit 060d0dc5dc

View File

@@ -469,6 +469,16 @@ void Lv2Proc::createPort(std::size_t portNum)
AutoLilvNode node(lilv_port_get_name(m_plugin, lilvPort));
QString dispName = lilv_node_as_string(node.get());
sample_rate_t sr = Engine::mixer()->processingSampleRate();
if(meta.def() < meta.min(sr) || meta.def() > meta.max(sr))
{
qWarning() << "Warning: Plugin"
<< qStringFromPluginNode(m_plugin, lilv_plugin_get_name)
<< "(URI:"
<< lilv_node_as_uri(lilv_plugin_get_uri(m_plugin))
<< ") has a default value for port"
<< dispName
<< "which is not in range [min, max].";
}
switch (meta.m_vis)
{
case Lv2Ports::Vis::None:
@@ -511,6 +521,7 @@ void Lv2Proc::createPort(std::size_t portNum)
}
lilv_scale_points_free(sps);
ctrl->m_connectedModel.reset(comboModel);
// TODO: use default value on comboModel, too?
break;
}
case Lv2Ports::Vis::Toggled: