6#include "dsp/midi_event.h"
8#include "utils/icloneable.h"
9#include "utils/ring_buffer.h"
30 [[gnu::hot]]
void process_block (
40 void clear_buffer (std::size_t offset, std::size_t nframes)
override;
42 friend void init_from (
44 const MidiPort &other,
48 friend void to_json (nlohmann::json &j,
const MidiPort &p)
50 to_json (j,
static_cast<const Port &
> (p));
52 friend void from_json (
const nlohmann::json &j,
MidiPort &p)
54 from_json (j,
static_cast<Port &
> (p));
75 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(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.
Lightweight UTF-8 string wrapper with safe conversions.
uint32_t sample_rate_t
Sample rate.
uint32_t nframes_t
Frame count.
Common struct to pass around during processing to avoid repeating the data in function arguments.