Base class for Node 's that consume an audio signal, for example speakers. It cannot have any outputs.
Enums
Public Member Functions
- 
~OutputNode ()
- 
size_tgetOutputSampleRate ()=0Returns the output samplerate, which governs the current context. 
- 
size_tgetOutputFramesPerBlock ()=0Returns the output frames per block, which governs the current context. 
- 
voidenableClipDetection (bool enable=true, float threshold=2)Enables clip detection, so that values over threshold will be interpreted as a clip (enabled by default). if a clip is detected, the internal buffer will be silenced in order to prevent speaker / ear damage. 
- 
boolisClipDetectionEnabled () constReturns whether clip detection is enabled or not. 
- 
uint64_tgetLastClip ()Returns the frame of the last buffer clip or 0 if none since the last time this method was called. 
- 
voidenable ()Enables this Node for processing. Same as setEnabled( true ).
- 
voidenable (double when)Enables this Node for processing at when seconds, measured against Context::getNumProcessedSeconds() . Same as setEnabled( true, when ).
- 
voiddisable ()Disables this Node for processing. Same as setEnabled( false ).
- 
voiddisable (double when)Disables this Node for processing at when seconds, measured against Context::getNumProcessedSeconds() . Same as setEnabled( false, when ).
- 
voidsetEnabled (bool b)Sets whether this Node is enabled for processing or not. 
- 
voidsetEnabled (bool b, double when)Sets whether this Node is enabled for processing or not at when seconds, measured against Context::getNumProcessedSeconds() . 
- 
boolisEnabled () constReturns whether this Node is enabled for processing or not. 
- 
voiddisconnect (const NodeRef &output)Disconnects this Node from output . 
- 
voiddisconnectAll ()Disconnects this Node from all inputs and outputs. 
- 
voiddisconnectAllOutputs ()Disconnects this Node from all outputs. 
- 
voiddisconnectAllInputs ()Disconnects all of this Node 's inputs. 
- 
size_tgetNumConnectedInputs () constReturns the number of inputs connected to this Node . 
- 
size_tgetNumConnectedOutputs () constReturns the number of outputs this Node is connected to. 
- 
boolisConnectedToInput (const NodeRef &input) constReturns true if input is connected to this Node as an input, false otherwise. 
- 
boolisConnectedToOutput (const NodeRef &output) constReturns true if output is connected to this Node as an output, false otherwise. 
- 
size_tgetNumChannels () constReturns the number of channels this Node will process. 
- 
getChannelMode () constReturns the channel mode. 
- See Also
- 
size_tgetMaxNumInputChannels () constReturns the maximum number of channels any input has. 
- 
size_tgetSampleRate () constReturns the samplerate of this Node , which is governed by the Context 's OutputNode . 
- 
size_tgetFramesPerBlock () constReturns the number of frames processed in one block by this Node , which is governed by the Context 's OutputNode . 
- 
boolisAutoEnabled () constReturns whether this Node is automatically enabled / disabled when connected. 
- 
voidsetAutoEnabled (bool b=true)Sets whether this Node is automatically enabled / disabled when connected. 
- 
boolisInitialized () constReturns whether this Node is in an initialized state and is capable of processing audio. 
- 
bool
- 
bool
- 
boolcheckCycle (const NodeRef &sourceNode, const NodeRef &destNode) constReturns true if there is an unmanageable cycle betweeen sourceNode and destNode . If any Node 's in the traversal returns true for supportsCycles() , this method will return false. 
- 
const std::set< NodeRef > &getInputs () constReturns an immutable reference to the inputs container. 
- 
std::vector< NodeRef >getOutputs () constReturns a copy of the NodeRef's referenced by the this Node as outputs. The copy is necessary because outputs are stored internally with weak_ptr's. 
- 
std::stringgetName () constReturns a string representing the name of this Node type. Default returns a demangled, compiler-specific class name. 
- 
voidsetName (const std::string &name)Sets this Node 's name to a user-specified string. 
- 
Buffer *getInternalBuffer ()Usually used internally by a Node subclass, returns a pointer to the internal buffer storage. 
- 
const Buffer *getInternalBuffer () constUsually used internally by a Node subclass, returns a pointer to the internal buffer storage. 
- 
void
Protected Member Functions
- 
OutputNode (const Format &format=Format())
- 
boolcheckNotClipping ()Implementations should call this to detect if the internal audio buffer is clipping. Always returns false if clip detection is disabled. 
- 
voidinitialize ()Called before audio buffers need to be used. There is always a valid Context at this point. Default implementation is empty. 
- 
voiduninitialize ()Called once the contents of initialize are no longer relevant, i.e. connections have changed. Default implementation is empty. Not guaranteed to be called at Node destruction. 
- 
voidenableProcessing ()Callled when this Node should enable processing. Initiated from Node::enable() . Default implementation is empty. 
- 
voiddisableProcessing ()Callled when this Node should disable processing. Initiated from Node::disable() . Default implementation is empty. 
- 
voidprocess (Buffer *buffer)Override to perform audio processing on buffer. Default implementation is empty. 
- 
voidsumInputs ()Override to customize how input Nodes are summed into the internal summing buffer. You usually don't need to do this. 
- 
boolsupportsInputNumChannels (size_t numChannels) constDefault implementation returns true if numChannels matches our format. 
- 
boolsupportsCycles () constDefault implementation returns false, return true if it makes sense for the Node to be processed in a cycle (eg. Delay). 
- 
boolsupportsProcessInPlace () constDefault implementation returns true, subclasses should return false if they must process out-of-place (summing). 
- 
voidconnectInput (const NodeRef &input)Connection methods be called on a non-audio thread and synchronized with the Context 's mutex. 
- 
voiddisconnectInput (const NodeRef &input)
- 
voiddisconnectOutput (const NodeRef &output)
- 
voidconfigureConnections ()
- 
voidsetupProcessWithSumming ()
- 
voidnotifyConnectionsDidChange ()
- 
boolinputChannelsAreUnequal () const
- 
void
- 
void
- 
const std::pair< size_t, size_t > &getProcessFramesRange () constReturns a pair of frame indices for Nodes that wish to support sample accurate enable and disable. The first index is where processing should start, the second is where it should end. Should only be called on the audio thread from within a Node 's process() method. Unless scheduled (with Context::schedule() ), this will be [0, getFramesPerBlock() ] 
- 
voidinitializeImpl ()
- 
voiduninitializeImpl ()
- 
getSummingBuffer ()
- 
const BufferDynamic *getSummingBuffer () const