From 836dad1e7db16e3bdf85922570773f578f8e2d51 Mon Sep 17 00:00:00 2001 From: xenakios Date: Tue, 14 Nov 2017 03:13:32 +0200 Subject: [PATCH] Try handling multichannel stuff. Not going too well, looks like the plugin will need to get a setting to set the actual number of output channels that will be processed... --- Source/PluginProcessor.cpp | 25 ++++--------------------- Source/PluginProcessor.h | 1 + paulstretchplugin.jucer | 2 +- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 2ce0828..4617b50 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -113,6 +113,8 @@ void PaulstretchpluginAudioProcessor::changeProgramName (int index, const String //============================================================================== void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock) { + if (getNumOutputChannels() != m_cur_num_out_chans) + m_ready_to_play = false; if (m_using_memory_buffer == true) { int len = jlimit(100,m_recbuffer.getNumSamples(), m_rec_pos); @@ -134,29 +136,10 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl String err; m_control->startplay(false, true, { *getFloatParameter(5),*getFloatParameter(6) }, - 2, err); + this->getNumOutputChannels(), err); + m_cur_num_out_chans = getNumOutputChannels(); m_ready_to_play = true; } - return; - m_ready_to_play = false; - m_control->set_input_file(File("C:/MusicAudio/sourcesamples/sheila.wav"), [this](String cberr) - { - if (cberr.isEmpty()) - { - m_ready_to_play = true; - String err; - m_control->update_player_stretch(); - m_control->update_process_parameters(); - m_control->startplay(false, true, { 0.0,1.0 }, 2, err); - auto ed = dynamic_cast(getActiveEditor()); - if (ed) - { - ed->setAudioFile(m_control->getStretchAudioSource()->getAudioFile()); - } - } - else m_ready_to_play = false; - }); - } void PaulstretchpluginAudioProcessor::releaseResources() diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 4ccd946..ef9b754 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -74,6 +74,7 @@ private: int m_rec_pos = 0; void finishRecording(int lenrecorded); bool m_using_memory_buffer = true; + int m_cur_num_out_chans = 2; std::mutex m_mutex; //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) diff --git a/paulstretchplugin.jucer b/paulstretchplugin.jucer index a056a95..72be53f 100644 --- a/paulstretchplugin.jucer +++ b/paulstretchplugin.jucer @@ -7,7 +7,7 @@ buildVST="1" buildVST3="0" buildAU="1" buildAUv3="0" buildRTAS="0" buildAAX="0" buildStandalone="1" enableIAA="0" pluginName="paulstretchplugin" pluginDesc="paulstretchplugin" pluginManufacturer="Xenakios" - pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{8,8}" + pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{4,4}, {8,8}" pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginIsMidiEffectPlugin="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="paulstretchpluginAU" pluginRTASCategory="" aaxIdentifier="com.yourcompany.paulstretchplugin"