Sylvain HENRY schrieb:
----- Message d'origine ----
De : MarcO'Chapeau
<marco(a)marcochapeau.org>
À : linux-audio-dev(a)lists.linuxaudio.org
Envoyé le : Mercredi, 21 Janvier 2009, 16h04mn 47s
Objet : Re: [LAD] Saving plugin presets
Luis Garrido schrieb:
To be utterly pragmatic, I think at this moment
the best approach for
this problem would be an evolutionary one.
Just implement whatever format you feel like and see if it takes. No
one is going to sue you, although you are guaranteed to get your fair
share of critics, no matter what.
At the worst case, this particular situation is so utterly simple that
it should be trivial to convert one format to another if the need
arises.
If it helps in the end I chose for my project INI files just because
it was a Qt app and Qt provides a nifty INI parser (QSettings) with
some merging capabilities (concurrent Qt processes can make changes
without corrupting the file and those are easily synchronized.) But
that was me just being lazy, I guess.
In fact, being lazy can be good. INI files
nearly use a YAML syntax which
is also very easy to parse with C, C++, python and perl.
Maybe you could use libconfig?
http://www.hyperrealm.com/libconfig/
It is really easy to use (no parsing, no type casting) and configuration files can have a
very well structured syntax (array, list, comments...).
Moreover you can use it directly from C or C++.
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..
Take ladspa/aw.so
analyseplugin /usr/lib/ladspa/aw.so | grep
"control,"
Ports: "Frequency (Hz)" input, control, 0 to ...
"Feedback" input, control, 0 to 1
"Delay (samples)" input, control, 5 to 50, integer
So the preset could look like:
[ladspa preset]
plugin=alienwah_mono
preset="Angry Alien"
[parameters]
"Frequency (Hz)"=100
"Feedback"=0.7
"Delay (samples)"=40
Using the names as keys looks ugly, we could agree on using the port-numbers too.
Like Luis suggested the files could reside in:
Global: /usr/share/ladspa/presets/alienwah_mono/angry_alien.ini
Local: ~/.ladspa/presets/alienwah_mono/angry_alien.ini
or to go with xdg-user-dir spec (not clutter the homedirs even more)
Local: ~/.config/ladspa/presets/alienwah_mono/angry_alien.ini
Anything missing? Everyone agrees? How do we get it added to ladspa.h as a big
comment blob :)
ciao
Stefan
Cheers,
Sylvain
-- Marc-Olivier Barre --
--- MarcO'Chapeau ----
-
www.marcochapeau.org -
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev(a)lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev(a)lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev