Jamoma API  0.6.0.a19
TTAudioObjectArray.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspLibrary
4  *
5  * @brief Wrapper for an array of audio objects
6  *
7  * @details
8  *
9  * @see TTAudioObjectBase
10  *
11  * @authors Tim Place, Nils Peters, Trond Lossius
12  *
13  * @copyright Copyright © 2011 by Timothy Place and Nils Peters @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 
19 #ifndef __TT_AUDIO_OBJECT_ARRAY_H__
20 #define __TT_AUDIO_OBJECT_ARRAY_H__
21 
22 #include "TTDSP.h"
23 #include "TTAudioObjectBase.h"
24 
25 typedef std::vector<TTAudioObjectBasePtr> TTAudioObjectBaseVector;
26 typedef TTAudioObjectBaseVector::iterator TTAudioObjectBaseIter;
27 
28 
29 /** TTAudioObjectBaseArray instantiates an array of TTAudioObjectBases, manages their life-cycles, and process audio through the array.
30  @details This permits the processing of an N-channel audio signal through N instances of a given class while using different attribute values for the
31  One application of such a structure is a graphic equalizer.
32  */
35 
36 protected:
37 
38  TTSymbol mClass; ///< The name of the object we will instantiate in the array
39  TTUInt16 mSize; ///< The number of instances in the array
40  TTAudioObjectBaseVector mInstances; ///< The actual vector containing object instance pointers
41  TTAudioSignalPtr mInputChannelSignal; ///< Signal used within the process method for passing to individual instances
42  TTAudioSignalPtr mOutputChannelSignal; ///< Signal used within the process method for passing to individual instances
43 
44  //// accessors /////
45 
46  /** Update the maximum number of channels that the array will be able to process.
47  @param oldMaxNumChannels
48  @param
49  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
50  */
51  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
52 
53 
54  /**
55  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
56  */
57  TTErr setSize(const TTValueRef newSize);
58 
59 
60  /**
61  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
62  */
63  TTErr setClass(const TTValueRef newClass);
64 
65  //// access the objects inside the array ///
66 
67  /**
68  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
69  */
70  TTErr set(TTValue& arguments, TTValue&);
71 
72 
73  /** Process audio.
74  @param inputs The incoming audio signals to be processed.
75  @param outputs The processed audio signals.
76  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
77  */
79 
80 
81  /** Unit test for the TTAudioObjectBaseArray.
82  @param returnedTestInfo The outcome from the performed unit test.
83  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
84  */
85  virtual TTErr test(TTValue& returnedTestInfo);
86 };
87 
88 
89 #endif // __TT_AUDIO_OBJECT_ARRAY_H__
90 
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTUInt16 mSize
The number of instances in the array.
TTSymbol mClass
The name of the object we will instantiate in the array.
TTAudioObjectBase is the Jamoma DSP Audio Object Base Class
TTAudioSignalPtr mInputChannelSignal
Signal used within the process method for passing to individual instances.
virtual TTErr test(TTValue &returnedTestInfo)
Unit test for the TTAudioObjectBaseArray.
Jamoma DSP Library.
TTErr setSize(const TTValueRef newSize)
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTAudioObjectBaseVector mInstances
The actual vector containing object instance pointers.
TTErr set(TTValue &arguments, TTValue &)
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process audio.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr updateMaxNumChannels(const TTValue &oldMaxNumChannels, TTValue &)
Update the maximum number of channels that the array will be able to process.
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
TTAudioObjectBaseArray instantiates an array of TTAudioObjectBases, manages their life-cycles...
TTErr setClass(const TTValueRef newClass)
A simple container for an array of TTAudioSignal pointers.
TTAudioSignalPtr mOutputChannelSignal
Signal used within the process method for passing to individual instances.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34