[linux-audio-dev] XAP: magic 'sys controls' vs normal controls
Tim Hockin
thockin at hockin.org
Mon Dec 23 22:03:01 UTC 2002
> (Speaking of which, I implemented a VVID manager for Audiality the
> other day. "Finished and tested", although I haven't integrated it
> yet.)
excellent - and the code is where? :)
> > * This is all designed to take away the extra fields that aren't
>
> How many fields can actually be eliminated? Can't be many bytes, and
> there aren't all that many of these controls. I can't see that it's
> worth any special casing to save a few fields per "magic control".
not many I realized - how does the below code look?
> There should be no special "MIDI compatible" controls at all, IMHO,
Well, we want MIDI compatible hinted controls to fall withing the -1 to 1 or
0-1 range, right? That is a bit more than a hint..
> in the way suggested by the Control hint names. We could have an
> official MIDI CC -> Control mapping, if desired, but no actual
> references to MIDI in the API.
Well, we're documenting things as MIDI-compatible hints, right? I.e.: use
this hint if you want a host to know it should connect MIDI velocity.
> Well, I still think the cleanest way would be to use the Control
> metadata stuff, giving the timeline controls datatype IDs of their
How's this look - like what you are thinking?
/*
* System controls are base-typed controls - they receive specific data via
* specific events. Plugins can use these controls to receive special
* messages from the host.
*/
#define XAP_DECL_CTRL_SYS(label, name, hints, flags, rtflags) { \
.type = XAP_CTRL_SYS, \
.label = label, \
.name = name, \
.hints = hints, \
.flags = flags, \
.rtflags = rtflags \
}
/*
* TEMPO (double : ticks/sec)
* - gets values [-inf, inf] via XAP_EV_TEMPO
* - hosts must send a TEMPO event at plugin init and when tempo changes
*/
#define XAP_TEMPO_CTRL(label, name) \
XAP_DECL_CTRL_SYS(label, name, XAP_CTRLHINT_TEMPO, 0, 0)
/*
* METER (double : ticks/measure)
* - gets values [1.0, inf] via XAP_EV_METER
* - hosts must send a METER event at plugin init and when meter changes
* - hosts should send a METER event periodically, such as every measure or
* once per second
*/
#define XAP_METER_CTRL(label, name) \
XAP_DECL_CTRL_SYS(label, name, XAP_CTRLHINT_METER, 0, 0)
<...etc...>
More information about the Linux-audio-dev
mailing list