Jamoma API  0.6.0.a19
TTAudioGraphInput.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup audioGraphLibrary
4  *
5  * @brief Defines input interface at the top of an AudioGraph
6  *
7  * @details TTAudioGraphInput is an audio object functioning as a source at the top of the #TTAudioGraph graph, providing sound signals from an external audio input device to the graph for further downstream processing. In Jamoma AudioGraph audio processing is driven from a from a ‘terminal object’ or ‘sink’ at the bottom of the chain.
8  * Hence TTAudioGraphInput objects are not driving the audio graph processing, they simply provides audio signals for further downstream processing
9  * For example sources may provide audio input tio the graph from the hosting environment, read sound frok disk or be used for sound synthesis.
10  * Sources may have other #TTAudioGraphObjects connected downstream, but can not be connected to further upstream TTAudioGraphObjects.
11  *
12  * @authors Timothy Place, Trond Lossius
13  *
14  * @copyright Copyright © 2010, Timothy Place @n
15  * This code is licensed under the terms of the "New BSD License" @n
16  * http://creativecommons.org/licenses/BSD/
17  */
18 
19 
20 #ifndef __TTAUDIOGRAPH_INPUT_H__
21 #define __TTAUDIOGRAPH_INPUT_H__
22 
23 #include "TTAudioGraph.h"
24 
25 
26 /******************************************************************************************/
27 
28 /** TTAudioGraphOutput is an audio object that serves as the destination and master for a TTAudioGraph graph.
29  */
30 class TTAUDIOGRAPH_EXPORT TTAudioGraphInput : public TTAudioObjectBase
31 {
33 
34 public:
35  TTObjectBasePtr mAudioEngine; ///< Instance of TTAudioEngine class
36  TTAudioSignalPtr mBuffer; ///< An unused audio signal that we pass.
37 
38 
39  /** Start audio processing.
40  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
41  */
42  TTErr start();
43 
44 
45  /** Stop audio processing.
46  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
47  */
48  TTErr stop();
49 
50 
51  /** Get the name of available devices.
52  @param returnedDeviceNames An array of names of available devices.
53  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
54  */
55  TTErr getAvailableDeviceNames(const TTValue&, TTValue& returnedDeviceNames);
56 
57  // Attribute Accessors
58 
59  /** Set sample rate.
60  @param newValue The new sampe rate to be set.
61  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
62  */
63  TTErr setSampleRate(const TTValue& newValue);
64 
65 
66  /** Get sample rate.
67  @param returnedValue The current sample rate.
68  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
69  */
70  TTErr getSampleRate(TTValue& returnedValue);
71 
72 
73  /** Set the vector size for audio processing.
74  @param newValue The new vector size.
75  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
76  */
77  TTErr setVectorSize(const TTValue& newValue);
78 
79 
80  /** Get current vector size.
81  @param returnedValue The current vector size.
82  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
83  */
84  TTErr getVectorSize(TTValue& returnedValue);
85 
86 
87  /** Set what device to use for audio input.
88  @param newValue The input device to use.
89  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
90  */
91  TTErr setDevice(const TTValue& newValue);
92 
93 
94  /** Get current audio input device.
95  @param returnedValue The current audio input device.
96  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
97  */
98  TTErr getDevice(TTValue& returnedValue);
99 
100 
101  /** A standard audio processing method as used by Jamoma DSP objects.
102  @param outputs unused.
103  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
104  */
105  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
106 };
107 
108 
109 /** A pointer to #TTAudioGraphInput.
110  @ingroup typedefs
111  */
113 
114 
115 #endif // __TTAUDIOGRAPH_INPUT_H__
TTObjectBasePtr mAudioEngine
Instance of TTAudioEngine class.
TTAudioSignalPtr mBuffer
An unused audio signal that we pass.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
Registers classes for the primary AudioGraph library.
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
TTAudioGraphOutput is an audio object that serves as the destination and master for a TTAudioGraph gr...
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
TTAudioGraphInput * TTAudioGraphInputPtr
A pointer to TTAudioGraphInput.
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
TTErr setSampleRate(const TTUInt32 &newSampleRate)
Convenience method for updating the sample-rate.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34