Jamoma API  0.6.0.a19
PlugtasticInput.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup audioGraphPlugtastic
4  *
5  * @brief Manage input signals into Plugtastic
6  *
7  * @details
8  *
9  * @authors Timothy Place
10  *
11  * @copyright Copyright © 2010 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 "PlugtasticInput.h"
18 
19 #define thisTTClass PlugtasticInput
20 #define thisTTClassName "plugtastic.input"
21 #define thisTTClassTags "audio, input, plugtastic"
22 
23 
24 TT_AUDIO_CONSTRUCTOR,
25  mSidechain(NO)
26 {
27  addAttribute(Sidechain, kTypeBoolean);
28  setProcessMethod(processAudio);
29 }
30 
31 
32 PlugtasticInput::~PlugtasticInput()
33 {
34  ;
35 }
36 
37 
39 {
40  TTAudioSignal& in = inputs->getSignal(0);
41  TTAudioSignal& out = outputs->getSignal(0);
42  TTUInt16 vs;
43  TTSampleValue *inSample, *outSample;
45  TTChannelCount channel;
46 
47  for (channel=0; channel<numchannels; channel++) {
48  inSample = in.mSampleVectors[channel];
49  outSample = out.mSampleVectors[channel];
50  vs = in.getVectorSizeAsInt();
51 
52  while (vs--)
53  *outSample++ = (*inSample++);
54  }
55  return kTTErrNone;
56 }
57 
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
#define addAttribute(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom getter...
Definition: TTAttribute.h:29
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by Jamoma DSP objects.
Boolean (1/0) or (true/false) flag.
Definition: TTBase.h:281
Manage input signals into Plugtastic.
static TTChannelCount getMinChannelCount(const TTAudioSignal &signal1, const TTAudioSignal &signal2)
Use this class method to determine the least number of channels the two signals have in common...
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
TTSampleValue ** mSampleVectors
An array of pointers to the first sample in each vector. Declared Public for fast access...
Definition: TTAudioSignal.h:74
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
Definition: TTAudioSignal.h:31
A simple container for an array of TTAudioSignal pointers.
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
TTFloat64 TTSampleValue
A value representing a single audio sample.
Definition: TTBase.h:230