CGestalt.h File Reference

#include "CSL_Types.h"
#include <stdarg.h>
#include <string>

Go to the source code of this file.

Namespaces

namespace  csl

Classes

class  csl::CGestalt
class  csl::Model
class  csl::Observer

Defines

#define SAFE_MALLOC(ptr, type, len)
#define SAFE_FREE(ptr)

Typedefs

typedef std::vector< Observer * > csl::ObserverVector
 Forward declaration.

Enumerations

enum  csl::LogLevel { csl::kLogInfo, csl::kLogWarning, csl::kLogError, csl::kLogFatal }

Functions

void csl::logMsg (char *format,...)
 default is kLogInfo severity
void csl::logMsg (LogLevel level, char *format,...)
void csl::logLine ()
 Log the file & line #.
void csl::logURL ()
 log file/line as a URL
void csl::vlogMsg (char *format, va_list args)
void csl::vlogMsg (LogLevel level, char *format, va_list args)
bool csl::sleepUsec (float dur)
 sleep for dur usec, msec or sec
bool csl::sleepMsec (float dur)
bool csl::sleepSec (float dur)
Timestamp csl::timeNow ()
 high-accuracy system or IO time in ticks
float csl::fTimeNow ()
 system or IO time in seconds
float csl::fRandZ (void)
 A variety of useful random-number functions 0 - 1 (name: zero).
float csl::fRand1 (void)
 -1 - 1 (one)
float csl::fRandV (float val)
 0 - v (val)
float csl::fRandM (float minV, float maxV)
 min - max (min/max)
float csl::fRandR (float base, float range)
 b +- (r * b) (range)
float csl::fRandB (float base, float range)
 b +- r (base)
int csl::iRandV (int val)
 Integer rands 0 - v (val).
int csl::iRandM (int minV, int maxV)
 min - max (min/max)
int csl::iRandB (int base, int range)
 b +- r (base)
bool csl::coin ()
 Answer true or false.
bool csl::coin (float bias)
 Answer with a bias (1 --> always true).
float csl::keyToFreq (unsigned midiKey)
 keyToFreq -- converts from MIDI key numbers (1 - 127) to frequency in Hz.
unsigned csl::freqToKey (float frequency)
 freqToKey -- converts from frequency in Hz to MIDI key #


Define Documentation

#define SAFE_MALLOC ptr,
type,
len   ) 
 

Value:

ptr = new type[len];                                \
    if ((char *) ptr == NULL)                           \
        throw MemoryError("can't allocate buffer");     \
    memset(ptr, 0, len * sizeof(ptr))
safe malloc using new operator; zeroes memory after testing pointer used like: SAFE_MALLOC(mSampleBuffer, sample, mWindowSize);

#define SAFE_FREE ptr   ) 
 

Value:

if (ptr)                                            \
        delete[] ptr


Generated on Sat Oct 17 14:12:32 2009 for CSL by  doxygen 1.4.5-20051010