Preliminary work to allow more input channels

This commit is contained in:
xenakios 2018-02-12 16:44:21 +02:00
parent 05a6eb21f0
commit 07a54c4cdc
5 changed files with 20 additions and 9 deletions

View File

@ -52,8 +52,9 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
AudioProcessorParameterWithID* parid = dynamic_cast<AudioProcessorParameterWithID*>(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<ParameterComponent>(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);

View File

@ -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);

View File

@ -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<double> playrange, int numoutchans, int maxBlockSize, String& err);
SharedResourcePointer<MyThumbCache> 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;

View File

@ -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="&#10;&#10;">
<MAINGROUP id="nozXHl" name="PaulXStretch">
<GROUP id="{03DA6B32-F666-FF60-F168-4385D0847058}" name="Source">

View File

@ -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)