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

JUCE-based implementation of IHardwareAudioInterface. More...

#include <src/dsp/juce_hardware_audio_interface.h>

Inheritance diagram for zrythm::dsp::JuceHardwareAudioInterface:
Collaboration diagram for zrythm::dsp::JuceHardwareAudioInterface:

Public Member Functions

 JuceHardwareAudioInterface (std::shared_ptr< juce::AudioDeviceManager > device_manager)
AudioDeviceInfo get_device_info () const override
 Returns the current audio device information.
void add_audio_callback (IAudioCallback *callback) override
 Adds an audio callback to receive audio I/O events.
void remove_audio_callback (IAudioCallback *callback) override
 Removes a previously added audio callback.
std::optional< juce::AudioWorkgroup > get_device_audio_workgroup () const
 Returns the audio workgroup for the current device.

Static Public Member Functions

static std::unique_ptr< IHardwareAudioInterfacecreate (std::shared_ptr< juce::AudioDeviceManager > device_manager)
 Creates a JUCE-based hardware audio interface.

Detailed Description

JUCE-based implementation of IHardwareAudioInterface.

Wraps a juce::AudioDeviceManager to provide the hardware audio interface. Bridges IAudioCallback to juce::AudioIODeviceCallback via an internal adapter.

Definition at line 25 of file juce_hardware_audio_interface.h.

Member Function Documentation

◆ add_audio_callback()

void zrythm::dsp::JuceHardwareAudioInterface::add_audio_callback ( IAudioCallback * callback)
overridevirtual

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.

Implements zrythm::dsp::IHardwareAudioInterface.

◆ get_device_audio_workgroup()

std::optional< juce::AudioWorkgroup > zrythm::dsp::JuceHardwareAudioInterface::get_device_audio_workgroup ( ) const
nodiscard

Returns the audio workgroup for the current device.

This is not part of the IHardwareAudioInterface interface to avoid JUCE dependencies in the interface. Callers that need the workgroup should use this method on the concrete type.

◆ get_device_info()

AudioDeviceInfo zrythm::dsp::JuceHardwareAudioInterface::get_device_info ( ) const
nodiscardoverridevirtual

Returns the current audio device information.

Guaranteed to return up-to-date values during about_to_start() callbacks.

Implements zrythm::dsp::IHardwareAudioInterface.

◆ remove_audio_callback()

void zrythm::dsp::JuceHardwareAudioInterface::remove_audio_callback ( IAudioCallback * callback)
overridevirtual

Removes a previously added audio callback.

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

Implements zrythm::dsp::IHardwareAudioInterface.


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