Csound API  6.18
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 void csoundSetMessageStringCallback (CSOUND *csound, void(*csoundMessageStrCallback)(CSOUND *csound, int attr, const char *str))
 Sets an alternative function to be called by Csound to print an informational message, using a less granular signature. 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

◆ csoundCreateMessageBuffer()

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.

◆ csoundDestroyMessageBuffer()

void PUBLIC csoundDestroyMessageBuffer ( CSOUND csound)

Releases all memory used by the message buffer.

◆ csoundGetFirstMessage()

PUBLIC const char* csoundGetFirstMessage ( CSOUND csound)

Returns the first message from the buffer.

◆ csoundGetFirstMessageAttr()

PUBLIC int csoundGetFirstMessageAttr ( CSOUND csound)

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

◆ csoundGetMessageCnt()

PUBLIC int csoundGetMessageCnt ( CSOUND csound)

Returns the number of pending messages in the buffer.

◆ csoundGetMessageLevel()

PUBLIC int csoundGetMessageLevel ( CSOUND )

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

◆ csoundMessage()

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

Displays an informational message.

◆ csoundMessageS()

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().

◆ csoundMessageV()

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

◆ csoundPopFirstMessage()

PUBLIC void csoundPopFirstMessage ( CSOUND csound)

Removes the first message from the buffer.

◆ csoundSetDefaultMessageCallback()

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

◆ csoundSetMessageCallback()

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.

This callback is never called on –realtime mode

◆ csoundSetMessageLevel()

PUBLIC void csoundSetMessageLevel ( CSOUND ,
int  messageLevel 
)

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

◆ csoundSetMessageStringCallback()

PUBLIC void csoundSetMessageStringCallback ( CSOUND csound,
void(*)(CSOUND *csound, int attr, const char *str)  csoundMessageStrCallback 
)

Sets an alternative function to be called by Csound to print an informational message, using a less granular signature.

This callback can be set for –realtime mode. This callback is cleared after csoundReset