Jamoma API  0.6.0.a19
TTInputAudio.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief An audio input 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_INPUT_AUDIO_H__
17 #define __TT_INPUT_AUDIO_H__
18 
19 #include "TTInput.h"
20 
21 /** An audio input component for Jamoma models.
22  */
23 class TTMODULAR_EXPORT TTInputAudio : public TTInput
24 {
26 
27 public:
28  /** Called by the perform method in j.in~ to pass the samples in from the outside world
29  Will also be called by the Audiog Graph with j.in=
30 
31  @see allpass1~.model
32  */
33  void process(TTSampleValue* anInputSampleVector, TTSampleValue* anOutputSampleVector, TTUInt16 aVectorSize);
34 
35 
36  /** Used in e.g. allpass1~.model
37  Is it used by j.receive~ ???
38  */
40  {
41  return TTAudioSignalPtr(mSignalOut.instance())->mSampleVectors[0];
42  }
43 
44  /** Used e.g. by the dsp method in j.in~
45  */
46  void setupAudioSignals(TTUInt16 aVectorSize)
47  {
48  mSignalIn.set(kTTSym_numChannels, 1);
49  mSignalOut.set(kTTSym_numChannels, 1);
50  mSignalZero.set(kTTSym_numChannels, 1);
51 
52  mSignalIn.set(kTTSym_vectorSize, aVectorSize);
53  mSignalOut.set(kTTSym_vectorSize, aVectorSize);
54  mSignalZero.set(kTTSym_vectorSize, aVectorSize);
55 
56  mSignalOut.send(kTTSym_alloc);
57  mSignalZero.send(kTTSym_alloc);
58  mSignalZero.send(kTTSym_clear);
59  }
60 };
61 
63 
64 
65 #endif // __TT_INPUT_AUDIO_H__
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTSampleValue * getVector()
Used in e.g.
Definition: TTInputAudio.h:39
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
Handles any signal input.
void setupAudioSignals(TTUInt16 aVectorSize)
Used e.g.
Definition: TTInputAudio.h:46
TTFloat64 TTSampleValue
A value representing a single audio sample.
Definition: TTBase.h:230
An audio input component for Jamoma models.
Definition: TTInputAudio.h:23