![]() |
Cinder
0.9.1
|
#include <MonitorNode.h>
Inherits cinder::audio::MonitorNode.
Classes | |
struct | Format |
Public Types | |
enum | ChannelMode { ChannelMode::SPECIFIED, ChannelMode::MATCHES_INPUT, ChannelMode::MATCHES_OUTPUT } |
Public Member Functions | |
MonitorSpectralNode (const Format &format=Format()) | |
virtual | ~MonitorSpectralNode () |
const std::vector< float > & | getMagSpectrum () |
size_t | getNumBins () const |
size_t | getFftSize () const |
float | getFreqForBin (size_t bin) |
float | getSmoothingFactor () const |
void | setSmoothingFactor (float factor) |
const Buffer & | getBuffer () |
size_t | getWindowSize () const |
float | getVolume () |
float | getVolume (size_t channel) |
void | connect (const NodeRef &output) override |
void | connectInput (const NodeRef &input) override |
void | disconnectInput (const NodeRef &input) override |
void | disconnectOutput (const NodeRef &output) override |
void | disconnectAllOutputs () override |
void | enable () |
void | enable (double when) |
void | disable () |
void | disable (double when) |
void | setEnabled (bool b) |
void | setEnabled (bool b, double when) |
bool | isEnabled () const |
virtual void | disconnect (const NodeRef &output) |
virtual void | disconnectAll () |
virtual void | disconnectAllInputs () |
size_t | getNumConnectedInputs () const |
size_t | getNumConnectedOutputs () const |
bool | isConnectedToInput (const NodeRef &input) const |
bool | isConnectedToOutput (const NodeRef &output) const |
ContextRef | getContext () const |
size_t | getNumChannels () const |
ChannelMode | getChannelMode () const |
size_t | getMaxNumInputChannels () const |
size_t | getSampleRate () const |
size_t | getFramesPerBlock () const |
bool | isAutoEnabled () const |
void | setAutoEnabled (bool b=true) |
bool | isInitialized () const |
bool | getProcessesInPlace () const |
bool | canConnectToInput (const NodeRef &input) |
bool | checkCycle (const NodeRef &sourceNode, const NodeRef &destNode) const |
const std::set< NodeRef > & | getInputs () const |
std::vector< NodeRef > | getOutputs () const |
virtual std::string | getName () |
void | setName (const std::string &name) |
Buffer * | getInternalBuffer () |
const Buffer * | getInternalBuffer () const |
void | pullInputs (Buffer *inPlaceBuffer) |
Protected Member Functions | |
void | initialize () override |
void | process (Buffer *buffer) override |
void | fillCopiedBuffer () |
void | updatePullMethod () |
virtual void | uninitialize () |
virtual void | enableProcessing () |
virtual void | disableProcessing () |
virtual void | sumInputs () |
virtual bool | supportsInputNumChannels (size_t numChannels) const |
virtual bool | supportsCycles () const |
virtual bool | supportsProcessInPlace () const |
virtual void | configureConnections () |
void | setupProcessWithSumming () |
void | notifyConnectionsDidChange () |
bool | inputChannelsAreUnequal () const |
void | setNumChannels (size_t numChannels) |
void | setChannelMode (ChannelMode mode) |
const std::pair< size_t, size_t > & | getProcessFramesRange () const |
void | initializeImpl () |
void | uninitializeImpl () |
BufferDynamic * | getSummingBuffer () |
const BufferDynamic * | getSummingBuffer () const |
Protected Attributes | |
std::vector< dsp::RingBuffer > | mRingBuffers |
Buffer | mCopiedBuffer |
size_t | mWindowSize |
size_t | mRingBufferPaddingFactor |
bool | mIsPulledByContext |
A Scope that performs spectral (Fourier) analysis.
|
stronginherited |
Used to specifiy how the corresponding channels are to be resolved between two connected Node's, based on either a Node's input (the default), it's output, or specified by user.
Enumerator | |
---|---|
SPECIFIED |
Number of channels has been specified by user or is non-settable. |
MATCHES_INPUT |
This Node matches it's channels with it's input. |
MATCHES_OUTPUT |
This Node matches it's channels with it's output. |
|
virtual |
const std::vector< float > & cinder::audio::MonitorSpectralNode::getMagSpectrum | ( | ) |
Returns the magnitude spectrum of the currently sampled audio stream, suitable for consuming on the main UI thread.
size_t cinder::audio::MonitorSpectralNode::getNumBins | ( | ) | const |
Returns the number of frequency bins in the analyzed magnitude spectrum. Equivilant to fftSize / 2.
size_t cinder::audio::MonitorSpectralNode::getFftSize | ( | ) | const |
Returns the size of the FFT used for spectral analysis.
float cinder::audio::MonitorSpectralNode::getFreqForBin | ( | size_t | bin | ) |
Returns the corresponding frequency for bin. Computed as.
float cinder::audio::MonitorSpectralNode::getSmoothingFactor | ( | ) | const |
Returns the factor (0 - 1, default = 0.5) used when smoothing the magnitude spectrum between sequential calls to getMagSpectrum().
void cinder::audio::MonitorSpectralNode::setSmoothingFactor | ( | float | factor | ) |
Sets the factor (0 - 1, default = 0.5) used when smoothing the magnitude spectrum between sequential calls to getMagSpectrum()
|
overrideprotectedvirtual |
Called before audio buffers need to be used. There is always a valid Context at this point.
Reimplemented from cinder::audio::MonitorNode.
|
inherited |
Returns a filled Buffer of the sampled audio stream, suitable for consuming on the main UI thread.
|
inherited |
Returns the window size, which is the number of samples that are copied from the audio stream. Equivalent to:
.
|
inherited |
Compute the average (RMS) volume across all channels.
|
inherited |
Compute the average (RMS) volume across channel.
|
overrideprotectedvirtualinherited |
Override to perform audio processing on buffer.
Reimplemented from cinder::audio::Node.
|
protectedinherited |
Copies audio frames from the RingBuffer into mCopiedBuffer, which is suitable for operation on the main thread.
|
overridevirtualinherited |
Connects this Node to output.
Reimplemented from cinder::audio::Node.
|
overridevirtualinherited |
Reimplemented from cinder::audio::Node.
|
overridevirtualinherited |
Reimplemented from cinder::audio::Node.
|
overridevirtualinherited |
Overridden to remove from Context's auto-pulled list if there are no more outputs.
Reimplemented from cinder::audio::Node.
|
overridevirtualinherited |
Overridden to also remove from Context's auto-pulled list.
Reimplemented from cinder::audio::Node.
|
protectedinherited |
|
inherited |
Enables this Node for processing. Same as setEnabled( true )
.
|
inherited |
Enables this Node for processing at when seconds, measured against Context::getNumProcessedSeconds(). Same as setEnabled( true, when )
.
|
inherited |
Disables this Node for processing. Same as setEnabled( false )
.
|
inherited |
Disables this Node for processing at when seconds, measured against Context::getNumProcessedSeconds(). Same as setEnabled( false, when )
.
|
inherited |
Sets whether this Node is enabled for processing or not.
|
inherited |
Sets whether this Node is enabled for processing or not at when seconds, measured against Context::getNumProcessedSeconds().
|
inherited |
Returns whether this Node is enabled for processing or not.
|
virtualinherited |
Disconnects this Node from output.
|
virtualinherited |
Disconnects this Node from all inputs and outputs.
|
virtualinherited |
Disconnects all of this Node's inputs.
Reimplemented in cinder::audio::ChannelRouterNode.
|
inherited |
Returns the number of inputs connected to this Node.
|
inherited |
Returns the number of outputs this Node is connected to.
|
inherited |
Returns true if input is connected to this Node as an input, false otherwise.
|
inherited |
Returns true if output is connected to this Node as an output, false otherwise.
|
inherited |
|
inherited |
Returns the number of channels this Node will process.
|
inherited |
Returns the channel mode.
|
inherited |
Returns the maximum number of channels any input has.
|
inherited |
Returns the samplerate of this Node, which is governed by the Context's OutputNode.
|
inherited |
Returns the number of frames processed in one block by this Node, which is governed by the Context's OutputNode.
|
inherited |
Returns whether this Node is automatically enabled / disabled when connected.
|
inherited |
Sets whether this Node is automatically enabled / disabled when connected.
|
inherited |
Returns whether this Node is in an initialized state and is capable of processing audio.
|
inherited |
|
inherited |
|
inherited |
Returns 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.
|
inherited |
Returns an immutable reference to the inputs container.
|
inherited |
Returns 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.
|
virtualinherited |
Returns a string representing the name of this Node type. Default returns a demangled, compiler-specific class name.
|
inherited |
Sets this Node's name to a user-specified string.
|
inherited |
Usually used internally by a Node subclass, returns a pointer to the internal buffer storage.
|
inherited |
Usually used internally by a Node subclass, returns a pointer to the internal buffer storage.
|
inherited |
|
protectedvirtualinherited |
Called once the contents of initialize are no longer relevant, i.e. connections have changed.
Reimplemented in cinder::audio::FilePlayerNode, cinder::audio::cocoa::EffectAudioUnitNode, cinder::audio::cocoa::InputDeviceNodeAudioUnit, cinder::audio::cocoa::OutputDeviceNodeAudioUnit, and cinder::audio::FilterBiquadNode.
|
protectedvirtualinherited |
Callled when this Node should enable processing. Initiated from Node::enable().
Reimplemented in cinder::audio::FilePlayerNode, cinder::audio::BufferPlayerNode, cinder::audio::cocoa::InputDeviceNodeAudioUnit, and cinder::audio::cocoa::OutputDeviceNodeAudioUnit.
|
protectedvirtualinherited |
Callled when this Node should disable processing. Initiated from Node::disable().
Reimplemented in cinder::audio::FilePlayerNode, cinder::audio::cocoa::InputDeviceNodeAudioUnit, and cinder::audio::cocoa::OutputDeviceNodeAudioUnit.
|
protectedvirtualinherited |
Reimplemented in cinder::audio::ChannelRouterNode.
|
protectedvirtualinherited |
Default implementation returns true if numChannels matches our format.
Reimplemented in cinder::audio::ChannelRouterNode.
|
protectedvirtualinherited |
Default implementation returns false, return true if it makes sense for the Node to be processed in a cycle (eg. Delay).
Reimplemented in cinder::audio::DelayNode.
|
protectedvirtualinherited |
Default implementation returns true, subclasses should return false if they must process out-of-place (summing).
Reimplemented in cinder::audio::ChannelRouterNode, and cinder::audio::cocoa::OutputDeviceNodeAudioUnit.
|
protectedvirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Returns 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()]
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |