Jamoma API  0.6.0.a19
TTViewer.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief An MVC viewer object.
6  *
7  * @details In the Max implementation this is a j.remote object.
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_VIEWER_H__
18 #define __TT_VIEWER_H__
19 
20 #include "TTModularIncludes.h"
21 
22 
23 class TTReceiver;
24 typedef TTReceiver* TTReceiverPtr;
25 
26 class TTSender;
27 typedef TTSender* TTSenderPtr;
28 
31 
32 class TTMODULAR_EXPORT TTViewer : public TTCallback
33 {
34  TTCLASS_SETUP(TTViewer)
35 
36 private:
37 
38  TTAddress mAddress; ///< ATTRIBUTE : data address to bind
39  TTSymbol mDescription; ///< ATTRIBUTE : text to describe the role of this data
40  TTSymbol mType; ///< ATTRIBUTE : type of the gui
41  TTSymbol mTags; ///< ATTRIBUTE : a tag for this viewer
42  TTBoolean mHighlight; ///< ATTRIBUTE : highlight state of the gui
43  TTBoolean mFreeze; ///< ATTRIBUTE : freeze data returning
44 
45  TTSymbol mDataspace; ///< ATTRIBUTE : The dataspace that this view uses (default is 'none')
46  TTSymbol mDataspaceUnit; ///< ATTRIBUTE : The unit within the dataspace.
47  TTObject mDataspaceConverter; ///< Performs conversions from data unit to the view unit
48  TTObject mDataspaceObserver; ///< Observes the data's dataspace attribute
49  TTObject mDataspaceUnitObserver; ///< Observes the data's unit attribute
50 
51  TTBoolean mActive; ///< ATTRIBUTE : if false, received data won't be output
52  TTValue mReturnedValue; ///< ATTRIBUTE : a local value to allow observation of this viewer
53 
54  TTObject mReceiver; ///< Binds to our data
55  TTObject mSender; ///< Binds to our data
56 
57  /** set the address */
58  TTErr setAddress(const TTValue& value);
59 
60  /** set the attribute */
61  TTErr setAttribute(const TTValue& value);
62 
63  /** set mActive */
64  TTErr setActive(const TTValue& value);
65 
66  /** set the highlight */
67  TTErr setHighlight(const TTValue& value);
68 
69  /** set the freeze */
70  TTErr setFreeze(const TTValue& value);
71 
72  /** Setter for mDataspaceUnit attribute. */
73  TTErr setDataspaceUnit(const TTValue& value);
74 
75  /** set the returnedValue */
76  TTErr setReturnedValue(const TTValue& value);
77 
78  /** */
79  TTErr Send(const TTValue& valueToSend, TTValue& outputValue);
80 
81  /** Ask the value and use the outputValue to return it.
82  This method is not relevant with address containing wildcards */
83  TTErr Grab(const TTValue& inputValue, TTValue& outputValue);
84 
85  friend TTErr TTMODULAR_EXPORT TTViewerReceiveAddressCallback(const TTValue& baton, const TTValue& data);
86  friend TTErr TTMODULAR_EXPORT TTViewerReceiveValueCallback(const TTValue& baton, const TTValue& data);
87  friend TTErr TTMODULAR_EXPORT TTViewerDataspaceCallback(const TTValue& baton, const TTValue& data);
88  friend TTErr TTMODULAR_EXPORT TTViewerDataspaceUnitCallback(const TTValue& baton, const TTValue& data);
89 };
90 
91 typedef TTViewer* TTViewerPtr;
92 
93 /**
94  @param baton ..
95  @param data ..
96  @return an error code */
97 TTErr TTMODULAR_EXPORT TTViewerReceiveAddressCallback(const TTValue& baton, const TTValue& data);
98 
99 /**
100  @param baton ..
101  @param data ..
102  @return an error code */
103 TTErr TTMODULAR_EXPORT TTViewerReceiveValueCallback(const TTValue& baton, const TTValue& data);
104 
105 /**
106  @param baton ..
107  @param data ..
108  @return an error code */
109 TTErr TTMODULAR_EXPORT TTViewerDataspaceCallback(const TTValue& baton, const TTValue& data);
110 
111 /**
112  @param baton ..
113  @param data ..
114  @return an error code */
115 TTErr TTMODULAR_EXPORT TTViewerDataspaceUnitCallback(const TTValue& baton, const TTValue& data);
116 
117 #endif // __TT_VIEWER_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTModular Library.
This class is used to be sensitive to any TTObject notifications and report them using a function wit...
Definition: TTCallback.h:28
TTReceiver ...
Definition: TTReceiver.h:27
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
TTErr TTMODULAR_EXPORT TTViewerReceiveValueCallback(const TTValue &baton, const TTValue &data)
Definition: TTViewer.cpp:325
TTErr TTMODULAR_EXPORT TTViewerDataspaceUnitCallback(const TTValue &baton, const TTValue &data)
Definition: TTViewer.cpp:377
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTErr TTMODULAR_EXPORT TTViewerReceiveAddressCallback(const TTValue &baton, const TTValue &data)
Definition: TTViewer.cpp:320
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
Handles TTApplication and #Protocol instances.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTErr TTMODULAR_EXPORT TTViewerDataspaceCallback(const TTValue &baton, const TTValue &data)
Definition: TTViewer.cpp:353
TTSender ...
Definition: TTSender.h:27
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34