Jamoma API  0.6.0.a19
TTModularIncludes.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief TTModular Library
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue
10  *
11  * @copyright Copyright © 2010, Théo de la Hogue @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #ifndef __TT_MODULAR_INCLUDES_H__
17 #define __TT_MODULAR_INCLUDES_H__
18 
19 #define TTMODULAR_VERSION_STRING "0.1"
20 #define TTMODULAR_XML_ENCODING "UTF-16"
21 
22 #ifdef TT_PLATFORM_WIN
23 #include "windows.h"
24  #ifdef TTMODULAR_EXPORTS
25  #define TTMODULAR_EXPORT __declspec(dllexport)
26  #else
27  #ifdef TTSTATIC
28  #define TTMODULAR_EXPORT
29  #else
30  #define TTMODULAR_EXPORT __declspec(dllimport)
31  #endif
32  #endif // _DLL_EXPORT
33 
34 #else // TT_PLATFORM_MAC
35  #ifdef TTMODULAR_EXPORTS
36  #define TTMODULAR_EXPORT __attribute__((visibility("default")))
37  #else
38  #define TTMODULAR_EXPORT
39  #endif
40 #endif
41 
42 #include <math.h>
43 
44 #include "TTFoundationAPI.h"
45 
46 #ifndef TT_NO_DSP
47 #include "TTDSP.h"
48 #endif
49 
50 #include "TTNode.h"
51 #include "TTNodeDirectory.h"
52 #include "TTAddressItem.h"
53 
54 #include "TTModular.h"
55 
56 #include "TTRegex.h"
57 
58 #include "TTProtocol.h"
59 #include "TTClock.h"
60 
61 #include "TTApplication.h"
62 #include "TTApplicationManager.h"
63 #include "TTContainer.h"
64 #include "TTCue.h"
65 #include "TTCueManager.h"
66 #include "TTData.h"
67 #include "TTExplorer.h"
68 #include "TTMapper.h"
69 #include "TTMapperManager.h"
70 #include "TTMirror.h"
71 #include "TTNodeInfo.h"
72 #include "TTPreset.h"
73 #include "TTPresetManager.h"
74 #include "TTRamp.h"
75 #include "TTReceiver.h"
76 #include "TTSender.h"
77 #include "TTScript.h"
78 #include "TTSubscriber.h"
79 #include "TTTextHandler.h"
80 #include "TTViewer.h"
81 #include "TTXmlHandler.h"
82 
83 #if 0
84 #pragma mark -
85 #pragma mark Macros for TTObject declaration
86 #endif
87 
88 #define TT_MODULAR_CONSTRUCTOR \
89 TTObjectBasePtr thisTTClass :: instantiate (TTSymbol name, TTValue arguments) {return new thisTTClass (arguments);} \
90 \
91 extern "C" void thisTTClass :: registerClass () {TTClassRegister( TTSymbol(thisTTClassName), thisTTClassTags, thisTTClass :: instantiate );} \
92 \
93 thisTTClass :: thisTTClass (const TTValue& arguments) : TTObjectBase(arguments)
94 
95 
96 
97 #define TT_MODULAR_CONSTRUCTOR_EXPORT \
98  \
99  extern "C" TT_EXTENSION_EXPORT TTErr loadTTExtension(void);\
100  TTErr loadTTExtension(void)\
101  {\
102  TTModularInit();\
103  thisTTClass :: registerClass(); \
104  return kTTErrNone;\
105  }\
106  \
107  TT_MODULAR_CONSTRUCTOR
108 
109 #if 0
110 #pragma mark -
111 #pragma mark Macros to ease applications and protocols access
112 #endif
113 
114 /** Access to an application by name */
115 #define accessApplication(applicationName) TTModularApplicationManager->findApplication(applicationName)
116 
117 /** Access to local application */
118 #define accessApplicationLocal TTModularApplicationManager->getApplicationLocal()
119 
120 /** Access to any application using an address */
121 #define accessApplicationFrom(anAddress) TTModularApplicationManager->findApplicationFrom(anAddress)
122 
123 /** Access to an application directory using an address */
124 #define accessApplicationDirectoryFrom(anAddress) TTModularApplicationManager->findApplicationDirectoryFrom(anAddress)
125 
126 /** Access to an application directory by name */
127 #define accessApplicationDirectory(applicationName) TTModularApplicationManager->findApplicationDirectory(applicationName)
128 
129 /** Access to the local application directory */
130 #define accessApplicationLocalDirectory TTModularApplicationManager->getApplicationLocal()->getDirectory()
131 
132 /** Access to the local application debug status */
133 #define accessApplicationLocalDebug TTModularApplicationManager->getApplicationLocal()->getDebug()
134 
135 /** Access to a protocol by name */
136 #define accessProtocol(protocolName) TTModularApplicationManager->findProtocol(protocolName)
137 
138 /** Access to all protocol names of an application */
139 #define accessApplicationProtocolNames(applicationName) TTModularApplicationManager->getApplicationProtocolNames(applicationName)
140 
141 #if 0
142 #pragma mark -
143 #pragma mark Macros to ease conversion
144 #endif
145 
146 /** Convert a TTValue with tt names inside into a value with local application names inside */
147 #define ToAppNames(ttNames, appNames) \
148  accessApplicationLocal->sendMessage(kTTSym_ConvertToAppName, ttNames, appNames); \
149 
150 /** Convert a TTValue with local application names inside into a value with tt names inside */
151 #define ToTTNames(appNames, ttNames) \
152  accessApplicationLocal->sendMessage(kTTSym_ConvertToTTName, appNames, ttNames); \
153 
154 /** Convert a local application TTSymbol into a tt name */
155 #define ToAppName(ttName) \
156  accessApplicationLocal->convertTTNameToAppName(ttName) \
157 
158 /** Convert a tt name TTSymbol into a local application name */
159 #define ToTTName(appName) \
160  accessApplicationLocal->convertAppNameToTTName(appName) \
161 
162 
163 #endif // __TT_MODULAR_INCLUDES_H__
A Container object.
TTObjectBase to handle text file reading and writing to be able to store / recall state of an object ...
A Data Object.
TTObjectBase to handle xml file reading and writing to be able to store / recall state of an object i...
A Receiver Object.
A Preset Object.
A MapperManager Object.
Handles application namespace using a TTNodeDirectory and two tables to convert any TTName into a spe...
TTRamp class embedes a scheduling mechanism from #TTDrive and a function from TTFunction ...
Jamoma DSP Library.
TTNodeInfo provides priority, tag and description for a node.
A Mapper Object.
A Protocol interface.
A CueManager Object.
A Cue Object.
An MVC viewer object.
A PresetManager Object.
A Namespace Explorer Object.
A Sender Object.
A Mirror Object.
A Clock interface.
Handles TTApplication and #Protocol instances.
References an object using a name, an instance and any contextual environnement information.
A Script Object.
A contextual subscriber to register TTObject as TTNode in a TTNodeDirectory.
the Modular Application Programming Interface