Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_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 <span>
7
8#include "dsp/processor_base.h"
9#include "utils/units.h"
10
11#include <QObject>
12
13namespace zrythm::dsp
14{
15
23class AudioInputProcessor final : public QObject, public ProcessorBase
24{
25 Q_OBJECT
26
27public:
28 using InputDataProvider = std::function<std::span<const float * const> ()>;
29
30 AudioInputProcessor (
31 InputDataProvider provider,
32 units::channel_count_t hw_input_channel_count,
33 ProcessorBaseDependencies dependencies,
34 QObject * parent = nullptr);
35
38 const dsp::ITransport &transport,
39 const dsp::TempoMap &tempo_map) noexcept [[clang::nonblocking]] override;
40
42 find_output_port (int first_channel_index, bool stereo) const noexcept
43 [[clang::nonblocking]];
44
45private:
46 InputDataProvider provider_;
47
48 struct PortMapping
49 {
50 AudioPort * port;
51 int src_channel_start;
52 units::channel_count_t src_channel_count;
53 };
54
55 std::vector<PortMapping> port_mappings_;
56};
57
58}
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.
Audio port specifics.
Definition audio_port.h:26
Interface for transport.
Definition itransport.h:16
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition graph_node.h:51