Jamoma API  0.6.0.a19

Jamoma's lowest-level base class and related infrastructure. More...

#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <complex>
#include <sstream>
#include <iterator>
#include <stdexcept>
#include <cstdint>
#include <atomic>
#include <libkern/OSAtomic.h>
+ Include dependency graph for TTBase.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TTException
 A TTBlue exception is thown with this object. More...
 

Macros

#define TT_ALIGN_16   __attribute__((aligned (16)))
 Supress warnings about use of deprecated methods. More...
 

Typedefs

typedef bool TTBoolean
 Boolean flag, same as Boolean on the Mac.
 
typedef unsigned char TTByte
 Byte value.
 
typedef TTByteTTBytePtr
 Data is a pointer to some bytes.
 
typedef signed char TTInt8
 8 bit signed integer (char)
 
typedef unsigned char TTUInt8
 8 bit unsigned integer (char)
 
typedef std::int16_t TTInt16
 16 bit signed integer
 
typedef std::uint16_t TTUInt16
 16 bit unsigned integer
 
typedef std::int32_t TTInt32
 32 bit signed integer
 
typedef std::uint32_t TTUInt32
 32 bit unsigned integer
 
typedef std::int64_t TTInt64
 64 bit signed integer
 
typedef std::uint64_t TTUInt64
 64 bit unsigned integer
 
typedef float TTFloat32
 32 bit floating point number
 
typedef double TTFloat64
 64 bit floating point number
 
typedef std::complex< double > TTComplex
 Complex number.
 
typedef TTInt32 TTRowID
 Datatype for any number used to indicate a row index within a matrix. More...
 
typedef TTInt32 TTColumnID
 Datatype for any number used to indicate a column index within the matrix. More...
 
typedef TTInt16 TTElementID
 Datatype for any number used to indicate an element index within the matrix. More...
 
typedef TTFloat64 TTSampleValue
 A value representing a single audio sample. More...
 
typedef std::vector< TTSampleValueTTSampleVector
 A TTSampleVector is simply a pointer to the first of an array of TTSampleValues. More...
 
typedef long TTPtrSizedInt
 An integer that is the same size as a pointer. More...
 
typedef std::atomic< int32_t > TTAtomicInt
 An integer that can be used for atomic operations. More...
 
typedef void * TTPtr
 A generic pointer. More...
 
typedef void(* TTFunctionPtr) ()
 A simple/generic function pointer with no args. More...
 
typedef void(* TTFunctionWithArgPtr) (TTPtr)
 A simple/generic function pointer with one arg. More...
 
typedef void(* TTFunctionMatch) (const TTValue &valueToCheck, TTPtr baton, TTBoolean &found)
 Use for finding stuff in a list or a hash or a dictionary. More...
 
typedef TTErr(* TTFunctionWithBatonAndValue) (const TTValue &, const TTValue &)
 A simple/generic function pointer with a baton as TTValueRef and the value to send back as a TTValueRef. More...
 

Enumerations

enum  TTDataType { ,
  kTypeFloat32,
  kTypeFloat64,
  kTypeInt8,
  kTypeUInt8,
  kTypeInt16,
  kTypeUInt16,
  kTypeInt32,
  kTypeUInt32,
  kTypeInt64,
  kTypeUInt64,
  kTypeBoolean,
  kTypeSymbol,
  kTypeObject,
  kTypePointer,
  kTypeString,
  kTypeLocalValue,
  kTypeMatrix,
  kTypeDictionary,
  kTypeError
}
 TTBlue Data Types Enumeration of data types used through out TTBlue, including the TTValue class and declaring the types of TTAttribute objects. More...
 
enum  TTErr {
  kTTErrNone = 0,
  kTTErrGeneric,
  kTTErrAllocFailed,
  kTTErrFreeFailed,
  kTTErrInvalidType,
  kTTErrInvalidAttribute,
  kTTErrInvalidValue,
  kTTErrWrongNumValues,
  kTTErrMethodNotFound,
  kTTErrValueNotFound,
  kTTErrBadChannelConfig,
  kTTErrReadOnly,
  kTTErrOutOfBounds,
  kTTErrInstantiateFailed,
  kTTErrInvalidFilepath
}
 Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions and methods. More...
 

