11namespace tracktion {
inline namespace engine
17 : track (&at), trackPtr (at), input (
std::
move (inputNode))
21 setOptimisations ({ tracktion::graph::ClearBuffers::no,
22 tracktion::graph::AllocateAudioBuffer::no });
24 pendingMessages.reserve (50);
25 dispatchingMessages.reserve (50);
29 : clipPtr (c), input (
std::
move (inputNode))
33 setOptimisations ({ tracktion::graph::ClearBuffers::no,
34 tracktion::graph::AllocateAudioBuffer::no });
36 pendingMessages.reserve (50);
37 dispatchingMessages.reserve (50);
43 auto props = input->getNodeProperties();
51 return { input.get() };
58bool LiveMidiOutputNode::isReadyToProcess()
60 return input->hasProcessed();
65 auto sourceBuffers = input->getProcessedOutput();
66 auto& destMidiBlock = pc.buffers.midi;
67 jassert (sourceBuffers.audio.getSize() == pc.buffers.audio.getSize());
70 if (input->numOutputNodes == 1)
71 destMidiBlock.swapWith (sourceBuffers.midi);
73 destMidiBlock.copyFrom (sourceBuffers.midi);
75 setAudioOutput (input.get(), sourceBuffers.audio);
77 bool needToUpdate =
false;
79 if (sourceBuffers.midi.isNotEmpty())
83 for (
auto& m : sourceBuffers.midi)
84 pendingMessages.add (m);
86 needToUpdate = ! pendingMessages.isEmpty();
94void LiveMidiOutputNode::handleAsyncUpdate()
98 pendingMessages.swapWith (dispatchingMessages);
101 if (track !=
nullptr)
102 for (
auto& m : dispatchingMessages)
103 track->getListeners().call (&
AudioTrack::Listener::recordedMidiMessageSentToPlugins, *track, m);
105 if (clipPtr !=
nullptr)
106 for (
auto& m : dispatchingMessages)
107 clipPtr->getListeners().call (&
Clip::Listener::midiMessageGenerated, *clipPtr, m);
109 dispatchingMessages.clear();
Struct to describe a single iteration of a process call.
Holds some really basic properties of a node.
Passed into Nodes when they are being initialised, to give them useful contextual information that th...