#include <ContextAudioUnit.h>
Public Member Functions | |
virtual | ~ContextAudioUnit () |
virtual OutputDeviceNodeRef | createOutputDeviceNode (const DeviceRef &device, const Node::Format &format=Node::Format()) override |
Creates and returns a platform-specific OutputDeviceNode, which delivers audio to the hardware output device specified by device. More... | |
virtual InputDeviceNodeRef | createInputDeviceNode (const DeviceRef &device, const Node::Format &format=Node::Format()) override |
Creates and returns a platform-specific InputDeviceNode, which captures audio from the hardware input device specified by device. More... | |
void | setCurrentTimeStamp (const ::AudioTimeStamp *timeStamp) |
set by the OutputNode More... | |
const ::AudioTimeStamp * | getCurrentTimeStamp () |
all other NodeAudioUnit's need to pass this correctly formatted timestamp to AudioUnitRender More... | |
template<typename NodeT > | |
std::shared_ptr< NodeT > | makeNode (NodeT *node) |
Interface for creating new Node's of type NodeT, which are thereafter owned by this Context. All Node's must be created using this method in order for them to correctly have a parent Context. More... | |
virtual void | setOutput (const OutputNodeRef &output) |
Sets the new output of this Context to output. You should do this before making any connections because when Node's are initialized they use the format of the OutputNode to configure their buffers. More... | |
virtual const OutputNodeRef & | getOutput () |
Returns the OutputNode for the Context (currently always an OutputDeviceNode that sends audio to your speakers). This can be thought of as the 'heartbeat', it is the one who initiates the pulling and processing of all other Node's in the audio graph. note If the output has not already been set, it is the default OutputDeviceNode. More... | |
std::mutex & | getMutex () const |
Returns the mutex used to synchronize the audio thread. This is also used internally by the Node class when making connections. More... | |
virtual void | enable () |
Enables audio processing. Effectively the same as calling getOutput()->enable() More... | |
virtual void | disable () |
Enables audio processing. Effectively the same as calling getOutput()->disable() More... | |
void | setEnabled (bool enable=true) |
start / stop audio processing via boolean More... | |
bool | isEnabled () const |
Returns whether or not this Context is current enabled and processing audio. More... | |
virtual void | connectionsDidChange (const NodeRef &node) |
Called by node when it's connections have changed, default implementation is empty. More... | |
size_t | getSampleRate () |
Returns the samplerate of this Context, which is governed by the current OutputNode. More... | |
size_t | getFramesPerBlock () |
Returns the number of frames processed in one block by this Node, which is governed by the current OutputNode. More... | |
uint64_t | getNumProcessedFrames () const |
Returns the total number of frames that have been processed in the dsp loop. More... | |
double | getNumProcessedSeconds () |
Returns the total number of seconds that have been processed in the dsp loop. More... | |
void | initializeNode (const NodeRef &node) |
Initializes node, ensuring that Node::initialze() gets called and that its internal buffers are ready for processing. Useful for initializing a heavy Node at an opportune time so as to not cause audio drop-outs or UI snags. More... | |
void | uninitializeNode (const NodeRef &node) |
Un-initializes node, ensuring that Node::uninitialze() gets called. More... | |
void | initializeAllNodes () |
Initialize all Node's related by this Context. More... | |
void | uninitializeAllNodes () |
Uninitialize all Node's related by this Context. More... | |
virtual void | disconnectAllNodes () |
Disconnect all Node's related by this Context. More... | |
void | addAutoPulledNode (const NodeRef &node) |
void | removeAutoPulledNode (const NodeRef &node) |
void | postProcess () |
OutputNode implmenentations should call this at the end of each rendering block. More... | |
std::string | printGraphToString () |
Returns a string representation of the Node graph for debugging purposes. More... | |
Static Public Member Functions | |
static Context * | master () |
Returns the master Context that manages hardware I/O and real-time processing, which is platform specific. If none is available, returns null. More... | |
static DeviceManager * | deviceManager () |
Returns the platform-specific DeviceManager singleton instance, which is platform specific. If none is available, returns null. More... | |
static void | setMaster (Context *masterContext, DeviceManager *deviceManager) |
Allows the user to set the master Context and DeviceManager, overriding the defaults. More... | |
|
virtual |
|
overridevirtual |
Creates and returns a platform-specific OutputDeviceNode, which delivers audio to the hardware output device specified by device.
Implements cinder::audio::Context.
|
overridevirtual |
Creates and returns a platform-specific InputDeviceNode, which captures audio from the hardware input device specified by device.
Implements cinder::audio::Context.
void cinder::audio::cocoa::ContextAudioUnit::setCurrentTimeStamp | ( | const ::AudioTimeStamp * | timeStamp | ) |
set by the OutputNode
const ::AudioTimeStamp* cinder::audio::cocoa::ContextAudioUnit::getCurrentTimeStamp | ( | ) |
all other NodeAudioUnit's need to pass this correctly formatted timestamp to AudioUnitRender
|
staticinherited |
Returns the master Context that manages hardware I/O and real-time processing, which is platform specific. If none is available, returns null.
|
staticinherited |
Returns the platform-specific DeviceManager singleton instance, which is platform specific. If none is available, returns null.
|
staticinherited |
Allows the user to set the master Context and DeviceManager, overriding the defaults.
|
inherited |
|
virtualinherited |
Sets the new output of this Context to output. You should do this before making any connections because when Node's are initialized they use the format of the OutputNode to configure their buffers.
|
virtualinherited |
Returns the OutputNode for the Context (currently always an OutputDeviceNode that sends audio to your speakers). This can be thought of as the 'heartbeat', it is the one who initiates the pulling and processing of all other Node's in the audio graph. note If the output has not already been set, it is the default OutputDeviceNode.
|
inherited |
Returns the mutex used to synchronize the audio thread. This is also used internally by the Node class when making connections.
|
virtualinherited |
Enables audio processing. Effectively the same as calling getOutput()->enable()
|
virtualinherited |
Enables audio processing. Effectively the same as calling getOutput()->disable()
|
inherited |
start / stop audio processing via boolean
|
inherited |
Returns whether or not this Context is current enabled and processing audio.
Called by node when it's connections have changed, default implementation is empty.
|
inherited |
Returns the samplerate of this Context, which is governed by the current OutputNode.
|
inherited |
Returns the number of frames processed in one block by this Node, which is governed by the current OutputNode.
|
inherited |
Returns the total number of frames that have been processed in the dsp loop.
|
inherited |
Returns the total number of seconds that have been processed in the dsp loop.
Initializes node, ensuring that Node::initialze() gets called and that its internal buffers are ready for processing. Useful for initializing a heavy Node at an opportune time so as to not cause audio drop-outs or UI snags.
Un-initializes node, ensuring that Node::uninitialze() gets called.
|
inherited |
|
inherited |
|
virtualinherited |
Add node to the list of auto-pulled nodes, who will have their Node::pullInputs() method called after a OutputDeviceNode implementation finishes pulling its inputs.
Remove node from the list of auto-pulled nodes.
|
inherited |
OutputNode implmenentations should call this at the end of each rendering block.
|
inherited |
Returns a string representation of the Node graph for debugging purposes.