octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portaudio tests


From: rik
Subject: Portaudio tests
Date: Sat, 02 May 2015 15:12:26 -0700

5/2/15

Mike,

I throught of one workaround for the situation that Orion described of
having built with the portaudio library, but not actually having a sound
card available.  Basically, test for a valid sound card in a %!shared
variable block at set a variable if a valid card was found.  And then at
the start of each %!test block you could check the variable and return
immediately if there was no support for the test.

Pseudo-code

%!shared no_sndcard
%! try
%!   # test to check whether sndcard is okay
%!   # maybe try to instantiate an instance of an audioplayer
%!   no_sndcard = false;
%! catch
%!   no_sndcard = true;
%! end_try_catch

%!testif HAVE_PORTAUDIO
%! if (no_sndcard)
%!   return;
%! endif
%! ... rest of test

It's too bad you can't code something like

no_sndcard && return;

but this seems to result in a parse error.  Although it does work for
functions, I think the fact that return is a keyword makes this disallowed.

--Rik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]