From b5dc1759b170ca6ff391c16e817eca5d7bcd1ddb Mon Sep 17 00:00:00 2001 From: essej Date: Fri, 22 Apr 2022 00:55:35 -0400 Subject: [PATCH] changed rewind to be a meta parameter to pass auval. update ios build number --- README.md | 2 +- Source/PluginEditor.cpp | 2 +- Source/PluginProcessor.cpp | 23 +++++++++++++++++++---- mobile/paulstretchplugin_ios.jucer | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7826c80..6fdd633 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Copyright (C) 2006-2011 Nasca Octavian Paul, Tg. Mures, Romania # License and 3rd Party Software Released under GNU General Public License v.3 license with App Store license -exception. The full license text is in the LICENSE and LICENSE_EXCEPTION files. Paul Nasca, Xenakios and Jesse Chappell all explicitly permitted the license exception clause. +exception. The full license text is in the LICENSE file. Paul Nasca, Xenakios and Jesse Chappell all explicitly permitted the license exception clause. It is built using JUCE 6 (slightly modified on a public fork), I'm using the very handy tool `git-subrepo` to include the source code for my forks of those software libraries in this repository. diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 2230830..0e89585 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -116,7 +116,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau m_rewind_button->setTooltip("Return to start"); m_rewind_button->onClick = [this]() { - *processor.getBoolParameter(cpi_rewind) = true; + processor.setParameter( cpi_rewind, 1.0f); //processor.getStretchSource()->seekPercent(processor.getStretchSource()->getPlayRange().getStart()); }; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 2ffc284..2a0cee1 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -199,7 +199,22 @@ m_bufferingthread("pspluginprebufferthread"), m_is_stand_alone_offline(is_stand_ } addParameter(new AudioParameterBool("loop_enabled0", "Loop", true)); // 60 - addParameter(new AudioParameterBool("rewind0", "Rewind", false)); // 61 + + //addParameter(new AudioParameterBool("rewind0", "Rewind", false)); // 61 + // have to add it this way to specify rewind as a Meta parameter, so that Apple auval will pass it + addParameter(new AudioProcessorValueTreeState::Parameter ("rewind0", + "Rewind", + "", + NormalisableRange(0.0f, 1.0f), + 0.0f, // float defaultParameterValue, + nullptr, //std::function valueToTextFunction, + nullptr, // std::function textToValueFunction, + true, // bool isMetaParameter, + false, // bool isAutomatableParameter, + true, // bool isDiscrete, + AudioProcessorParameter::Category::genericParameter, // AudioProcessorParameter::Category parameterCategory, + true));//bool isBoolean)); + auto dprate_convertFrom0To1Func = [](float rangemin, float rangemax, float value) { if (value < 0.5f) @@ -772,7 +787,7 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl m_cur_sr = sampleRate; m_curmaxblocksize = samplesPerBlock; m_input_buffer.setSize(getTotalNumInputChannels(), samplesPerBlock); - *getBoolParameter(cpi_rewind) = false; + setParameter(cpi_rewind, 0.0f); m_lastrewind = false; int numoutchans = *m_outchansparam; if (numoutchans != m_cur_num_out_chans) @@ -1042,12 +1057,12 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M if (m_stretch_source->isLoopEnabled() != *getBoolParameter(cpi_looping_enabled)) m_stretch_source->setLoopingEnabled(*getBoolParameter(cpi_looping_enabled)); - bool rew = *getBoolParameter(cpi_rewind); + bool rew = getParameter(cpi_rewind) > 0.0f; if (rew != m_lastrewind) { if (rew == true) { - *getBoolParameter(cpi_rewind) = false; + setParameter(cpi_rewind, 0.0f); m_stretch_source->seekPercent(m_stretch_source->getPlayRange().getStart()); } m_lastrewind = rew; diff --git a/mobile/paulstretchplugin_ios.jucer b/mobile/paulstretchplugin_ios.jucer index 20b3fad..9b10caa 100644 --- a/mobile/paulstretchplugin_ios.jucer +++ b/mobile/paulstretchplugin_ios.jucer @@ -88,7 +88,7 @@