Csound and CsoundAC API 5.13
|
Abstraction layer for a minimal set of system services. More...
#include <System.hpp>
Public Types | |
enum | Level { ERROR_LEVEL = 1, WARNING_LEVEL = 2, INFORMATION_LEVEL = 4, DEBUGGING_LEVEL = 8 } |
Static Public Member Functions | |
static void | beep () |
Make some sort of noticeable sound. | |
static void | closeLibrary (void *library) |
Closes a shared library. | |
static void * | createThread (void(*threadRoutine)(void *threadData), void *data, int priority) |
Creates a new thread. | |
static void * | createThreadLock () |
Creates a thread lock. | |
static void | debug (CSOUND *csound, const char *format,...) |
Prints a message if the DEBUGGING_LEVEL flag is set. | |
static void | debug (const char *format,...) |
Prints a message if the DEBUGGING_LEVEL flag is set. | |
static void | destroyThreadLock (void *lock) |
Destroys a thread lock. | |
static void | error (CSOUND *csound, const char *format,...) |
Prints a message if the ERROR_LEVEL flag is set. | |
static void | error (const char *format,...) |
Prints a message if the ERROR_LEVEL flag is set. | |
static int | execute (const char *command) |
Execute a system command or program. | |
static std::vector< std::string > | getDirectoryNames (std::string directoryName) |
Lists directory names in a directory; useful for locating plugins. | |
static std::vector< std::string > | getFilenames (std::string directoryName) |
Lists filenames in a directory; useful for locating plugins. | |
static FILE * | getLogfile () |
Return the stream, if any, used for printing messages to. | |
static MessageCallbackType | getMessageCallback () |
Return the message callback, or null if none. | |
static int | getMessageLevel () |
Returns current system message level. | |
static std::string | getSharedLibraryExtension () |
Returns the standard filename extension for a shared library, such as "dll" or "so". | |
static void * | getSymbol (void *library, std::string name) |
Returns the address of a symbol (function or object) in a shared library; useful for loading plugin functions. | |
static void * | getUserdata () |
Returns userdata for message printing. | |
static void | inform (CSOUND *csound, const char *format,...) |
Prints a message if the INFORMATION_LEVEL flag is set. | |
static void | inform (const char *format,...) |
Prints a message if the INFORMATION_LEVEL flag is set. | |
static void | message (CSOUND *csound, int attribute, const char *format, va_list valist) |
Prints a message. | |
static void | message (CSOUND *csound, int level, const char *format,...) |
Prints a message. | |
static void | message (CSOUND *csound, const char *format,...) |
Prints a message. | |
static void | message (const char *format,...) |
Prints a message. | |
static void | message (CSOUND *csound, const char *format, va_list valist) |
Prints a message. | |
static PUBLIC void | message (const char *format, va_list valist) |
Prints a message. | |
static void | notifyThreadLock (void *lock) |
Releases a thread lock. | |
static int | openLibrary (void **library, std::string filename) |
Opens a shared library; useful for loading plugins. | |
static void | parsePathname (const std::string pathname, std::string &drive, std::string &base, std::string &file, std::string &extension) |
Parses a filename into its component parts, which are returned in the arguments. | |
static void | setLogfile (FILE *logfile) |
Set a stream for printing messages to (in addition to callback, stderr, etc.). | |
static void | setMessageCallback (MessageCallbackType messageCallback_) |
Sets message callback. | |
static int | setMessageLevel (int messageLevel) |
Sets message level, returns old message level. | |
static void | setUserdata (void *userdata) |
Sets userdata for message printing. | |
static int | shellOpen (const char *filename, const char *command="open") |
Open a file using the operating system shell. | |
static void | sleep (double milliseconds) |
Sleep the indicated number of milliseconds. | |
static clock_t | startTiming () |
Starts timing. | |
static double | stopTiming (clock_t startedAt) |
Stop timing, and return elapsed seonds. | |
static void | waitThreadLock (void *lock, size_t timeoutMilliseconds=0) |
Waits on a thread lock. | |
static void | warn (const char *format,...) |
Prints a message if the WARNNING_LEVEL flag is set. | |
static void | warn (CSOUND *csound, const char *format,...) |
Prints a message if the WARNNING_LEVEL flag is set. | |
static void | yieldThread () |
Yields to the next waiting thread. | |
Static Private Attributes | |
static FILE * | logfile |
static void(* | messageCallback )(CSOUND *csound, int attribute, const char *format, va_list valist) |
static int | messageLevel |
static void * | userdata_ |
Abstraction layer for a minimal set of system services.
static void csound::System::beep | ( | ) | [static] |
Make some sort of noticeable sound.
static void csound::System::closeLibrary | ( | void * | library | ) | [static] |
Closes a shared library.
static void* csound::System::createThread | ( | void(*)(void *threadData) | threadRoutine, |
void * | data, | ||
int | priority | ||
) | [static] |
Creates a new thread.
static void* csound::System::createThreadLock | ( | ) | [static] |
Creates a thread lock.
static void csound::System::debug | ( | CSOUND * | csound, |
const char * | format, | ||
... | |||
) | [static] |
Prints a message if the DEBUGGING_LEVEL flag is set.
static void csound::System::debug | ( | const char * | format, |
... | |||
) | [static] |
Prints a message if the DEBUGGING_LEVEL flag is set.
static void csound::System::destroyThreadLock | ( | void * | lock | ) | [static] |
Destroys a thread lock.
static void csound::System::error | ( | CSOUND * | csound, |
const char * | format, | ||
... | |||
) | [static] |
Prints a message if the ERROR_LEVEL flag is set.
static void csound::System::error | ( | const char * | format, |
... | |||
) | [static] |
Prints a message if the ERROR_LEVEL flag is set.
static int csound::System::execute | ( | const char * | command | ) | [static] |
Execute a system command or program.
static std::vector<std::string> csound::System::getDirectoryNames | ( | std::string | directoryName | ) | [static] |
Lists directory names in a directory; useful for locating plugins.
static std::vector<std::string> csound::System::getFilenames | ( | std::string | directoryName | ) | [static] |
Lists filenames in a directory; useful for locating plugins.
static FILE* csound::System::getLogfile | ( | ) | [static] |
Return the stream, if any, used for printing messages to.
static MessageCallbackType csound::System::getMessageCallback | ( | ) | [static] |
Return the message callback, or null if none.
static int csound::System::getMessageLevel | ( | ) | [static] |
Returns current system message level.
static std::string csound::System::getSharedLibraryExtension | ( | ) | [static] |
Returns the standard filename extension for a shared library, such as "dll" or "so".
static void* csound::System::getSymbol | ( | void * | library, |
std::string | name | ||
) | [static] |
Returns the address of a symbol (function or object) in a shared library; useful for loading plugin functions.
static void* csound::System::getUserdata | ( | ) | [static] |
Returns userdata for message printing.
static void csound::System::inform | ( | CSOUND * | csound, |
const char * | format, | ||
... | |||
) | [static] |
Prints a message if the INFORMATION_LEVEL flag is set.
static void csound::System::inform | ( | const char * | format, |
... | |||
) | [static] |
Prints a message if the INFORMATION_LEVEL flag is set.
static void csound::System::message | ( | CSOUND * | csound, |
int | attribute, | ||
const char * | format, | ||
va_list | valist | ||
) | [static] |
Prints a message.
static void csound::System::message | ( | CSOUND * | csound, |
int | level, | ||
const char * | format, | ||
... | |||
) | [static] |
Prints a message.
static void csound::System::message | ( | CSOUND * | csound, |
const char * | format, | ||
... | |||
) | [static] |
Prints a message.
static void csound::System::message | ( | const char * | format, |
... | |||
) | [static] |
Prints a message.
static void csound::System::message | ( | CSOUND * | csound, |
const char * | format, | ||
va_list | valist | ||
) | [static] |
Prints a message.
static PUBLIC void csound::System::message | ( | const char * | format, |
va_list | valist | ||
) | [static] |
Prints a message.
static void csound::System::notifyThreadLock | ( | void * | lock | ) | [static] |
Releases a thread lock.
static int csound::System::openLibrary | ( | void ** | library, |
std::string | filename | ||
) | [static] |
Opens a shared library; useful for loading plugins.
static void csound::System::parsePathname | ( | const std::string | pathname, |
std::string & | drive, | ||
std::string & | base, | ||
std::string & | file, | ||
std::string & | extension | ||
) | [static] |
Parses a filename into its component parts, which are returned in the arguments.
On Unix and Linux, "drive" is always empty.
static void csound::System::setLogfile | ( | FILE * | logfile | ) | [static] |
Set a stream for printing messages to (in addition to callback, stderr, etc.).
static void csound::System::setMessageCallback | ( | MessageCallbackType | messageCallback_ | ) | [static] |
Sets message callback.
static int csound::System::setMessageLevel | ( | int | messageLevel | ) | [static] |
Sets message level, returns old message level.
static void csound::System::setUserdata | ( | void * | userdata | ) | [static] |
Sets userdata for message printing.
static int csound::System::shellOpen | ( | const char * | filename, |
const char * | command = "open" |
||
) | [static] |
Open a file using the operating system shell.
static void csound::System::sleep | ( | double | milliseconds | ) | [static] |
Sleep the indicated number of milliseconds.
static clock_t csound::System::startTiming | ( | ) | [static] |
Starts timing.
static double csound::System::stopTiming | ( | clock_t | startedAt | ) | [static] |
Stop timing, and return elapsed seonds.
static void csound::System::waitThreadLock | ( | void * | lock, |
size_t | timeoutMilliseconds = 0 |
||
) | [static] |
Waits on a thread lock.
Zero timeout means infinite timeout.
static void csound::System::warn | ( | const char * | format, |
... | |||
) | [static] |
Prints a message if the WARNNING_LEVEL flag is set.
static void csound::System::warn | ( | CSOUND * | csound, |
const char * | format, | ||
... | |||
) | [static] |
Prints a message if the WARNNING_LEVEL flag is set.
static void csound::System::yieldThread | ( | ) | [static] |
Yields to the next waiting thread.
FILE* csound::System::logfile [static, private] |
void(* csound::System::messageCallback)(CSOUND *csound, int attribute, const char *format, va_list valist) [static, private] |
int csound::System::messageLevel [static, private] |
void* csound::System::userdata_ [static, private] |