#include <ContextAudioUnit.h>
Inherits cinder::audio::Context.
cinder::audio::cocoa::ContextAudioUnit::~ContextAudioUnit |
( |
| ) |
|
|
virtual |
void cinder::audio::cocoa::ContextAudioUnit::setCurrentTimeStamp |
( |
const ::AudioTimeStamp * |
timeStamp | ) |
|
const ::AudioTimeStamp* cinder::audio::cocoa::ContextAudioUnit::getCurrentTimeStamp |
( |
| ) |
|
all other NodeAudioUnit's need to pass this correctly formatted timestamp to AudioUnitRender
Context * cinder::audio::Context::master |
( |
| ) |
|
|
staticinherited |
Returns the master Context that manages hardware I/O and real-time processing, which is platform specific. If none is available, returns null.
Returns the platform-specific DeviceManager singleton instance, which is platform specific. If none is available, returns null.
template<typename NodeT >
std::shared_ptr< NodeT > cinder::audio::Context::makeNode |
( |
NodeT * |
node | ) |
|
|
inherited |
Interface for creating new Node's of type NodeT, which is owned by this Context. All Node's must be created using the Context.
template<typename NodeT , typename... Args>
std::shared_ptr< NodeT > cinder::audio::Context::makeNode |
( |
Args &&... |
args | ) |
|
|
inherited |
Interface for creating a new Node of type NodeT, which is owned by this Context. All Node's must be created using the Context.
void cinder::audio::Context::setOutput |
( |
const OutputNodeRef & |
output | ) |
|
|
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.
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.
void cinder::audio::Context::enable |
( |
| ) |
|
|
virtualinherited |
void cinder::audio::Context::disable |
( |
| ) |
|
|
virtualinherited |
void cinder::audio::Context::setEnabled |
( |
bool |
enable | ) |
|
|
inherited |
start / stop audio processing via boolean
bool cinder::audio::Context::isEnabled |
( |
| ) |
const |
|
inherited |
Returns whether or not this Context is current enabled and processing audio.
virtual void cinder::audio::Context::connectionsDidChange |
( |
const NodeRef & |
node | ) |
|
|
virtualinherited |
Called by node when it's connections have changed, default implementation is empty.
size_t cinder::audio::Context::getSampleRate |
( |
| ) |
|
|
inherited |
size_t cinder::audio::Context::getFramesPerBlock |
( |
| ) |
|
|
inherited |
Returns the number of frames processed in one block by this Node, which is governed by the current OutputNode.
uint64_t cinder::audio::Context::getNumProcessedFrames |
( |
| ) |
const |
|
inherited |
Returns the total number of frames that have been processed in the dsp loop.
double cinder::audio::Context::getNumProcessedSeconds |
( |
| ) |
|
|
inherited |
Returns the total number of seconds that have been processed in the dsp loop.
void cinder::audio::Context::initializeNode |
( |
const NodeRef & |
node | ) |
|
|
inherited |
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.
void cinder::audio::Context::uninitializeNode |
( |
const NodeRef & |
node | ) |
|
|
inherited |
Un-initializes node, ensuring that Node::uninitialze() gets called.
void cinder::audio::Context::initializeAllNodes |
( |
| ) |
|
|
inherited |
void cinder::audio::Context::uninitializeAllNodes |
( |
| ) |
|
|
inherited |
void cinder::audio::Context::disconnectAllNodes |
( |
| ) |
|
|
virtualinherited |
void cinder::audio::Context::addAutoPulledNode |
( |
const NodeRef & |
node | ) |
|
|
inherited |
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.
- Note
- Callers on the non-audio thread must synchronize with getMutex().
void cinder::audio::Context::removeAutoPulledNode |
( |
const NodeRef & |
node | ) |
|
|
inherited |
Remove node from the list of auto-pulled nodes.
- Note
- Callers on the non-audio thread must synchronize with getMutex().
void cinder::audio::Context::schedule |
( |
double |
when, |
|
|
const NodeRef & |
node, |
|
|
bool |
enable, |
|
|
const std::function< void()> & |
func |
|
) |
| |
|
inherited |
Schedule node to be enabled or disabled with with func on the audio thread, to be called at when seconds measured against getNumProcessedSeconds(). node is owned until the scheduled event completes.
std::mutex& cinder::audio::Context::getMutex |
( |
| ) |
const |
|
inherited |
Returns the mutex used to synchronize the audio thread. This is also used internally by the Node class when making connections.
bool cinder::audio::Context::isAudioThread |
( |
| ) |
const |
|
inherited |
Returns true if the current thread is the thread used for audio processing, false otherwise.
void cinder::audio::Context::preProcess |
( |
| ) |
|
|
inherited |
OutputNode implementations should call this before each rendering block.
void cinder::audio::Context::postProcess |
( |
| ) |
|
|
inherited |
OutputNode implementations should call this after each rendering block.
string cinder::audio::Context::printGraphToString |
( |
| ) |
|
|
inherited |
Returns a string representation of the Node graph for debugging purposes.
The documentation for this class was generated from the following files: