Csound Csound-dev Csound-tekno Search About

[Cs-dev] ascii graphs and errant messages

Date2005-05-16 18:10
FromAnthony Kozar
Subject[Cs-dev] ascii graphs and errant messages
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
anthonykozar@sbcglobal.net
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
Csound-devel@lists.sourceforge.net

Date2005-05-16 18:27
FromIstvan Varga
SubjectRe: [Cs-dev] ascii graphs and errant messages
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
Csound-devel@lists.sourceforge.net

Date2005-05-16 19:04
FromAnthony Kozar
SubjectRe: [Cs-dev] ascii graphs and errant messages
On 5/16/05 1:27 PM, Istvan Varga  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
Csound-devel@lists.sourceforge.net