#pragma once #include #include namespace cxx_juce { struct BoxedAudioIODeviceCallback; class AudioCallbackWrapper : public juce::AudioIODeviceCallback { public: explicit AudioCallbackWrapper (rust::Box callback); void audioDeviceAboutToStart (juce::AudioIODevice* device) override; void audioDeviceIOCallbackWithContext (const float* const* inputChannelData, int numInputChannels, float* const* outputChannelData, int numOutputChannels, int numSamples, const juce::AudioIODeviceCallbackContext& context) override; void audioDeviceStopped() override; private: rust::Box _callback; }; std::unique_ptr wrapAudioCallback (rust::Box callback); } // namespace cxx_juce