From 07a54c4cdc3bb52cff317f399f14d54e7ef18ab1 Mon Sep 17 00:00:00 2001 From: xenakios Date: Mon, 12 Feb 2018 16:44:21 +0200 Subject: [PATCH] Preliminary work to allow more input channels --- Source/PluginEditor.cpp | 10 +++++++--- Source/PluginProcessor.cpp | 6 ++++-- Source/PluginProcessor.h | 2 ++ paulstretchplugin.jucer | 9 +++++---- readme.txt | 2 ++ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 3354eb8..2fa1218 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -52,8 +52,9 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau AudioProcessorParameterWithID* parid = dynamic_cast(pars[i]); jassert(parid); bool notifyonlyonrelease = false; - if (parid->paramID.startsWith("fftsize") || parid->paramID.startsWith("numoutchans")) - notifyonlyonrelease = true; + if (parid->paramID.startsWith("fftsize") || parid->paramID.startsWith("numoutchans") + || parid->paramID.startsWith("numinchans")) + notifyonlyonrelease = true; m_parcomps.push_back(std::make_shared(pars[i],notifyonlyonrelease)); int group_id = -1; if (i == cpi_harmonicsbw || i == cpi_harmonicsfreq || i == cpi_harmonicsgauss || i == cpi_numharmonics) @@ -149,10 +150,13 @@ void PaulstretchpluginAudioProcessorEditor::resized() m_parcomps[cpi_freeze]->setBounds(xoffs, yoffs, div - 1, 24); xoffs = 1; yoffs += 25; - div = w / 2; + div = w / 3; m_parcomps[cpi_main_volume]->setBounds(xoffs, yoffs, div-1, 24); xoffs += div; + m_parcomps[cpi_num_inchans]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; m_parcomps[cpi_num_outchans]->setBounds(xoffs, yoffs, div-1, 24); + div = w / 2; xoffs = 1; yoffs += 25; m_parcomps[cpi_fftsize]->setBounds(xoffs, yoffs, div - 1, 24); diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 25602c0..4ace62c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -140,6 +140,8 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() addParameter(new AudioParameterFloat("maxcapturelen_0", "Max capture length", 1.0f, 120.0f, 10.0f)); // 29 addParameter(new AudioParameterBool("passthrough0", "Pass input through", false)); // 30 addParameter(new AudioParameterBool("markdirty0", "Internal (don't use)", false)); // 31 + m_inchansparam = new AudioParameterInt("numinchans0", "Num input channels", 2, 8, 2); // 32 + addParameter(m_inchansparam); // 32 auto& pars = getParameters(); for (const auto& p : pars) m_reset_pars.push_back(p->getValue()); @@ -394,7 +396,7 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl ScopedLock locker(m_cs); m_cur_sr = sampleRate; m_curmaxblocksize = samplesPerBlock; - m_input_buffer.setSize(2, samplesPerBlock); + m_input_buffer.setSize(getMainBusNumInputChannels(), samplesPerBlock); int numoutchans = *m_outchansparam; if (numoutchans != m_cur_num_out_chans) m_prebuffering_inited = false; @@ -623,7 +625,7 @@ void PaulstretchpluginAudioProcessor::setRecordingEnabled(bool b) { m_using_memory_buffer = true; m_current_file = File(); - m_recbuffer.setSize(2, m_max_reclen*getSampleRateChecked()+4096,false,false,true); + m_recbuffer.setSize(getMainBusNumInputChannels(), m_max_reclen*getSampleRateChecked()+4096,false,false,true); m_recbuffer.clear(); m_rec_pos = 0; m_thumb->reset(m_recbuffer.getNumChannels(), getSampleRateChecked(), lenbufframes); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 01480fb..c471873 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -57,6 +57,7 @@ const int cpi_pause_enabled = 28; const int cpi_max_capture_len = 29; const int cpi_passthrough = 30; const int cpi_markdirty = 31; +const int cpi_num_inchans = 32; class MyPropertiesFile { @@ -192,6 +193,7 @@ private: void startplay(Range playrange, int numoutchans, int maxBlockSize, String& err); SharedResourcePointer m_thumbcache; AudioParameterInt* m_outchansparam = nullptr; + AudioParameterInt* m_inchansparam = nullptr; int m_curmaxblocksize = 0; double m_cur_sr = 0.0; bool m_last_host_playing = false; diff --git a/paulstretchplugin.jucer b/paulstretchplugin.jucer index ea67e89..862d90e 100644 --- a/paulstretchplugin.jucer +++ b/paulstretchplugin.jucer @@ -7,10 +7,11 @@ buildVST3="0" buildAU="1" buildAUv3="0" buildRTAS="0" buildAAX="0" buildStandalone="1" enableIAA="0" pluginName="PaulXStretch" pluginDesc="PaulXStretch" pluginManufacturer="Xenakios" pluginManufacturerCode="XenS" pluginCode="Fn1r" - pluginChannelConfigs="{2,2},{2,4}, {2,8}" pluginIsSynth="0" pluginWantsMidiIn="0" - pluginProducesMidiOut="0" pluginIsMidiEffectPlugin="0" pluginEditorRequiresKeys="0" - pluginAUExportPrefix="paulxstretchAU" pluginRTASCategory="" aaxIdentifier="com.yourcompany.paulstretchplugin" - pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="5.2.0" + pluginChannelConfigs="{2,2},{2,4}, {2,8}, {8,8}" pluginIsSynth="0" + pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginIsMidiEffectPlugin="0" + pluginEditorRequiresKeys="0" pluginAUExportPrefix="paulxstretchAU" + pluginRTASCategory="" aaxIdentifier="com.yourcompany.paulstretchplugin" + pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="5.2.1" headerPath=" "> diff --git a/readme.txt b/readme.txt index e66f11c..541e269 100644 --- a/readme.txt +++ b/readme.txt @@ -8,6 +8,8 @@ Released under GNU General Public License v.2 license. History : +02-12-2018 1.0.1 + -Increased maximum number of input channels to 8 02-09-2018 1.0.0 -Control/Command click on waveform seeks (if click within active play range) -Moved prebuffering amount menu to prebuffering meter (click to show)