2009/6/18 Fons Adriaensen <fons@email-addr-hidden>:
> On Thu, Jun 18, 2009 at 08:54:39PM +0200, Stefano D'Angelo wrote:
>
>> You would have to add the names in order of (port index, value),
>> starting from PortNames + PortCount... is this really so intuitive to
>> someone who occasionaly does C?
>
> Should someone who 'occasionaly does C' write a
> plugin host ? It's not going to end well, and
> that won't be because of what I propose.
Nope. I was only talking about the author of the plugin, not the host author.
> And in the plugin itself it's trivially easy.
... once you show him how to do (which could be added to the header
comments), but it could maybe easy for the unexperienced plugin
developer to make confusion?
> An example:
>
> static const char * const strings [] =
> {
> // Port names
> "In-L",
> "In-R",
> "Out-L",
> "Out-R",
>
> // Labels for the mono / stereo switch
> "Mono",
> "Stereo",
>
> // Labels for the reverb type selection
> "Concert hall",
> "Small church",
> "Vocal plate",
> "Bathroom"
> };
Now, suppose you wanted to add other kind of stuff in some future to
ports: if they are strings, you could do this thing once again (maybe,
maybe not), if they are not strings (e.g. units of measure as an
enum), how to do that with this same approach? Add as strings and ask
the host to perform the conversion? The more stuff in there, the more
likely it will get difficult to use/understand.
Plus, you can't change the name of the parameter (PortNames) in the
descriptor, without breaking API, which is weird.
>> I don't want to repeat nothing, I really don't care, and any solution
>> (even none) is fine with me. I was just making a suggestion and you,
>> as usual, are bashing people claiming they don't use their brain when
>> you disagree...
>
> Not because I disagree, and nothing personal.
> But if you read the code I posted, and the comments
> provided with it, and think about this for a second,
> you can't honestly say it's complicated. Anyone who
> can write C can grok this code and the intention
> behind it in no time.
He has to read this code, otherwise explaining it could create
confusion, and not everybody wants to read someone else's code.
>> you're becoming too Italian man (and here's an Italian
>> writing this mail).
>
> :-) Is it as hot where you are ?
I have a fan pushing air on my back all day :-P
Maybe the solution I posted here is a little bit cleaner and
future-proof... maybe!
Stefano
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Fri Jun 19 00:15:06 2009
This archive was generated by hypermail 2.1.8 : Fri Jun 19 2009 - 00:15:06 EEST