Skip to content

Commit

Permalink
LV2: remove unneeded QStrings and redundant property checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Nov 7, 2022
1 parent af632fc commit 99df207
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/effects/backends/lv2/lv2manifest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ LV2Manifest::LV2Manifest(LilvWorld* world,

// Get and set the parameter name
info = lilv_port_get_name(m_pLV2plugin, port);
QString paramName = lilv_node_as_string(info);
param->setName(paramName);
param->setName(lilv_node_as_string(info));
lilv_node_free(info);

const LilvNode* node = lilv_port_get_symbol(m_pLV2plugin, port);
QString symbol = lilv_node_as_string(node);
param->setId(symbol);
param->setId(lilv_node_as_string(node));
// node must not be freed here, it is owned by port

EffectManifestParameter::UnitsHint unitsHint =
Expand Down Expand Up @@ -119,13 +117,7 @@ LV2Manifest::LV2Manifest(LilvWorld* world,
}
param->setRange(m_minimum[i], m_default[i], m_maximum[i]);

// Set the appropriate Hints
if (lilv_port_has_property(m_pLV2plugin, port, properties["button_port"])) {
param->setValueScaler(EffectManifestParameter::ValueScaler::Toggle);
} else if (lilv_port_has_property(m_pLV2plugin, port, properties["enumeration_port"])) {
buildEnumerationOptions(port, param);
param->setValueScaler(EffectManifestParameter::ValueScaler::Toggle);
} else if (lilv_port_has_property(m_pLV2plugin, port, properties["integer_port"])) {
if (lilv_port_has_property(m_pLV2plugin, port, properties["integer_port"])) {
param->setValueScaler(EffectManifestParameter::ValueScaler::Integral);
} else {
param->setValueScaler(EffectManifestParameter::ValueScaler::Linear);
Expand Down

0 comments on commit 99df207

Please sign in to comment.