Jamoma API  0.6.0.a19
TTGain.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspEffectsLib
4  *
5  * @brief #TTGain adjusts adio gain
6  *
7  * @authors Timothy Place, Trond Lossius
8  *
9  * @copyright Copyright © 2010, Timothy Place @n
10  * License: This code is licensed under the terms of the "New BSD License" @n
11  * http://creativecommons.org/licenses/BSD/
12  */
13 
14 
15 #ifndef __TT_GAIN_H__
16 #define __TT_GAIN_H__
17 
18 #include "TTDSP.h"
19 
20 
21 /** TTGain is an simple audio processor that adjusts the gain of an input audio signal.
22  */
23 class TTGain : public TTAudioObjectBase {
25 
26 private:
27 
28  TTFloat64 oldGain; ///< Temporarily stored old gain value, required for linear interpolation.
29 
30 protected:
31 
32  TTFloat64 mGain; ///< Linear gain to be applied to the input signal.
33 
34  TTBoolean mInterpolated; ///< Flag indicating whether interpolation will be applied when gain is changed.
35 
36 
37  /** A standard audio processing method as used by TTBlue objects.
38  @param inputs Pointer to array of input audio signals.
39  @param outputs Pointer to array of processaed audio signals.
40  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
41  */
43 
44 
45  /** Alternative audio processing method that might be used temporarily when gain value has been changed in order to interpolate linearly to the new gain value over one signal vector.
46  @param inputs Pointer to array of input audio signals.
47  @param outputs Pointer to array of processaed audio signals.
48  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
49  */
51 
52 
53  /** Set boolean attribute determining whether linear interpolation is applied or not.
54  @param newValue The new value that the interpolate attribute is to have.
55  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
56  */
57  TTErr setInterpolated(const TTValue& newValue);
58 
59 
60  /** Set the gain using dB units.
61  @param newValue The new gain value, expressed in dB units.
62  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
63  */
64  TTErr setGain(const TTValue& newValue);
65 
66 
67  /** Get current gain in dB units.
68  @param value Used to return the current gain value, expressed in dB units.
69  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
70  */
71  TTErr getGain(TTValue& value);
72 
73 
74  /** Set the gain using MIDI units.
75  @param newValue The new gain value, expressed in MIDI units.
76  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
77  */
78  TTErr setMidiGain(const TTValue& newValue);
79 
80 
81  /** Retreive current gain in MIDI units.
82  @param value Used to return the current gain vallue, expressed in MIDI units.
83  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
84  */
85  TTErr getMidiGain(TTValue& value);
86 
87 
88  /** Gain unit test.
89  @param returnedTestInfo The outcome from the performed unit test.
90  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
91  */
92  virtual TTErr test(TTValue& returnedTestInfo);
93 
94 };
95 
96 
97 #endif // __TT_GAIN_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTErr getMidiGain(TTValue &value)
Retreive current gain in MIDI units.
Definition: TTGain.cpp:69
TTBoolean mInterpolated
Flag indicating whether interpolation will be applied when gain is changed.
Definition: TTGain.h:34
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
virtual TTErr test(TTValue &returnedTestInfo)
Gain unit test.
Definition: TTGain.test.cpp:18
TTErr processAudioInterpolated(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Alternative audio processing method that might be used temporarily when gain value has been changed i...
Definition: TTGain.cpp:96
Jamoma DSP Library.
TTErr setMidiGain(const TTValue &newValue)
Set the gain using MIDI units.
Definition: TTGain.cpp:60
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
TTErr getGain(TTValue &value)
Get current gain in dB units.
Definition: TTGain.cpp:51
A simple container for an array of TTAudioSignal pointers.
TTGain is an simple audio processor that adjusts the gain of an input audio signal.
Definition: TTGain.h:23
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTErr setInterpolated(const TTValue &newValue)
Set boolean attribute determining whether linear interpolation is applied or not. ...
TTFloat64 mGain
Linear gain to be applied to the input signal.
Definition: TTGain.h:32
TTErr setGain(const TTValue &newValue)
Set the gain using dB units.
Definition: TTGain.cpp:42
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
Definition: TTGain.cpp:76
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34