Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::IHardwareAudioInterface Class Referenceabstract

Abstraction for hardware audio interface. More...

#include <src/dsp/hardware_audio_interface.h>

Inheritance diagram for zrythm::dsp::IHardwareAudioInterface:

Public Member Functions

virtual nframes_t get_block_length () const =0
 Returns the current block length (buffer size) in frames.
virtual units::sample_rate_t get_sample_rate () const =0
 Returns the current sample rate.
virtual void add_audio_callback (IAudioCallback *callback)=0
 Adds an audio callback to receive audio I/O events.
virtual void remove_audio_callback (IAudioCallback *callback)=0
 Removes a previously added audio callback.

Detailed Description

Abstraction for hardware audio interface.

This interface decouples AudioEngine and DspGraphDispatcher from juce::AudioDeviceManager, allowing for easier testing and flexibility.

Definition at line 20 of file hardware_audio_interface.h.

Member Function Documentation

◆ add_audio_callback()

virtual void zrythm::dsp::IHardwareAudioInterface::add_audio_callback ( IAudioCallback * callback)
pure virtual

Adds an audio callback to receive audio I/O events.

The caller must ensure callback remains alive until after remove_audio_callback() is called with the same pointer.

Implemented in zrythm::dsp::JuceHardwareAudioInterface, zrythm::test_helpers::MockHardwareAudioInterface, and zrythm::test_helpers::ThreadedMockHardwareAudioInterface.

◆ get_block_length()

virtual nframes_t zrythm::dsp::IHardwareAudioInterface::get_block_length ( ) const
pure virtual

◆ get_sample_rate()

virtual units::sample_rate_t zrythm::dsp::IHardwareAudioInterface::get_sample_rate ( ) const
pure virtual

◆ remove_audio_callback()

virtual void zrythm::dsp::IHardwareAudioInterface::remove_audio_callback ( IAudioCallback * callback)
pure virtual

Removes a previously added audio callback.

callback must be the same pointer passed to add_audio_callback().

Implemented in zrythm::dsp::JuceHardwareAudioInterface, zrythm::test_helpers::MockHardwareAudioInterface, and zrythm::test_helpers::ThreadedMockHardwareAudioInterface.


The documentation for this class was generated from the following file: