Csound API  6.07
Messages and Text

Functions

PUBLIC CS_PRINTF2 void csoundMessage (CSOUND *, const char *format,...)
 Displays an informational message. More...
 
PUBLIC CS_PRINTF3 void csoundMessageS (CSOUND *, int attr, const char *format,...)
 Print message with special attributes (see msg_attr.h for the list of available attributes). More...
 
PUBLIC void csoundMessageV (CSOUND *, int attr, const char *format, va_list args)
 
PUBLIC void csoundSetDefaultMessageCallback (void(*csoundMessageCallback_)(CSOUND *, int attr, const char *format, va_list valist))
 
PUBLIC void csoundSetMessageCallback (CSOUND *, void(*csoundMessageCallback_)(CSOUND *, int attr, const char *format, va_list valist))
 Sets a function to be called by Csound to print an informational message. More...
 
PUBLIC int csoundGetMessageLevel (CSOUND *)
 Returns the Csound message level (from 0 to 231). More...
 
PUBLIC void csoundSetMessageLevel (CSOUND *, int messageLevel)
 Sets the Csound message level (from 0 to 231). More...
 
PUBLIC void csoundCreateMessageBuffer (CSOUND *csound, int toStdOut)
 Creates a buffer for storing messages printed by Csound. More...
 
PUBLIC const char * csoundGetFirstMessage (CSOUND *csound)
 Returns the first message from the buffer. More...
 
PUBLIC int csoundGetFirstMessageAttr (CSOUND *csound)
 Returns the attribute parameter (see msg_attr.h) of the first message in the buffer. More...
 
PUBLIC void csoundPopFirstMessage (CSOUND *csound)
 Removes the first message from the buffer. More...
 
PUBLIC int csoundGetMessageCnt (CSOUND *csound)
 Returns the number of pending messages in the buffer. More...
 
void PUBLIC csoundDestroyMessageBuffer (CSOUND *csound)
 Releases all memory used by the message buffer. More...
 

Detailed Description

Function Documentation

PUBLIC void csoundCreateMessageBuffer ( CSOUND csound,
int  toStdOut 
)

Creates a buffer for storing messages printed by Csound.

Should be called after creating a Csound instance andthe buffer can be freed by calling csoundDestroyMessageBuffer() before deleting the Csound instance. You will generally want to call csoundCleanup() to make sure the last messages are flushed to the message buffer before destroying Csound. If 'toStdOut' is non-zero, the messages are also printed to stdout and stderr (depending on the type of the message), in addition to being stored in the buffer. Using the message buffer ties up the internal message callback, so csoundSetMessageCallback should not be called after creating the message buffer.

void PUBLIC csoundDestroyMessageBuffer ( CSOUND csound)

Releases all memory used by the message buffer.

PUBLIC const char* csoundGetFirstMessage ( CSOUND csound)

Returns the first message from the buffer.

PUBLIC int csoundGetFirstMessageAttr ( CSOUND csound)

Returns the attribute parameter (see msg_attr.h) of the first message in the buffer.

PUBLIC int csoundGetMessageCnt ( CSOUND csound)

Returns the number of pending messages in the buffer.

PUBLIC int csoundGetMessageLevel ( CSOUND )

Returns the Csound message level (from 0 to 231).

PUBLIC CS_PRINTF2 void csoundMessage ( CSOUND ,
const char *  format,
  ... 
)

Displays an informational message.

PUBLIC CS_PRINTF3 void csoundMessageS ( CSOUND ,
int  attr,
const char *  format,
  ... 
)

Print message with special attributes (see msg_attr.h for the list of available attributes).

With attr=0, csoundMessageS() is identical to csoundMessage().

PUBLIC void csoundMessageV ( CSOUND ,
int  attr,
const char *  format,
va_list  args 
)
PUBLIC void csoundPopFirstMessage ( CSOUND csound)

Removes the first message from the buffer.

PUBLIC void csoundSetDefaultMessageCallback ( void(*)(CSOUND *, int attr, const char *format, va_list valist)  csoundMessageCallback_)
PUBLIC void csoundSetMessageCallback ( CSOUND ,
void(*)(CSOUND *, int attr, const char *format, va_list valist)  csoundMessageCallback_ 
)

Sets a function to be called by Csound to print an informational message.

PUBLIC void csoundSetMessageLevel ( CSOUND ,
int  messageLevel 
)

Sets the Csound message level (from 0 to 231).