, work_iface(0)
, state(0)
{}
-
+
/** Find the LV2 input port with the given designation.
* If found, bufptrs[port_index] will be set to bufptr.
*/
"%1 set parameter %2 to %3\n", name(), which, val));
if (which < lilv_plugin_get_num_ports(_impl->plugin)) {
-
if (get_parameter (which) == val) {
return;
}
-
- _shadow_data[which] = val;
-
+ _shadow_data[which] = val;
} else {
warning << string_compose(
_("Illegal parameter number used with plugin \"%1\". "
return "";
}
-
+
std::string
LV2Plugin::get_parameter_docs(uint32_t which) const
{
bool
LV2Plugin::load_preset(PresetRecord r)
{
-
std::map<std::string,uint32_t>::iterator it;
LilvNode* lv2_port = lilv_new_uri(_world.world, LILV_NS_LV2 "port");
const LilvNode* symbol = get_value(_world.world, port, lv2_symbol);
const LilvNode* value = get_value(_world.world, port, pset_value);
if (value && lilv_node_is_float(value)) {
- it = _port_indices.find(lilv_node_as_string(symbol));
- if (it != _port_indices.end())
- set_parameter(it->second,lilv_node_as_float(value));
+ it = _port_indices.find(lilv_node_as_string(symbol));
+ if (it != _port_indices.end()) {
+ set_parameter(it->second,lilv_node_as_float(value));
+ }
}
}
lilv_nodes_free(ports);
pset_uri += name;
string save_dir = Glib::build_filename(
- Glib::get_home_dir(),
- Glib::build_filename(".lv2", "presets")
+ Glib::get_home_dir(),
+ Glib::build_filename(".lv2", "presets")
);
LilvState* state = lilv_state_new_from_instance(
_impl->plugin,
_impl->instance,
_uri_map.urid_map(),
- scratch_dir().c_str(), // file_dir
- NULL, // copy_dir
- NULL, // link_dir
- save_dir.c_str(), // save_dir
- lv2plugin_get_port_value, // get_value
- (void*) this, // user_data
+ scratch_dir().c_str(), // file_dir
+ NULL, // copy_dir
+ NULL, // link_dir
+ save_dir.c_str(), // save_dir
+ lv2plugin_get_port_value, // get_value
+ (void*) this, // user_data
LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE, // flags
- _features // features
+ _features // features
);
lilv_state_set_label(state, name.c_str());
lilv_state_save(
- _world.world, // world
+ _world.world, // world
_uri_map.urid_map(), // map
_uri_map.urid_unmap(), // unmap
- state, // state
- pset_uri.c_str(), // uri
- save_dir.c_str(), // dir
+ state, // state
+ pset_uri.c_str(), // uri
+ save_dir.c_str(), // dir
(name + ".ttl").c_str() // filename
-
);
lilv_state_free(state);
LV2Plugin::do_remove_preset(string name)
{
string preset_file = Glib::build_filename(
- Glib::get_home_dir(),
+ Glib::get_home_dir(),
Glib::build_filename(
Glib::build_filename(".lv2", "presets"),
name + ".ttl"
)
);
unlink(preset_file.c_str());
-
}
bool