20 #ifndef __TT_BUFFER_H__
21 #define __TT_BUFFER_H__
51 TTErr prepareBecomingActiveMatrix();
52 TTErr promoteBecomingActiveMatrix();
66 return gTTBufferNameMap->
getKeys(returnedNames);
84 if (name == kTTSymEmpty)
88 err = gTTBufferNameMap->
lookup(name, returnedValue);
119 #define TTBUFFER_WRAP_1ARG(methodname) \
120 TTErr methodname (TTValue& arg1) { return mActiveMatrix -> methodname (arg1); }
121 #define TTBUFFER_WRAP_k1ARG(methodname) \
122 TTErr methodname (const TTValue& arg1) { return mActiveMatrix -> methodname (arg1); }
123 #define TTBUFFER_WRAP_WITHSPAWN_k1ARG(methodname) \
124 TTErr methodname (const TTValue& arg1) \
126 TTErr err = prepareBecomingActiveMatrix(); \
128 err = mBecomingActiveMatrix -> methodname (arg1); \
130 err = promoteBecomingActiveMatrix(); \
136 TTBUFFER_WRAP_WITHSPAWN_k1ARG( setNumChannels )
137 TTBUFFER_WRAP_1ARG( getNumChannels )
139 TTBUFFER_WRAP_WITHSPAWN_k1ARG( setLengthInSeconds )
140 TTBUFFER_WRAP_1ARG( getLengthInSeconds )
142 TTBUFFER_WRAP_WITHSPAWN_k1ARG( setLengthInSamples )
143 TTBUFFER_WRAP_1ARG( getLengthInSamples )
156 TTErr fill(
const TTValue& value, TTValue& unusedOutput)
158 TTErr err = prepareBecomingActiveMatrix();
160 err = mBecomingActiveMatrix -> fill (value,unusedOutput);
162 err = promoteBecomingActiveMatrix();
166 TTErr load(
const TTValue& value, TTValue& unusedOutput)
168 TTErr err = prepareBecomingActiveMatrix();
170 err = mBecomingActiveMatrix -> load (value,unusedOutput);
172 err = promoteBecomingActiveMatrix();
176 TTErr resizeThenLoad(
const TTValue& value, TTValue& unusedOutput)
178 TTErr err = prepareBecomingActiveMatrix();
180 err = mBecomingActiveMatrix -> resizeThenLoad(value, unusedOutput);
182 err = promoteBecomingActiveMatrix();
186 TTBUFFER_WRAP_k1ARG( normalize )
192 virtual
TTErr test(TTValue& returnedTestInfo);
201 TTAudioBuffer(
const TTValue& channelCount,
const TTValue& sampleCount):
202 TTObject(kTTSym_buffer, channelCount)
204 instance()->setLengthInSamples(sampleCount);
207 TTBufferPtr instance()
209 return (TTBufferPtr)mObjectInstance;
212 TTErr fill(
const TTValue &value)
215 return instance()->fill(value, unusedOuput);
218 TTErr load(
const TTValue &value)
221 return instance()->load(value, unusedOuput);
224 TTErr resizeThenLoad(
const TTValue &value)
226 TTValue unusedOutput;
227 return instance()->resizeThenLoad(value, unusedOutput);
232 return instance()->checkOutMatrix(startUsingThisMatrix);
237 return instance()->checkInMatrix(doneUsingThisMatrix);
242 #endif // __TT_BUFFER_H__
An inappropriate value was specified for an attribute or variable.
TTSampleMatrixPtr mBecomingActiveMatrix
pointer to TTSampleMatrix that is being prepared internally for a future checkOutMatrix() ...
TTErr lookup(const TTSymbol key, TTValue &value)
Find the value for the given key.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
Wrap TTBuffer instances for convenience.
Create and use Jamoma object instances.
TTSampleMatrix holds some audio in a chunk of memory.
TTErr getKeys(TTValue &hashKeys)
Get an array of all of the keys for the hash table.
TTBuffer manages the check-in/out of TTSampleMatrix pointers.
TTErr setAttributeValue(const TTSymbol name, TTValue &value)
Set an attribute value for an object.
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
static TTSymbol random()
Generate a pseudo-random symbol.
Container object that holds some audio in a chunk of memory.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
void * TTPtr
A generic pointer.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
TTErr append(const TTSymbol key, const TTValue &value)
Insert an item into the hash table.
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
TTSymbol mName
name associated with this buffer
[doxygenAppendixC_copyExample]
TTSampleMatrixPtr mActiveMatrix
pointer to TTSampleMatrix that will be returned via checkOutMatrix()