[linux-audio-dev] LADSPA v1.1 Alternative Proposal

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] LADSPA v1.1 Alternative Proposal
From: Richard W.E. Furse (richard_AT_muse.demon.co.uk)
Date: Sun May 26 2002 - 15:52:40 EEST


After some more worry about the least untidy way to do defaults, I've come
up with the following, based on Paul's/Steve's scheme. I'm edging towards
this as preferable to my previous posting for LADSPA v1.1.

Please let me know how you think this compares with the previous
incarnation.

Some comments:
* I'll include a standard getDefault() function implementation in
      the SDK so host programmers don't have to work through the cases.
* The *_HIGH and *_LOW options are a bit complicated. We could ditch
them.
* This approach does NOT allow explicit defaults (e.g. 0.707). However
the
      previous approach only managed this by partly mucking up the structure
      that makes LADSPA simple. However, this default set does cover all the
      defaults I came up with for the CMT library when I went through it
      before, so I'm confident it's a good start point. I've left some slack
      too - there is room for another 6 default rules or values in the
future.
* This approach handles the LADSPA_HINT_SAMPLE_RATE neatly.

Here are the new diffs:

3,5c3,5
< Linux Audio Developer's Simple Plugin API Version 1.1[provisional,
< LGPL]. Copyright (C) 2000-2002 Richard W.E. Furse, Paul
< Barton-Davis, Stefan Westerfeld.

---
>    Linux Audio Developer's Simple Plugin API Version 1.0[LGPL].
>    Copyright (C) 2000-2001 Richard W.E. Furse, Paul Barton-Davis,
>    Stefan Westerfeld.
75,78c75
<    value although it may have a preferred range (see hints below).
<
<    For audio it is generally assumed that 1.0f is the `0dB' reference
<    amplitude and is a `normal' signal level. */
---
>    value although it may have a preferred range (see hints below). */
218,219c215
<    conjunction with any other hint except LADSPA_HINT_DEFAULT_0 or
<    LADSPA_HINT_DEFAULT_1. */
---
>    conjunction with any other hint. */
243,305d238
< /* The various LADSPA_HINT_HAS_DEFAULT_* hints indicate a `normal'
<    value for the port that is sensible as a default. For instance,
<    this value is suitable for use as an initial value in a user
<    interface or as a value the host might assign to a control port
<    when the user has not provided one. Defaults are encoded using a
<    mask so only one default may be specified for a port. Some of the
<    hints make use of lower and upper bounds, in which case the
<    relevant bound or bounds must be available and
<    LADSPA_HINT_SAMPLE_RATE must be applied as usual. The resulting
<    default must be rounded if LADSPA_HINT_INTEGER is present. Default
<    values were introduced in LADSPA v1.1. */
< #define LADSPA_HINT_DEFAULT_MASK    0x3C0
<
< /* This default hint indicates that no default is provided. */
< #define LADSPA_HINT_DEFAULT_NONE    0x0
<
< /* This default hint indicates that the suggested lower bound for the
<    port should be used. */
< #define LADSPA_HINT_DEFAULT_MINIMUM 0x40
<
< /* This default hint indicates that a low value between the suggested
<    lower and upper bounds should be chosen. For ports with
<    LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.75 +
<    log(upper) * 0.25). Otherwise, this should be (lower * 0.75 + upper
<    * 0.25). */
< #define LADSPA_HINT_DEFAULT_LOW     0x80
<
< /* This default hint indicates that a middle value between the
<    suggested lower and upper bounds should be chosen. For ports with
<    LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.5 +
<    log(upper) * 0.5). Otherwise, this should be (lower * 0.5 + upper *
<    0.5). */
< #define LADSPA_HINT_DEFAULT_MIDDLE  0xC0
<
< /* This default hint indicates that a high value between the suggested
<    lower and upper bounds should be chosen. For ports with
<    LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.25 +
<    log(upper) * 0.75). Otherwise, this should be (lower * 0.25 + upper
<    * 0.75). */
< #define LADSPA_HINT_DEFAULT_HIGH    0x100
<
< /* This default hint indicates that the suggested upper bound for the
<    port should be used. */
< #define LADSPA_HINT_DEFAULT_MAXIMUM 0x140
<
< /* This default hint indicates that the number 0 should be used. Note
<    that this default may be used in conjunction with
<    LADSPA_HINT_TOGGLED. */
< #define LADSPA_HINT_DEFAULT_0       0x200
<
< /* This default hint indicates that the number 1 should be used. Note
<    that this default may be used in conjunction with
<    LADSPA_HINT_TOGGLED. */
< #define LADSPA_HINT_DEFAULT_1       0x240
<
< /* This default hint indicates that the number 100 should be used. */
< #define LADSPA_HINT_DEFAULT_100     0x280
<
< /* This default hint indicates that the Hz frequency of `concert A'
<    should be used. This will be 440 unless the host uses an unusual
<    tuning convention, in which case it may be within a few Hz. */
< #define LADSPA_HINT_DEFAULT_440     0x2C0
<
312,331d244
<
< #define LADSPA_IS_HINT_HAS_DEFAULT(x)   ((x) & LADSPA_HINT_DEFAULT_MASK)
< #define LADSPA_IS_HINT_DEFAULT_MINIMUM  (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_MINIMUM)
< #define LADSPA_IS_HINT_DEFAULT_LOW      (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_LOW)
< #define LADSPA_IS_HINT_DEFAULT_MIDDLE   (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_MIDDLE)
< #define LADSPA_IS_HINT_DEFAULT_HIGH     (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_HIGH)
< #define LADSPA_IS_HINT_DEFAULT_MAXIMUM  (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_MAXIMUM)
< #define LADSPA_IS_HINT_DEFAULT_0        (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_0)
< #define LADSPA_IS_HINT_DEFAULT_1        (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_1)
< #define LADSPA_IS_HINT_DEFAULT_100      (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_100)
< #define LADSPA_IS_HINT_DEFAULT_440      (((x) & LADSPA_HINT_DEFAULT_MASK)
\
<                                          == LADSPA_HINT_DEFAULT_440)

--Richard


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sun May 26 2002 - 15:54:53 EEST