6#include "dsp/midi_event.h"
8#include "utils/icloneable.h"
9#include "utils/ring_buffer.h"
30 [[gnu::hot]]
void process_block (
36 units::sample_rate_t sample_rate,
41 void clear_buffer (std::size_t offset, std::size_t nframes)
override;
43 friend void init_from (
45 const MidiPort &other,
49 friend void to_json (nlohmann::json &j,
const MidiPort &p)
51 to_json (j,
static_cast<const Port &
> (p));
53 friend void from_json (
const nlohmann::json &j,
MidiPort &p)
55 from_json (j,
static_cast<Port &
> (p));
76 BOOST_DESCRIBE_CLASS (MidiPort, (Port), (), (), ())
Container for passing midi events through ports.
std::unique_ptr< RingBuffer< dsp::MidiEvent > > midi_ring_
Ring buffer for saving MIDI events to be used in the UI instead of directly accessing the events.
void release_resources() override
Called to release resources allocated by prepare_for_processing().
void prepare_for_processing(const graph::GraphNode *node, units::sample_rate_t sample_rate, nframes_t max_block_length) override
Called to allocate resources required for processing.
void clear_buffer(std::size_t offset, std::size_t nframes) override
Clears the port buffer.
dsp::MidiEvents midi_events_
Contains raw MIDI data (MIDI ports only).
A base class for ports used for connecting processors in the DSP graph.
Represents a node in a DSP graph.
Lightweight UTF-8 string wrapper with safe conversions.
uint32_t nframes_t
Frame count.
Common struct to pass around during processing to avoid repeating the data in function arguments.