[linux-audio-dev] SWITCHED versus ENUMERATED (was: +momentary, consolidated (ladspa.h.diff))

Fons Adriaensen fons.adriaensen at skynet.be
Tue Mar 9 22:45:21 UTC 2004


On Tue, Mar 09, 2004 at 09:05:16PM +0100, Tim Goetze wrote:

> if you don't even see compactness as a virtue, there's only elegance
> remaining to recommend your proposal. elegance at the cost of
> increased complexity in understanding and implementation, no matter
> how you look at it.

It *is* compact, even if I didn't claim that as a virtue  :-)
The complexity consist of knowing that the label strings follow
the port names. The implementation requires very little code, as
I have shown. So I do not agree with these comments.
 
> you have yet to prove it's a different problem, and tell us what
> points need to be generalized beyond the solutions we have proposed.

It is different in the same way that C's switch() statement is different
from a series of if() tests on floating point values. Each has its own
sphere of application, and these do not really overlap. In the second
case for example, the value you test still has a meaning regardless of
the result of the test, and you should in general not test for equality.
The constants that a swicth() will test do not have to have any meaning
at all other than being an arbitrary number used to represent an option,
and are tested for strict equality.

As to generalisation, I already mentioned that additional fields could
be used to request a particular physical position of a scale point.

More generally, once a 'version' bit is introduced, you can in fact 
change whatever you want, and go much beyond what you proposed. In that
case all open questions should be reviewed and a structured and unified
solution should be proposed. 

-- 
Fons




More information about the Linux-audio-dev mailing list