|
Krotos Modules 3
|
Uses juce::AudioProcessorGraph to store Kwidgets and their audio connections, and process audio through them. More...
#include <KwidgetProcessorGraph.h>
Public Types | |
| using | Node = AudioProcessorGraph::Node |
| using | NodeID = AudioProcessorGraph::NodeID |
| using | IOProcessor = AudioProcessorGraph::AudioGraphIOProcessor |
| using | Connection = AudioProcessorGraph::Connection |
Public Member Functions | |
| KwidgetProcessorGraph (int numVoices, int inputChannels, int outputChannels) | |
| ~KwidgetProcessorGraph ()=default | |
| void | prepareToPlay (double sampleRate, int samplesPerBlock) |
| int | getNumVoices () const |
| void | noteOn (int voiceIdx, int midiNote, float velocity) |
| void | noteOff (int voiceIdx, float velocity) |
| void | noteCleared (int voiceIdx) |
| bool | isActive (int voiceIdx) |
| void | processVoice (int voiceIdx, AudioBuffer< float > &buffer) |
| void | addKwidget (std::unique_ptr< Kwidget > kwidgetToAdd) |
| void | removeKwidget (Kwidget *kwidget) |
| const OwnedArray< Kwidget > & | getKwidgets () const |
| bool | canConnect (Kwidget *src, Kwidget *dest) |
| void | addConnection (Kwidget *src, Kwidget *dest, int baseChannel, int numConnections) |
| void | removeConnection (Kwidget *src, Kwidget *dest) |
| void | connectToInputNode (Kwidget *dest, int baseChannel, int numConnections) |
| void | connectToOutputNode (Kwidget *src, int baseChannel, int numChannels) |
| void | clearKwidgets () |
| void | clearConnections () |
| void | debugConnections () const |
Private Member Functions | |
| NodeID | getNodeID (Kwidget *k) |
| bool | canConnect (NodeID src, NodeID dest) |
| void | addMultipleConnections (NodeID src, NodeID dest, int baseChannel, int numConnections) |
| void | addMultipleConnectionsToOutputNode (NodeID src, int baseChannel, int numConnections) |
| void | removeConnection (NodeID src, NodeID dest) |
Private Attributes | |
| const int | m_numVoices |
| OwnedArray< Kwidget > | m_kwidgets |
| std::map< Kwidget *, NodeID > | m_nodeIDs |
| OwnedArray< AudioProcessorGraph > | m_graphs |
| double | m_sampleRate {0.0} |
| int | m_blockSize {0} |
| int | m_numInputChannels |
| int | m_numOutputChannels |
| Array< Node::Ptr > | m_audioInputNodes |
| Array< Node::Ptr > | m_audioOutputNodes |
| Array< Node::Ptr > | m_midiInputNodes |
| Array< Node::Ptr > | m_midiOutputNodes |
Uses juce::AudioProcessorGraph to store Kwidgets and their audio connections, and process audio through them.
This class holds an instance of AudioProcessorGraph and allows for audio processing nodes to be added and connected as Kwidgets.
When a new Kwidget is added, it transfers ownership of its KwidgetProcessor to this class. Currently, there is no method to return ownership of the KwidgetProcessor to its Kwidget, meaning both classes must be destroyed simultaneously.
| using krotos::KwidgetProcessorGraph::Connection = AudioProcessorGraph::Connection |
| using krotos::KwidgetProcessorGraph::IOProcessor = AudioProcessorGraph::AudioGraphIOProcessor |
| using krotos::KwidgetProcessorGraph::Node = AudioProcessorGraph::Node |
| using krotos::KwidgetProcessorGraph::NodeID = AudioProcessorGraph::NodeID |
| krotos::KwidgetProcessorGraph::KwidgetProcessorGraph | ( | int | numVoices, |
| int | inputChannels, | ||
| int | outputChannels ) |
Constructor.
|
default |
Destructor.
| void krotos::KwidgetProcessorGraph::addKwidget | ( | std::unique_ptr< Kwidget > | kwidgetToAdd | ) |
|
private |
|
private |
Check if a potential audio connection can be made between two Kwidgets.
| void krotos::KwidgetProcessorGraph::clearConnections | ( | ) |
Clears all connections in the AudioProcessorGraph.
| void krotos::KwidgetProcessorGraph::clearKwidgets | ( | ) |
Clears all connections and Kwidgets in the AudioProcessorGraph.
| void krotos::KwidgetProcessorGraph::connectToInputNode | ( | Kwidget * | dest, |
| int | baseChannel, | ||
| int | numConnections ) |
Connects the audio input channels of the plugin to a Kwidget.
| baseChannel | The the channel number in the destintation where we start connecting from |
| numConnections | The number of connections we want to make |
| void krotos::KwidgetProcessorGraph::connectToOutputNode | ( | Kwidget * | src, |
| int | baseChannel, | ||
| int | numChannels ) |
Connects a Kwidget to the audio out node
| void krotos::KwidgetProcessorGraph::debugConnections | ( | ) | const |
|
inline |
Get a list of all the Kwidget objects currently owned by this KwidgetProcessorGraph.
|
private |
|
inline |
Get the number of voices this KwidgetProcessorGraph is capable of producing.
| bool krotos::KwidgetProcessorGraph::isActive | ( | int | voiceIdx | ) |
| void krotos::KwidgetProcessorGraph::noteCleared | ( | int | voiceIdx | ) |
Send a message to all Kwidgets of a particular voice that the voice is done rendering.
| void krotos::KwidgetProcessorGraph::noteOff | ( | int | voiceIdx, |
| float | velocity ) |
Send a 'note off' event to all the Kwidgets of a particular voice.
| void krotos::KwidgetProcessorGraph::noteOn | ( | int | voiceIdx, |
| int | midiNote, | ||
| float | velocity ) |
Send a 'note on' event to all the Kwidgets of a particular voice.
| void krotos::KwidgetProcessorGraph::prepareToPlay | ( | double | sampleRate, |
| int | samplesPerBlock ) |
Prepare the AudioProcessorGraph and all of its nodes for audio processing.
| void krotos::KwidgetProcessorGraph::processVoice | ( | int | voiceIdx, |
| AudioBuffer< float > & | buffer ) |
Process audio through all of the Kwidgets of a particular voice.
| void krotos::KwidgetProcessorGraph::removeKwidget | ( | Kwidget * | kwidget | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |