[Stk] avoid stdout prints

Gary Scavone gary@ccrma.Stanford.EDU
Fri, 8 Oct 2004 13:09:57 -0400


Hi Norman,

In the latest version of STK, those messages are being "passed" through 
the handleError() function, which is defined in the Stk class.  The 
idea here was to allow the user to redefine the way messages are 
displayed by redefining that one function only.  There are various 
"error" message types and you can choose to do different things based 
on the type.  Unfortunately, most of those messages from WvOut are 
currently indicated as WARNINGs.  I created a new type for STATUS 
messages, but I didn't get around to making consistent use of that type 
where I should have (such as these cases in WvOut).  If I had done this 
correctly, you could then go into Stk.cpp and change the behavior so 
that "status" messages do not print unless in debug mode (or not at 
all).  I'll try to make that more consistent in the next release.

--gary

On Friday, October 8, 2004, at 01:05  AM, Norman Casagrande wrote:

>
> Hi all,
>
> I have been using STK for a while in my university project, and I like 
> its clean framework, but I have a small remark to give: why is there 
> no way to deactivate all the messages (printf) in WvOut? I am 
> generating a lot of wav files, and it is a little bit annoying to see 
> every time all these messages like:
>
> WvOut: creating WAV file: myFile_3433.wav
>
> I could redirect stdout but it is not clean, and I would be forced to 
> switch stream every time I need to print something.
> It would be very handy to have a flag, or a value we can set in the 
> constructor so that this output is on or off depending on the user's 
> need.
>
> Thanks in advance,
>
>
> Norman Casagrande
> LISA Labo
> Université de Montréal
>
> _______________________________________________
> Stk mailing list
> Stk@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk