Please consider my proposal for array extension of the LADSPA:

---- cut ----

/* This flag indicates that a port is an array of LADSPA_Data. The size 
of the array, which is the number of LADSPA_Data elements in the array, 
is stored in the index [-1] of the passing pointer. Further implication 
on how to interpret the data is provided in the hints. */

#define LADSPA_PORT_ARRAY    0x0100

/* The port is an array of LADSPA_Data representing an envelope in which 
each value is a parameter that directly applies to a sample or a set of 
samples. The size of this array is indicated in the index [-1] of the 
passing pointer. Using LADSPA_HINT_ARRAY_ENVELOPE implies a size such 
that ArraySize * n = SampleCount, where n is a positive integer. When 
LADSPA_HINT_ARRAY_ENVELOPE_INTERPOLATE is also specified and when an 
envelope applies to more than one samples, the plugin should do 
interpolation of these envelopes whenever possible. It is up to the 
plugin whether linear or second-order spine interpolation is to be 
performed.

Note: since the granule of an envelope defined here is really 
microscopic, it is only useful when the host calculates different sets 
of these micro-envelopes for each input buffer, so the plugin can be 
properly instructed in the right scale of time. */

#define LADSPA_HINT_ARRAY_ENVELOPE    0x0100
#define LADSPA_HINT_ARRAY_ENVELOPE_INTERPOLATE    0x0200

/* The port is an array of interleaved pairs of LADSPA_Data. The number 
of pairs is ArraySize / 2, so ArraySize has to be a multiple of 2. The 
array is then laid out as the following ordered set: { key0, data0, 
key1, data1, key2, data2, ... }. One useful example for this data 
structure is an equalizer parameter. */

#define LADSPA_HINT_ARRAY_PAIRS    0x0400

/* All the above array-exended hints can and should be used along with 
the other LADSPA_HINT_* flags. However, for LADSPA_HINT_ARRAY_PAIRS, it 
is defined that all original LADSPA hints apply only to the data. To 
make hints for the key, use the following hint flags instead. These 
flags are just the LADSPA_HINT_* flags shifted left by 16 bits. */

/* Note: this will void ladspa on 16-bit architectures. Do we want to do 
this? */

#define LADSPA_HINT_KEY_BOUNDED_BELOW    0x010000
#define LADSPA_HINT_KEY_BOUNDED_ABOVE    0x020000
#define LADSPA_HINT_KEY_TOGGLED    0x040000
#define LADSPA_HINT_KEY_SAMPLE_RATE    0x080000
#define LADSPA_HINT_KEY_LOGARITHMIC    0x100000
#define LADSPA_HINT_KEY_INTEGER    0x200000

/* When one makes use of the LADSPA_HINT_KEY_BOUNDED_BELOW or 
LADSPA_HINT_KEY_BOUNDED_ABOVE, you need to use an extended 
LADSPA_PortRangeHint structure defined as the following:

typedef struct _LADSPA_PortRangeHint {
  LADSPA_PortRangeHintDescriptor HintDescriptor;
  LADSPA_Data LowerBound;
  LADSPA_Data UpperBound;

  /* This is the extended part, note this should preserve binary compatibility. */

  LADSPA_Data KeyLowerBound;
  LADSPA_Data KeyUpperBound;

} LADSPA_PortRangeHint;


---- uncut ----

This is a morning of work, so please proof read for me if you find any 
errors.

Likai Liu


Reply via email to