Node /

#includecinder/audio/Node.h

Fundamental building block for creating an audio processing graph.

Node 's allow for flexible combinations of synthesis, analysis, effects, file reading/writing, etc, and are designed so that that it is easy for users to add their own custom subclasses to a processing graph.

A Node is owned by a Context , and as such must by created using its makeNode() method, or one of the specializations for platform specific Node 's.

Audio Node 's are designed to operate on two different threads: a 'user' thread (i.e. main / UI) and an audio thread. Specifically, methods for connecting and disconnecting are expected to come from the 'user' thread, while the Node 's process() and internal pulling methods are called from a hard real-time thread. A mutex is used ( Context::getMutex() ) to synchronize connection changes and pulling the audio graph. Note that if the Node 's initialize() method is heavy, it can be called before connected to anything, so as to not block the audio graph. This must be done throught the Context::initializeNode() interface.

Subclassing: implement process( Buffer *buffer ) to perform audio processing. A Node does not have access to its owning Context until initialize() is called, uninitialize() is called before a Node is deallocated or channel counts change.

See Also

InputNode , OutputNode


Enums


Public Member Functions

  • Node (const Format &format)
  • ~Node ()

Protected Member Functions

  • void
    disconnectInput (const NodeRef &input)
  • void
    disconnectOutput (const NodeRef &output)
  • void
    configureConnections ()
  • void
    setupProcessWithSumming ()
  • void
    notifyConnectionsDidChange ()
  • bool
    inputChannelsAreUnequal () const
  • void
    initializeImpl ()
  • void
    uninitializeImpl ()
  • getSummingBuffer ()
  • getSummingBuffer () const

Friends