if (get_control_info (ch, ev, additional)) {
data.controller_number = additional;
data.value = val;
-
+ last_written = val;
+
plugin.session().send_midi_message (get_port(), ev, ch, data);
}
}
return buf;
}
-list<string>
+vector<string>
Plugin::get_presets()
{
- list<string> labels;
+ vector<string> labels;
lrdf_uris* set_uris = lrdf_get_setting_uris(unique_id());
if (set_uris) {
- for (uint32_t i = 0; i < set_uris->count; ++i) {
+ for (uint32_t i = 0; i < (uint32_t) set_uris->count; ++i) {
if (char* label = lrdf_get_label(set_uris->items[i])) {
labels.push_back(label);
presets[label] = set_uris->items[i];
lrdf_free_uris(set_uris);
}
- labels.unique();
+ // GTK2FIX find an equivalent way to do this with a vector (needed by GUI apis)
+ // labels.unique();
return labels;
}
lrdf_defaults* defs = lrdf_get_setting_values(presets[preset_label].c_str());
if (defs) {
- for (uint32_t i = 0; i < defs->count; ++i) {
+ for (uint32_t i = 0; i < (uint32_t) defs->count; ++i) {
// The defs->items[i].pid < defs->count check is to work around
// a bug in liblrdf that saves invalid values into the presets file.
- if (((uint32_t) defs->items[i].pid < defs->count) && parameter_is_input (defs->items[i].pid)) {
+ if (((uint32_t) defs->items[i].pid < (uint32_t) defs->count) && parameter_is_input (defs->items[i].pid)) {
set_parameter(defs->items[i].pid, defs->items[i].value);
}
}
return false;
}
- string source(compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
+ string source(string_compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
free(lrdf_add_preset(source.c_str(), name.c_str(), unique_id(), &defaults));
- string path = compose("%1/.%2", envvar, domain);
+ string path = string_compose("%1/.%2", envvar, domain);
if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
- warning << compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
+ warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
path += "/rdf";
if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
- warning << compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
+ warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
if (lrdf_export_by_source(source.c_str(), source.substr(5).c_str())) {
- warning << compose(_("Error saving presets file %1."), source) << endmsg;
+ warning << string_compose(_("Error saving presets file %1."), source) << endmsg;
return false;
}