66 bool operator== (
const NodeID& other)
const noexcept {
return uid == other.uid; }
67 bool operator!= (
const NodeID& other)
const noexcept {
return uid != other.uid; }
68 bool operator< (
const NodeID& other)
const noexcept {
return uid < other.uid; }
77 enum { midiChannelIndex = 0x1000 };
85 auto tie()
const {
return std::tie (nodeID, channelIndex); }
91 bool isMIDI()
const noexcept {
return channelIndex == midiChannelIndex; }
93 bool operator== (
const NodeAndChannel& other)
const noexcept {
return tie() == other.tie(); }
94 bool operator!= (
const NodeAndChannel& other)
const noexcept {
return tie() != other.tie(); }
95 bool operator< (
const NodeAndChannel& other)
const noexcept {
return tie() < other.tie(); }
127 if (processor !=
nullptr)
129 if (
auto* bypassParam = processor->getBypassParameter())
139 if (processor !=
nullptr)
141 if (
auto* bypassParam = processor->getBypassParameter())
142 bypassParam->setValueNotifyingHost (shouldBeBypassed ? 1.0f : 0.0f);
145 bypassed = shouldBeBypassed;
158 bool userRequestedBypass()
const {
return bypassed; }
165 : nodeID (n), processor (std::move (p))
167 jassert (processor !=
nullptr);
192 bool operator== (
const Connection&)
const noexcept;
193 bool operator!= (
const Connection&)
const noexcept;
194 bool operator< (
const Connection&)
const noexcept;
224 void clear (UpdateKind = UpdateKind::sync);
230 int getNumNodes() const noexcept {
return getNodes().
size(); }
242 Node* getNodeForId (NodeID)
const;
260 Node::Ptr removeNode (NodeID, UpdateKind = UpdateKind::sync);
265 Node::Ptr removeNode (Node*, UpdateKind = UpdateKind::sync);
271 bool isConnected (
const Connection&)
const noexcept;
276 bool isConnected (NodeID possibleSourceNodeID, NodeID possibleDestNodeID)
const noexcept;
281 bool isAnInputTo (
const Node& source,
const Node& destination)
const noexcept;
286 bool isAnInputTo (NodeID source, NodeID destination)
const noexcept;
289 bool canConnect (
const Connection&)
const;
296 bool addConnection (
const Connection&, UpdateKind = UpdateKind::sync);
299 bool removeConnection (
const Connection&, UpdateKind = UpdateKind::sync);
302 bool disconnectNode (NodeID, UpdateKind = UpdateKind::sync);
309 bool isConnectionLegal (
const Connection&)
const;
316 bool removeIllegalConnections (UpdateKind = UpdateKind::sync);
370 bool isInput() const noexcept;
372 bool isOutput() const noexcept;
378 const
String getName() const override;
380 void prepareToPlay (
double newSampleRate,
int estimatedSamplesPerBlock) override;
381 void releaseResources() override;
384 bool supportsDoublePrecisionProcessing() const override;
386 double getTailLengthSeconds() const override;
387 bool acceptsMidi() const override;
388 bool producesMidi() const override;
390 bool hasEditor() const override;
393 int getNumPrograms() override;
394 int getCurrentProgram() override;
395 void setCurrentProgram (
int) override;
396 const
String getProgramName (
int) override;
397 void changeProgramName (
int, const
String&) override;
400 void setStateInformation (const
void* data,
int sizeInBytes) override;
406 const IODeviceType type;
413 const
String getName() const override;
414 void prepareToPlay (
double,
int) override;
415 void releaseResources() override;
418 bool supportsDoublePrecisionProcessing() const override;
420 void reset() override;
421 void setNonRealtime (
bool) noexcept override;
423 double getTailLengthSeconds() const override;
424 bool acceptsMidi() const override;
425 bool producesMidi() const override;
427 bool hasEditor()
const override {
return false; }
435 void setStateInformation (
const void* data,
int sizeInBytes)
override;
A multi-channel buffer containing floating point audio samples.
Base class for an active instance of a plugin.
Base class for the component that acts as the GUI for an AudioProcessor.
A special type of AudioProcessor that can live inside an AudioProcessorGraph in order to use the audi...
AudioProcessorGraph * getParentGraph() const noexcept
Returns the parent graph to which this processor belongs, or nullptr if it hasn't yet been added to o...
IODeviceType getType() const noexcept
Returns the mode of this processor.
IODeviceType
Specifies the mode in which this processor will operate.
Represents an input or output channel of a node in an AudioProcessorGraph.
Represents one of the nodes, or processors, in an AudioProcessorGraph.
void setBypassed(bool shouldBeBypassed) noexcept
Tell this node to bypass processing.
bool isBypassed() const noexcept
Returns if the node is bypassed or not.
AudioProcessor * getProcessor() const noexcept
The actual processor object that this node represents.
NamedValueSet properties
A set of user-definable properties that are associated with this node.
const NodeID nodeID
The ID number assigned to this node.
A type of AudioProcessor which plays back a graph of other AudioProcessors.
int getNumPrograms() override
Returns the number of preset programs the processor supports.
void setCurrentProgram(int) override
Called by the host to change the current program.
Node::Ptr getNode(int index) const noexcept
Returns a pointer to one of the nodes in the graph.
void changeProgramName(int, const String &) override
Called by the host to rename a program.
int getCurrentProgram() override
Returns the number of the currently active program.
~AudioProcessorGraph() override
Destructor.
AudioProcessorEditor * createEditor() override
Creates the processor's GUI.
UpdateKind
Indicates how the graph should be updated after a change.
const String getProgramName(int) override
Must return the name of a given program.
Base class for audio processing classes or plugins.
Holds a list of ChangeListeners, and sends messages to them when instructed.
A class to hold a resizable block of raw data.
Holds a sequence of time-stamped midi events.
Holds a set of named var objects.
A small class to represent some facts about a particular type of plug-in.
Holds a list of objects derived from ReferenceCountedObject, or which implement basic reference-count...
int size() const noexcept
Returns the current number of objects in the array.
A smart-pointer class which points to a reference-counted object.
A base class which provides methods for reference-counting.
constexpr bool approximatelyEqual(Type a, Type b, Tolerance< Type > tolerance=Tolerance< Type >{} .withAbsolute(std::numeric_limits< Type >::min()) .withRelative(std::numeric_limits< Type >::epsilon()))
Returns true if the two floating-point numbers are approximately equal.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
Represents a connection between two channels of two nodes in an AudioProcessorGraph.
Each node in the graph has a UID of this type.