Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
midi_input_processor.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <memory>
7
8#include "dsp/processor_base.h"
9#include "utils/units.h"
10
11#include <QObject>
12
13namespace zrythm::dsp
14{
15
17
24class MidiInputProcessor final : public QObject, public ProcessorBase
25{
26 Q_OBJECT
27
28public:
29 MidiInputProcessor (
30 std::shared_ptr<dsp::MidiDeviceBuffer> buffer,
31 utils::IObjectRegistry &registry,
32 QObject * parent = nullptr);
33
34 ~MidiInputProcessor () override;
35
36 void custom_prepare_for_processing (
37 const dsp::graph::GraphNode * node,
38 units::sample_rate_t sample_rate,
39 units::sample_u32_t max_block_length) override;
40
43 const dsp::ITransport &transport,
44 const dsp::TempoMap &tempo_map) noexcept [[clang::nonblocking]] override;
45
46 dsp::MidiPort &get_output_port () const noexcept;
47
48 void set_block_start_time (units::precise_second_t time);
49
50private:
51 struct Impl;
52 std::unique_ptr<Impl> impl_;
53};
54
55}
Interface for transport.
Definition itransport.h:16
Lock-free SPSC buffer for MIDI events between the MIDI device thread and the audio thread.
void custom_process_block(dsp::graph::ProcessBlockInfo time_nfo, const dsp::ITransport &transport, const dsp::TempoMap &tempo_map) noexcept override
Custom processor logic after processing all owned parameters.
MIDI port specifics.
Definition midi_port.h:21
Represents a node in a DSP graph.
Definition graph_node.h:173
Abstract interface for a UUID-keyed object registry.
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition graph_node.h:51