Functions

TTFloat64 TTGetTimeInMilliseconds ()
 Return the current system time in milliseconds. More...
 
TTFloat64 TTGetTimeInMicroseconds ()
 Return the current system time in microseconds. More...
 
TTFOUNDATION_EXPORT TTFloat64 TTRandom64 ()
 Produces a random-valued 64-bit floating-point number in the range [0.0, 1.0].
 
void TTFOUNDATION_EXPORT TTLogMessage (TTImmutableCString message,...)
 Platform and host independent method for posting log messages. More...
 
void TTFOUNDATION_EXPORT TTLogWarning (TTImmutableCString message,...)
 Platform and host independent method for posting warnings. More...
 
void TTFOUNDATION_EXPORT TTLogError (TTImmutableCString message,...)
 Platform and host independent method for posting errors. More...
 
void TTFOUNDATION_EXPORT TTLogDebug (TTImmutableCString message,...)
 Platform and host independent method for posting messages only when debugging is enabled in the environment. More...
 
TTPtr TTFOUNDATION_EXPORT TTMalloc16 (size_t numBytes)
 Allocate memory from the heap aligned to 16-byte boundaries. More...
 
void TTFOUNDATION_EXPORT TTFree16 (TTPtr ptr)
 Free memory allocated using TTMalloc16(). More...
 

Variables

TTFOUNDATION_EXPORT TTDataInfoPtr ttDataTypeInfo [kNumTTDataTypes]
 An array, indexed by values from TTDataType, containing information about those data types. More...
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupEqualPower []
 Equal Power lookup table, 512 elements.
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupSquareRoot []
 Square Root lookup table, 512 elements.
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupEqualPowerSymetric []
 Equal Power lookup table with 0.701 at element 256.
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupSquareRootSymetric []
 Square Root lookup table with 0.701 at element 256.
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupHalfPaddedwWelch []
 256 point window table (the first half of it)
 
TTFOUNDATION_EXPORT const TTFloat32 kTTLookupQuarterSine []
 Quarter Sine lookup table.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTPi
 [doxygenAppendixC_constExample] More...
 
TTFOUNDATION_EXPORT const TTFloat64 kTTHalfPi
 Pre-calculated value of pi/2.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTQuarterPi
 [doxygenAppendixC_constExample] More...
 
TTFOUNDATION_EXPORT const TTFloat64 kTTTwoPi
 Pre-calculated value of pi * 2.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTAntiDenormalValue
 Constant used by the ttantidenormal function.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTSqrt2
 Pre-calculated square-root of 2 (1.4142).
 
TTFOUNDATION_EXPORT const TTFloat64 kTTHalfSqrt2
 Pre-calculated value of sqrt(2)/2 (0.701).
 
TTFOUNDATION_EXPORT const TTFloat64 kTTTwoSqrt2
 Pre-calculated value of 2 * sqrt(2) (2.8284).
 
TTFOUNDATION_EXPORT const TTFloat64 kTTEpsilon
 A very very small value, used for float equality comaprisments.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTRadiansToDegrees
 Factor constant for converting radians to degrees.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTDegreesToRadians
 Factor constant for converting degrees to radians.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPower
 Power constant used when calculating MID gain.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPowerInv
 Invverse power constant used when calculating MID gain.
 
TTFOUNDATION_EXPORT const TTFloat64 kTTInv255
 Constant for color representation when converting from char8 to float representation.
 

Detailed Description

Jamoma's lowest-level base class and related infrastructure.

The Jamoma base class.

Author
Timothy Place, Trond Lossius, Nils Peters

Definition in file TTBase.h.

Macro Definition Documentation

#define TT_ALIGN_16   __attribute__((aligned (16)))

Supress warnings about use of deprecated methods.

This macro should be defined at the top of a file before any includes in order to be made active. In general, the use of this macro should be viewed with suspicion. If it used a comment should accompany its use to explain the special situation that warrants the usage.

