Re: [LAD] [RFC] LADSPA 1.2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Stefano D'Angelo <zanga.mail@...>
Cc: <linux-audio-dev@...>
Date: Friday, June 19, 2009 - 1:33 pm

Stefano D'Angelo wrote:

> I do totally agree, and in fact what I was suggesting looks like:

We are talking about two different things here.

You've described an API to return specific, named points within a range.
Kind of tick marks on a slider, with associated labels. So that you can
have a slider that has "cold" at zero value, "cool" at 25% and "hot" at
100%. Is that right? The same API could also be used for returning
values and descriptions for enum ports (but not continuous ports, as it
would require about 2^32 port labels :) ).

On the other hand, I'm talking about a basic custom float-to-string
function. Something I could implement so that cutoff frequency for my
plugin could be formatted as "%0.0f Hz", while the delay time could be
formatted as "%0.2fms" for small values and "%0.0fms" for large values.
Also, I could use it to format 0 as "Lowpass", 1 as "Highpass", etc., in
an integer port that I use for filter type. Which I could, also, mark as
"this is enum" with a sort of new hint we were talking about previously.

So far, I've seen more uses for formatting continuous values (a little
label next to a knob) than providing tick marks for continuous values.
However, there's a relatively simple solution to have both:

// this gives us text-to-string for arbitrary floats (side effect of
which is being able to implement enums)
const char *ladspa_format_value(LADSPA_Descriptor *descriptor, int port,
float value);
// this tells us which float values have "interesting" meaning
void ladspa_get_scalepoints(LADSPA_Descriptor *descriptor, int port, /*
[out] */ float **values, /* [out] */ int *values_count);

It may seem *very slightly* less efficient, but that should be OK, as
it's a microseconds-range difference in non-RT code.

For "normal" enums and custom-rendered parameters you'd only need the
first function anyway.

For completeness (I'm probably starting a flamewar here) we might also
have a reverse function, like:

float ladspa_parse_value(LADSPA_Descriptor *descriptor, int port, const
char *value, const char **error);

which would allow to convert user-entered values (like delay times in
seconds, milliseconds, centuries, Hertz etc. - or frequency ratios in
cents, semitones, octaves...) to a float value expected by given port,
optionally returning an error message if the text value is illegal.

Krzysztof
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] [RFC] LADSPA 1.2, Jörn Nettingsmeier, (Thu Jun 18, 4:28 pm)
Re: [LAD] [RFC] LADSPA 1.2, Pau , (Sat Jun 20, 12:07 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 5:48 pm)
Re: [LAD] [RFC] LADSPA 1.2, Tim Goetze, (Thu Jun 18, 6:53 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 8:22 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 8:57 pm)
Re: [LAD] [RFC] LADSPA 1.2, Tim Goetze, (Thu Jun 18, 9:17 pm)
Re: [LAD] [RFC] LADSPA 1.2, Arnold Krille, (Thu Jun 18, 9:24 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 9:43 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 9:23 pm)
Re: [LAD] [RFC] LADSPA 1.2, Damon Chaplin, (Thu Jun 18, 9:47 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 9:59 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Fri Jun 19, 8:20 am)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Fri Jun 19, 12:07 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Fri Jun 19, 12:35 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Fri Jun 19, 12:49 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Fri Jun 19, 1:33 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fraser, (Fri Jun 19, 4:53 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Fri Jun 19, 6:01 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fraser, (Sat Jun 20, 2:18 am)
Re: [LAD] [RFC] LADSPA 1.2, David Robillard, (Sat Jun 20, 12:14 am)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Fri Jun 19, 1:45 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Fri Jun 19, 2:15 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Fri Jun 19, 3:18 pm)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Thu Jun 18, 10:36 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 5:55 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 6:34 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 6:54 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 7:31 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 8:50 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 9:33 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 10:13 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 10:58 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 11:44 pm)
Re: [LAD] [RFC] LADSPA 1.2, Luis Garrido, (Thu Jun 18, 6:31 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 6:46 pm)
Re: [LAD] [RFC] LADSPA 1.2, Fons Adriaensen, (Thu Jun 18, 6:57 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 6:58 pm)
Re: [LAD] [RFC] LADSPA 1.2, Damon Chaplin, (Thu Jun 18, 8:39 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 8:52 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefano D'Angelo, (Thu Jun 18, 6:48 pm)
Re: [LAD] [RFC] LADSPA 1.2, Stefan Kost, (Tue Jun 23, 7:52 am)
Re: [LAD] [RFC] LADSPA 1.2, Krzysztof Foltman, (Tue Jun 23, 8:34 am)
Re: [LAD] [RFC] LADSPA 1.2, Jörn Nettingsmeier, (Thu Jun 18, 5:53 pm)