Jamoma API  0.6.0.a19
TTDSP.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspLibrary
4  *
5  * @brief Jamoma DSP Library
6  *
7  * @details
8  *
9  * @authors Tim Place, Trond Lossius
10  *
11  * @copyright Copyright © 2008 by Timothy Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #include "TTDSP.h"
18 
19 static bool TTDSPHasInitialized = false;
20 
22 
23 
24 
25 void TTDSPRegisterInternalClasses();
26 
27 
28 /****************************************************************************************************/
29 
30 void TTDSPInit(const char* pathToBinaries)
31 {
32  TTFoundationInit(pathToBinaries);
33 
34  if (!TTDSPHasInitialized) {
35  TTDSPHasInitialized = true;
36 
37  // TODO: someday implement these so that we have project-scoped caches and don't stuff everything into the foundation?
38  //TTDSPSymbolCacheInit();
39  //TTDSPValueCacheInit();
40 
41 #ifdef TT_DEBUG
42  TTLogMessage("JamomaDSP -- Version %s -- Debugging Enabled\n", TTDSP_VERSION_STRING);
43 #else
44  TTLogMessage("JamomaDSP -- Version %s\n", TTDSP_VERSION_STRING);
45 #endif
46  TTDSPRegisterInternalClasses();
47  }
48 }
49 
50 #ifdef TT_PLATFORM_LINUX
51 int main(void)
52 {
53  return 0;
54 }
55 #endif
56 
57 
58 /****************************************************************************************************/
59 
60 // Core
61 #include "TTAudioObjectArray.h"
62 #include "TTAudioSignal.h"
63 #include "TTBuffer.h"
64 #include "TTDCBlock.h"
65 #include "TTDelay.h"
66 #include "TTOperator.h"
67 #include "TTMixer.h"
68 #include "TTMultiMixer.h"
69 
70 
71 void TTDSPRegisterInternalClasses()
72 {
73  TTAudioObjectBaseArray::registerClass();
74  TTAudioSignal::registerClass();
75  TTAudioSignalArray::registerClass();
76  TTBuffer::registerClass();
77  TTDCBlock::registerClass();
78  TTDelay::registerClass();
79  TTOperator::registerClass();
80  TTMixer::registerClass();
81  TTMultiMixer::registerClass();
82  TTSampleMatrix::registerClass();
83 }
84 
85 
86 /****************************************************************************************************/
87 
88 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioObjectBasePtr* returnedObjectPtr, TTValue& arguments)
89 {
90  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, arguments);
91 }
92 
93 
94 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioSignalPtr* returnedObjectPtr, TTValue& arguments)
95 {
96  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, arguments);
97 }
98 
99 
100 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioObjectBasePtr* returnedObjectPtr, const TTValue& arguments)
101 {
102  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, arguments);
103 }
104 
105 
106 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioSignalPtr* returnedObjectPtr, const TTValue& arguments)
107 {
108  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, arguments);
109 }
110 
111 
112 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioObjectBasePtr* returnedObjectPtr, const TTUInt16 arguments)
113 {
114  TTValue v(arguments);
115  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, v);
116 }
117 
118 
119 TTErr TTObjectBaseInstantiate(const TTSymbol& className, TTAudioSignalPtr* returnedObjectPtr, const TTUInt16 arguments)
120 {
121  TTValue v(arguments);
122  return ttEnvironment->createInstance(className, (TTObjectBasePtr*)returnedObjectPtr, v);
123 }
124 
125 
126 
127 
129 {
131 }
132 
133 
135 {
137 }
138 
139 
140 
141 
143 {
144  if (*anObject)
145  return ttEnvironment->releaseInstance((TTObjectBasePtr*)anObject);
146  else
147  return kTTErrNone;
148 }
149 
150 
152 {
153  if (*anObject)
154  return ttEnvironment->releaseInstance((TTObjectBasePtr*)anObject);
155  else
156  return kTTErrNone;
157 }
158 
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTAudioObjectBasePtr TTObjectBaseReference(TTAudioObjectBasePtr anObject)
Create a reference to an object.
Definition: TTDSP.cpp:128
TTMixer is a Jamoma DSP Audio Mixer Object
TTFOUNDATION_EXPORT TTEnvironment * ttEnvironment
The environment object has one instance, which is global in scope.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTErr TTObjectBaseInstantiate(const TTSymbol &className, TTAudioObjectBasePtr *returnedObjectPtr, TTValue &arguments)
Instantiate an object.
Definition: TTDSP.cpp:88
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
Jamoma DSP Library.
Wrapper for an array of audio objects.
TTErr createInstance(const TTSymbol className, TTObjectBasePtr *anObject, const TTValue &anArgument)
Create a new instance of a registered TTObjectBase class.
const TTChannelCount kTTMaxChannelsPossible
The maximum number of audio channels that Jamoma DSP (and AudioGraph) is able to deal with...
Definition: TTDSP.cpp:21
TTErr releaseInstance(TTObjectBasePtr *anObject)
Release an instance of a TTObjectBase class.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr TTObjectBaseRelease(TTAudioObjectBasePtr *anObject)
Release (destroy) an object.
Definition: TTDSP.cpp:142
Basic audio delay unit with 4 interpolation options.
TTObjectBasePtr referenceInstance(TTObjectBasePtr anObject)
Create a reference to an object.
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
Represents M channels containing N vectors of audio samples.
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
Definition: TTAudioSignal.h:31
void TTDSPInit(const char *pathToBinaries)
Initialise the Jamoma DSP library, as well as Jamoma Foundation foundation if needed.
Definition: TTDSP.cpp:30
void TTFOUNDATION_EXPORT TTLogMessage(TTImmutableCString message,...)
Platform and host independent method for posting log messages.
Definition: TTBase.cpp:534
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
TTBuffer manages the check-in/out of TTSampleMatrix pointers.
DC Offset Filter and Blocker.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34