Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
iaudio_callback.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#include <string_view>
8
9#include "utils/units.h"
10
11namespace zrythm::dsp
12{
13
22{
23public:
24 virtual ~IAudioCallback () = default;
25
29 virtual void process_audio (
30 std::span<const float * const> input_channels,
31 std::span<float * const> output_channels,
32 units::sample_u32_t num_samples) noexcept = 0;
33
37 virtual void about_to_start () = 0;
38
42 virtual void stopped () = 0;
43
47 virtual void error (std::string_view error_message) = 0;
48};
49
50} // namespace zrythm::dsp
Pure-abstract audio callback interface.
virtual void stopped()=0
Called when the audio device has stopped.
virtual void process_audio(std::span< const float *const > input_channels, std::span< float *const > output_channels, units::sample_u32_t num_samples) noexcept=0
Called when the audio device wants to process a block of audio data.
virtual void about_to_start()=0
Called when the audio device is about to start processing.
virtual void error(std::string_view error_message)=0
Called when an error occurs with the audio device.