Csound  6.11
Functions
Messages and Text

Functions

PUBLIC CS_PRINTF2 void csoundMessage (CSOUND *, const char *format,...)
 
PUBLIC CS_PRINTF3 void csoundMessageS (CSOUND *, int attr, const char *format,...)
 
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))
 
PUBLIC void csoundSetMessageStringCallback (CSOUND *csound, void(*csoundMessageStrCallback)(CSOUND *csound, int attr, const char *str))
 
PUBLIC int csoundGetMessageLevel (CSOUND *)
 
PUBLIC void csoundSetMessageLevel (CSOUND *, int messageLevel)
 
PUBLIC void csoundCreateMessageBuffer (CSOUND *csound, int toStdOut)
 
PUBLIC const char * csoundGetFirstMessage (CSOUND *csound)
 
PUBLIC int csoundGetFirstMessageAttr (CSOUND *csound)
 
PUBLIC void csoundPopFirstMessage (CSOUND *csound)
 
PUBLIC int csoundGetMessageCnt (CSOUND *csound)
 
void PUBLIC csoundDestroyMessageBuffer (CSOUND *csound)
 

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