Skip to content

Commit

Permalink
Add JUCEAAP_AUDIO_PROCESSOR_CHANGE_DETAILS_UNAVAILABLE option for JUC…
Browse files Browse the repository at this point in the history
…E <6.0.8

juce::AudioProcessor::ChangeDetails is not available until JUCE 6.0.8, and
we need to work around that if we want to suport older JUCE.

This fixes aap-juce-hera build.
  • Loading branch information
atsushieno committed Mar 6, 2024
1 parent 0600003 commit 59efc33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aap-modules/aap_audio_processors/juceaap_AAPWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,22 @@ class JuceAAPWrapper : juce::AudioPlayHead, juce::AudioProcessorListener {
// juce::AudioProcessorListener implementation
void audioProcessorParameterChanged(juce::AudioProcessor* processor, int parameterIndex, float newValue) override {
}

#if JUCEAAP_AUDIO_PROCESSOR_CHANGE_DETAILS_UNAVAILABLE
void audioProcessorChanged(juce::AudioProcessor* processor) override {
auto ext = (aap_parameters_host_extension_t *) host.get_extension(&host, AAP_PARAMETERS_EXTENSION_URI);
if (ext)
ext->notify_parameters_changed(ext, &host);
}
#else
void audioProcessorChanged(juce::AudioProcessor* processor, const juce::AudioProcessorListener::ChangeDetails &details) override {
if (details.parameterInfoChanged) {
auto ext = (aap_parameters_host_extension_t *) host.get_extension(&host, AAP_PARAMETERS_EXTENSION_URI);
if (ext)
ext->notify_parameters_changed(ext, &host);
}
}
#endif

void allocateBuffer(aap_buffer_t *aapBuffer) {
if (!aapBuffer) {
Expand Down

0 comments on commit 59efc33

Please sign in to comment.