Definition at line 157 of file TTBase.h.

Typedef Documentation

typedef std::atomic<int32_t> TTAtomicInt

An integer that can be used for atomic operations.

Definition at line 243 of file TTBase.h.

typedef void(* TTFunctionMatch) (const TTValue &valueToCheck, TTPtr baton, TTBoolean &found)

Use for finding stuff in a list or a hash or a dictionary.

Definition at line 262 of file TTBase.h.

typedef void(* TTFunctionPtr) ()

A simple/generic function pointer with no args.

Definition at line 252 of file TTBase.h.

typedef void(* TTFunctionWithArgPtr) (TTPtr)

A simple/generic function pointer with one arg.

Definition at line 255 of file TTBase.h.

typedef TTErr(* TTFunctionWithBatonAndValue) (const TTValue &, const TTValue &)

A simple/generic function pointer with a baton as TTValueRef and the value to send back as a TTValueRef.

Definition at line 361 of file TTBase.h.

typedef void* TTPtr

A generic pointer.

Definition at line 248 of file TTBase.h.

typedef long TTPtrSizedInt

An integer that is the same size as a pointer.

Definition at line 240 of file TTBase.h.

A value representing a single audio sample.

TTSampleValue should be used any place a sample value is what the value represents. This will enable us to change the type in the future if needed. For example, to use 64-bit floats.

Definition at line 230 of file TTBase.h.

typedef std::vector<TTSampleValue> TTSampleVector

A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.

Definition at line 233 of file TTBase.h.

Function Documentation

void TTFOUNDATION_EXPORT TTFree16 ( TTPtr  ptr)
TTFloat64 TTGetTimeInMicroseconds ( )
inline

Return the current system time in microseconds.

Definition at line 445 of file TTBase.h.

Referenced by TTDataObjectBase::calculate(), and TTAudioObjectBase::process().

TTFloat64 TTGetTimeInMilliseconds ( )
inline

Return the current system time in milliseconds.

Although it is a global kind of function, we include it as a method of TTBase so that it can be defined in the header file and then inlined in other libraries.

Definition at line 438 of file TTBase.h.

void TTFOUNDATION_EXPORT TTLogDebug ( TTImmutableCString  message,
  ... 
)

Platform and host independent method for posting messages only when debugging is enabled in the environment.

Parameters
messageThe message to post.

Definition at line 591 of file TTBase.cpp.

References TTEnvironment::mDebugBasic, and ttEnvironment.

Referenced by TTObjectBase::logDebug(), and TTEnvironment::registerClass().

void TTFOUNDATION_EXPORT TTLogError ( TTImmutableCString  message,
  ... 
)
void TTFOUNDATION_EXPORT TTLogMessage ( TTImmutableCString  message,
  ... 
)

Platform and host independent method for posting log messages.

Parameters
messageThe message to post.

Definition at line 534 of file TTBase.cpp.

Referenced by TTSymbolTable::dump(), TTObjectBase::logMessage(), TTEnvironment::referenceInstance(), TTEnvironment::releaseInstance(), TTSoundfilePlayer::setFilePath(), TTSoundfile::setFilePath(), TTUiInfo::setHighlight(), TTDSPInit(), and TTModularInit().

void TTFOUNDATION_EXPORT TTLogWarning ( TTImmutableCString  message,
  ... 
)

Platform and host independent method for posting warnings.

Parameters
messageThe message to post.

Definition at line 553 of file TTBase.cpp.

Referenced by TTObjectBase::logWarning(), and TTUiInfo::setHighlight().

Variable Documentation

TTFOUNDATION_EXPORT TTDataInfoPtr ttDataTypeInfo[kNumTTDataTypes]

An array, indexed by values from TTDataType, containing information about those data types.

Definition at line 424 of file TTBase.cpp.

Referenced by TTObjectBase::getAttributeType(), TTTrajectory::ramp(), TTAudioObjectBaseArray::set(), and TTMatrixBase::setTypeWithoutResize().