Jamoma API  0.6.0.a19
TTOutputAudio.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief An audio output component for Jamoma models.
6  *
7  * @details
8  *
9  * @authors Timothy Place
10  *
11  * @copyright © 2013, 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 #ifndef __TT_OUTPUT_AUDIO_H__
17 #define __TT_OUTPUT_AUDIO_H__
18 
19 #include "TTOutput.h"
20 
21 /** An audio output component for Jamoma models.
22  */
23 class TTMODULAR_EXPORT TTOutputAudio : public TTOutput
24 {
26 
27 public: // use public for quick acces during signal processing
28 
29  // perform
30  void process(TTSampleValue* anInputSampleVector, TTSampleValue* anOutputSampleVector, TTUInt16 aVectorSize);
31 
32  // dsp
33  void setupAudioSignals(TTUInt16 aVectorSize, TTFloat64 aSampleRate)
34  {
35  mRampGainUnit.set(kTTSym_sampleRate, aSampleRate); // convert midi to db for tap_gain
36  mGainUnit.set("interpolated", 1);
37  mRampMixUnit.set(kTTSym_sampleRate, aSampleRate); // convert midi to db for tap_gain
38 
39  mSignalIn.set(kTTSym_numChannels, 1);
40  mSignalOut.set(kTTSym_numChannels, 1);
41  mSignalTemp.set(kTTSym_numChannels, 1);
42  mSignalZero.set(kTTSym_numChannels, 1);
43 
44  mSignalIn.set(kTTSym_vectorSize, aVectorSize);
45  mSignalOut.set(kTTSym_vectorSize, aVectorSize);
46  mSignalTemp.set(kTTSym_vectorSize, aVectorSize);
47  mSignalZero.set(kTTSym_vectorSize, aVectorSize);
48 
49  mSignalOut.send(kTTSym_alloc);
50  mSignalTemp.send(kTTSym_alloc);
51  mSignalZero.send(kTTSym_alloc);
52  mSignalZero.send(kTTSym_clear);
53  }
54 };
55 
57 
58 #endif // __TT_OUTPUT_AUDIO_H__
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
Handles any signal output.
An audio output component for Jamoma models.
Definition: TTOutputAudio.h:23
TTFloat64 TTSampleValue
A value representing a single audio sample.
Definition: TTBase.h:230