Jamoma API  0.6.0.a19

Various macros used in Jamoma. More...

+ Collaboration diagram for Macros:

Macros

#define TT_OBJECT_CONSTRUCTOR
 TODO Doxygen: need more comments here.
 
#define TT_BASE_OBJECT_CONSTRUCTOR
 TODO Doxygen: need more comments here.
 
#define TTCLASS_SETUP(className)
 TODO Doxygen: need more comments here.
 
#define INDEX_OF_COMPONENT_FIRSTBYTE(i, j)
 [doxygenAppendixC_macroExample] More...
 
#define INDEX_OF_ELEMENT_FIRSTBYTE(i, j, e)
 [doxygenAppendixC_macroExample] More...
 
#define addMessage(name)   registerMessage(#name, (TTMethod)& thisTTClass ::name , kTTMessagePassNone )
 A convenience macro to be used by subclasses for registering messages. More...
 
#define addMessageWithArguments(name)   registerMessage(#name, (TTMethod)& thisTTClass ::name )
 A convenience macro to be used by subclasses for registering messages. More...
 
#define addMessageProperty(messageName, propertyName, initialValue)   registerMessageProperty(#messageName, #propertyName, initialValue, (TTGetterMethod)& TTMessage::get##propertyName , (TTSetterMethod)& TTMessage::set##propertyName )
 A convenience macro to be used for registering properties of messages. More...
 
#define addUpdates(updateName)   addMessageWithArguments(update##updateName); addMessageProperty(update##updateName, hidden, YES);
 An 'update' is a message sent to a subclass instance from its parent class. More...
 
#define TTBASE(instance_, class_)   ((class_*)instance_.instance())
 Macro to access the actual C++ class that is contained inside of the TTObject as a pointer. More...
 
#define TT   TTSymbol
 This macro is defined as a shortcut for doing a lookup in the symbol table.
 
#define TT_AUDIO_CLASS_SETUP(strname, tags, className)
 A macro for setting up the class binding to the library in extension classes. More...
 

Detailed Description

Various macros used in Jamoma.

Macro Definition Documentation

#define addMessage (   name)    registerMessage(#name, (TTMethod)& thisTTClass ::name , kTTMessagePassNone )

A convenience macro to be used by subclasses for registering messages.

Parameters
nameThe name of the message, and also the name of the classes' method to be called.

Definition at line 19 of file TTMessage.h.

Referenced by TTAudioSignal::TTAudioSignal(), and TTProtocol::TTProtocol().

#define addMessageProperty (   messageName,
  propertyName,
  initialValue 
)    registerMessageProperty(#messageName, #propertyName, initialValue, (TTGetterMethod)& TTMessage::get##propertyName , (TTSetterMethod)& TTMessage::set##propertyName )

A convenience macro to be used for registering properties of messages.

This assumes that the property is one that has been explicitly supported by TTMessage through the definition of accessor methods. If you are adding a custom property then you must define your own accessor methods and register the property by calling the TTObjectBase::registerMessageProperty() method directly.

Definition at line 37 of file TTMessage.h.

Referenced by TTAudioSignal::TTAudioSignal().

#define addMessageWithArguments (   name)    registerMessage(#name, (TTMethod)& thisTTClass ::name )

A convenience macro to be used by subclasses for registering messages.

Parameters
nameThe name of the message, and also the name of the classes' method to be called.

Definition at line 27 of file TTMessage.h.

Referenced by TTAudioSignal::TTAudioSignal(), TTAudioUnit::TTAudioUnit(), TTEnvironment::TTEnvironment(), and TTProtocol::TTProtocol().

#define addUpdates (   updateName)    addMessageWithArguments(update##updateName); addMessageProperty(update##updateName, hidden, YES);

An 'update' is a message sent to a subclass instance from its parent class.

For example, to update the sample rate of the subclass when the parent's sample rate attribute has changed.

Definition at line 44 of file TTMessage.h.

Referenced by TTAudioUnit::TTAudioUnit().

#define INDEX_OF_COMPONENT_FIRSTBYTE (   i,
 
)
Value:
{ \
(i * mColumnCount + j) * mComponentStride \
}

[doxygenAppendixC_macroExample]

Internal macro used to locate the byte within mData where a specific component begins. This macro is used by both get and set routines to ensure that the formula for access is consistent. Allows our interface to be consistent in its lookup method and represents a specific application of the DRY principle.

Parameters
irow in matrix
jcolumn in matrix

Definition at line 246 of file TTMatrixBase.h.

Referenced by TTMatrixBase::get(), TTMatrixBase::get2d(), TTMatrixBase::set(), and TTMatrixBase::set2d().

#define INDEX_OF_ELEMENT_FIRSTBYTE (   i,
  j,
 
)
Value:
{ \
(i * mColumnCount + j) * mComponentStride + e * mTypeSizeInBytes \
}

[doxygenAppendixC_macroExample]

Internal macro used to locate the byte within mData where a specific element begins. This macro is used by both get and set routines to ensure that the formula for access is consistent. Allows our interface to be consistent in its lookup method and represents a specific application of the DRY principle.

Parameters
irow in matrix
jcolumn in matrix
eelement within component

Definition at line 262 of file TTMatrixBase.h.

Referenced by TTMatrixBase::get2d(), and TTMatrixBase::set2d().

#define TT_AUDIO_CLASS_SETUP (   strname,
  tags,
  className 
)
Value:
\
extern "C" TT_EXTENSION_EXPORT TTObjectBase* instantiate ## className (const TTSymbol&, TTValue& arguments); \
\
TTObjectBase* instantiate ## className (TTSymbol&, TTValue& arguments) \
{\
return new className (arguments);\
}\
\
extern "C" TT_EXTENSION_EXPORT TTErr TTLoadJamomaExtension_ ## className (void);\
TTErr TTLoadJamomaExtension_ ## className (void)\
{\
TTFoundationInit();\
TTClassRegister(strname, tags, & instantiate ## className);\
return kTTErrNone;\
}
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
No Error.
Definition: TTBase.h:343
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34

A macro for setting up the class binding to the library in extension classes.

Parameters
strnameA C-string that names the object as it should be listed in the environment.
tagsThe tags associated with the class.
classNameThe name of the class.

Definition at line 81 of file TTDSP.h.

#define TTBASE (   instance_,
  class_ 
)    ((class_*)instance_.instance())

Macro to access the actual C++ class that is contained inside of the TTObject as a pointer.

In general we want to avoid using casting to access C++ class member directly rather than through their dynamic interface, but there might be some exceptions. E.g., this macro is used in the DSP #TTFilterLib where we have a number of complex filters that are constructed of smaller building-block filters (examples are TTHalfband3, TTHalfband5, TTHalfband9, TTHilbert9, #TTHilbert33, TTMirror5 and TTMirrorBandpass10). The smaller building block filters are full citizen objects, but to call them through the usual calculate methods for each and every sample is incredibly inefficient when compared to using C++ calls that the compiler can inline.

Parameters
instance_The TTObject to peek inside.
class_The C++ class name represented by the TTObject.
Returns
Pointer to the C++ class contained inside of the TTObject.

Definition at line 211 of file TTObject.h.