Paul Davis schrieb:
On Wed, 2009-01-21 at 23:07 +0200, Stefan Kost wrote:
Seems to be a nice library, but it looks already
too capable for the task at
hand. The idea is to agree on a simple format, so that we don't add a hidden
dependency for a certain library to parse it. Therefore no xml, rdf etc..
No, no, and a hundred times no. This is the code needed in ardour to
load a named preset:
I got ensure in a previous thread, that the rdf approach is flawed, as you can't
get a list of presets for each plugin. I got no answer how its supposed to work.
What an application would want to do is:
* scan LADSPA_PATH for plugins
* get the rdf blob for each
* build a list of presets for each plugin
If I just got it wrong and this is how its supposed to work, we don't need
anything, but a pointer to code that does this.
Stefan
---------------------------------------------------------------
bool
Plugin::load_preset(const string preset_label)
{
lrdf_defaults* defs =
lrdf_get_setting_values(presets[preset_label].c_str());
if (defs) {
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 < (uint32_t) defs->count) &&
parameter_is_input (defs->items[i].pid)) {
set_parameter(defs->items[i].pid, defs->items[i].value);
}
}
lrdf_free_setting_values(defs);
}
return true;
}
----------------------------------------------------------------------
The ONLY reason that Ardour would ever switch to some other "format" is
if there is similarly easy way of loading presets. This means a
pre-existing "library" (at the very least, 2 function) to get the
load/save done.
This means, as I said a few days ago, that the core question is not what
format to use, but where these functions are supposed to live.
Right now, most linux distro's have liblrdf (the library ardour uses) as
a package. What is the actual problem with this format (other than that
its essentially illegible to regular humans) ? What problem is solved by
using some other format/library.
Note that, just for comparison, Apple AU's have their presets stored as
XML. The contents are opaque to everything except the plugin (even
though they are technically human-readable.