Subject: Re: [ecasound] (potential) last_float() / copp-get bug in C ECI
From: Kai Vehmanen (kai.vehmanen_AT_wakkanet.fi)
Date: Thu Sep 09 2004 - 23:08:12 EEST
Hello list,
On Tue, 7 Sep 2004, Adam Linson wrote:
> For the case in question, I was calling a copp-get, then a copp-select,
> then a last_float(), which wasn't returning the correct value. The easy
hmm, actually it _did_ return the correct value. Now...
> The theoretical problem is that since copp-select is supposed to lack a
> return value, the last_float() should (in this case) obtain the value
> from the last copp-get, even when a copp-select has been called in the
> meantime.
... the values returned by last_*() functions are always reseted when a
ECI new command is issued. In other words, last_float() only returns a
valid value if "last_type() == 'f'" holds true.
In ECI APIs for languages with dynamic typing (Python, Ruby and others),
this is more intuitive as you have only one last() function that returns
values of different types depending on the last command. In C this is a
bit more difficult. I could have used some macro-magic to imitate dynamic
typing, but this would have made porting to other languages more
difficult. Hopefully this makes sense.
-- http://www.eca.cx Audio software for Linux!
This archive was generated by hypermail 2b28 : Thu Sep 09 2004 - 23:07:21 EEST