ascii graphs and errant messages

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ascii graphs and errant messages

Anthony Kozar
I've noticed in my MacOS forays that a few things still get printed directly
to stdout.  I'm not sure if this is what is intended or if they haven't yet
been changed.

Csound nicely reverts back to ascii graphs now on the Mac since I haven't
registered any callbacks yet.  But those routines use putchar and write
directly to stdout, bypassing the csoundMessage mechanism.  This caused a
problem at first on the Mac since both the Csound library and the host app
had their own copies of the console runtime (Macs have no inherent support
for ttys).  I ended up with two console output windows and had to "silence"
the library, which means that no graphs appear at all.

I've also noticed that the first two messages about localization and time
resolution do not seem to use csoundMessage either.

Not sure if any of this should be changed or not.  Thanks.

Anthony Kozar
[hidden email]
http://akozar.spymac.net/



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: ascii graphs and errant messages

Istvan Varga
Anthony Kozar wrote:

> Csound nicely reverts back to ascii graphs now on the Mac since I haven't
> registered any callbacks yet.  But those routines use putchar and write
> directly to stdout, bypassing the csoundMessage mechanism.

Not all code has been converted to use csoundMessage, and it takes a lot
of effort to hunt down all uses of printf(), putc(), fprintf(stderr, ...),
and others (not to mention that any function that uses csoundMessage needs
to take a csound instance pointer). However, winascii.c will be converted
eventually, too. Thanks for this report.

> I've also noticed that the first two messages about localization and time
> resolution do not seem to use csoundMessage either.

These messages are printed from global library initialization code that is
called only once, and an ENVIRON* pointer is not available there. Neither of
these two messages is particularly important, though, so losing them (due to
having a GUI that registers a message callback, and, having no console, stderr
is discarded by the OS) is not really an issue. If this causes problems on
MacOS, you can add #ifndef mac_classic to the fprintf(stderr, ...) statements
in Top/csound.c and Top/getstring.c.
Everywhere else, however, the API functions should (and eventually will) be used.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: ascii graphs and errant messages

Anthony Kozar
On 5/16/05 1:27 PM, Istvan Varga <[hidden email]> etched in stone:

> Not all code has been converted to use csoundMessage, and it takes a lot
> of effort to hunt down all uses of printf(), putc(), fprintf(stderr, ...),
> and others (not to mention that any function that uses csoundMessage needs
> to take a csound instance pointer). However, winascii.c will be converted
> eventually, too. Thanks for this report.

OK.  Once I get a little bit further on the Mac side of things here, I may
be able to start helping with some of the cross-platform "drudgery."

> Neither of
> these two messages is particularly important, though, so losing them (due to
> having a GUI that registers a message callback, and, having no console, stderr
> is discarded by the OS) is not really an issue.

That was my take on it.  It doesn't cause any problems with some adjustments
I made to how I compile the library.  The messages just disappear which is
fine.

Thanks again for the informative response, Istvan!

Anthony



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel