Jamoma API  0.6.0.a19
TTOutput.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief Handles any signal output
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue
10  *
11  * @copyright © 2010, Théo de la Hogue @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 #ifndef __TT_OUTPUT_H__
18 #define __TT_OUTPUT_H__
19 
20 #include "TTModularIncludes.h"
21 #include "TTInput.h"
22 
23 /** TTOutput ... TODO : an explanation
24 
25  in Send method :
26  TODO : preview mecanism (it could be also used to register and notify meters...)
27 
28  */
29 
30 class TTInput;
31 typedef TTInput* TTInputPtr;
32 
33 class TTMODULAR_EXPORT TTOutput : public TTObjectBase
34 {
35  TTCLASS_SETUP(TTOutput)
36 
37 public: // use public for quick acces during signal processing
38 
39  TTSymbol mType; ///< ATTRIBUTE : (metadata) the type of signal output (like audio, video, ...)
40  TTAddress mInputAddress; ///< ATTRIBUTE : address of the input to which we are linked (if we are linked, otherwise empty address)
41 
42  TTBoolean mMute; ///< ATTRIBUTE : to mute signal output
43  TTFloat32 mMix; ///< ATTRIBUTE : to mix signal output and a signal coming from TTInput object
44  TTFloat32 mGain; ///< ATTRIBUTE : apply again on signal output
45  TTBoolean mFreeze; ///< ATTRIBUTE : to freeze signal output (ex : for video signal)
46 
47  TTObject mSignalIn; ///< any data structure to receive complex signal (in Max this comes from the model)
48  TTObject mSignalOut; ///< any data structure to send complex signal (going to the outlets of the model if we are in Max)
49  TTObject mSignalTemp; ///< a temporary signal used within the process method
50  TTObject mSignalZero; ///< a zero signal
51 
52  TTObject mMixUnit; ///< the unit used to mix the signal
53  TTObject mGainUnit; ///< the unit used to apply the gain value on the signal
54 
55  TTObject mRampMixUnit; ///< the unit used to ramp the mix value
56  TTObject mRampGainUnit; ///< the unit used to ramp the gain value
57 
58  TTObject mInputObject; ///< TTInput object to get a signal passing through
59 
60 protected:
61 
62  TTObject mReturnSignalCallback; ///< a way to return back signal to the owner of this output
63  TTValue mLast; ///< keep a copy of the last sent signal for each index -- for e.g. freezing
64  TTObject mAddressObserver; ///< to observe mInputAddress creation/destruction
65 
66  TTValue mSignal; ///< ATTRIBUTE : a hidden attribute to observe signal preview
67  TTAttributePtr mSignalAttr; ///< a direct access to the signal preview attribute to notify observers
68 
69 
70  /** Send signal */
71  TTErr Send(const TTValue& inputValue, TTValue& outputValue);
72  TTErr SendBypassed(const TTValue& inputValue, TTValue& outputValue);
73 
74  /** Set outputObject */
75  TTErr Link(const TTValue& inputValue, TTValue& outputValue);
76 
77  /** Remove outputObject */
78  TTErr Unlink();
79 
80  /** Set the outputAddress attribute */
81  TTErr setInputAddress(const TTValue& value);
82 
83  /** Set the mute attribute */
84  TTErr setMute(const TTValue& value);
85 
86  /** Set the mix attribute */
87  TTErr setMix(const TTValue& value);
88 
89  /** Set the gain attribute */
90  TTErr setGain(const TTValue& value);
91 
92  /** Set the mix attribute via a message (because, for Max, the configuration file tells to convert 'mix' into 'Mix') */
93  TTErr Mix(const TTValue& inputValue, TTValue& outputValue);
94 
95  /** Notify signal observer */
96  TTErr notifySignalObserver(const TTValue& value);
97 
98  friend TTErr TTMODULAR_EXPORT TTOutputDirectoryCallback(const TTValue& baton, const TTValue& data);
99 };
100 
101 typedef TTOutput* TTOutputPtr;
102 
103 /**
104  @param baton ..
105  @param data ..
106  @return an error code */
107 TTErr TTMODULAR_EXPORT TTOutputDirectoryCallback(const TTValue& baton, const TTValue& data);
108 
109 
110 #endif // __TT_OUTPUT_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTModular Library.
TTErr TTMODULAR_EXPORT TTOutputDirectoryCallback(const TTValue &baton, const TTValue &data)
Definition: TTOutput.cpp:226
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
Create and use Jamoma object instances.
Definition: TTObject.h:29
This class represents a single attribute, as used by the TTObjectBase class.
Definition: TTAttribute.h:79
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
float TTFloat32
32 bit floating point number
Definition: TTBase.h:187
Handles any signal input.
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