Implementations for Plugin-Preset-Load to set automation

This commit is contained in:
Robin Gareus
2017-02-21 15:24:02 +01:00
parent 5db22a33c1
commit bdf41b0bf5
4 changed files with 10 additions and 3 deletions

View File

@@ -808,6 +808,7 @@ LadspaPlugin::load_preset (PresetRecord r)
for (uint32_t i = 0; i < (uint32_t) defs->count; ++i) {
if (parameter_is_input (defs->items[i].pid)) {
set_parameter(defs->items[i].pid, defs->items[i].value);
PresetPortSetValue (defs->items[i].pid, defs->items[i].value); /* EMIT SIGNAL */
}
}
lrdf_free_setting_values(defs);

View File

@@ -1125,7 +1125,10 @@ LuaProc::load_preset (PresetRecord r)
assert (index);
assert (value);
LocaleGuard lg;
set_parameter (atoi (index->value().c_str()), atof (value->value().c_str ()));
const uint32_t p = atoi (index->value().c_str());
const float v = atof (value->value().c_str ());
set_parameter (p, v);
PresetPortSetValue (p, v); /* EMIT SIGNAL */
}
}
return Plugin::load_preset(r);

View File

@@ -1434,6 +1434,7 @@ set_port_value(const char* port_symbol,
const uint32_t port_index = self->port_index(port_symbol);
if (port_index != (uint32_t)-1) {
self->set_parameter(port_index, *(const float*)value);
self->PresetPortSetValue (port_index, *(const float*)value); /* EMIT SIGNAL */
}
}

View File

@@ -446,8 +446,10 @@ VSTPlugin::load_user_preset (PresetRecord r)
assert (index);
assert (value);
set_parameter (atoi (index->value().c_str()), atof (value->value().c_str ()));
const uint32_t p = atoi (index->value().c_str());
const float v = atof (value->value().c_str ());
set_parameter (p, v);
PresetPortSetValue (p, v); /* EMIT SIGNAL */
}
}
return true;